Business Intelligence Agent is a Next.js application for asking practical business questions about data stored in Monday.com boards. It retrieves the configured Deals and Work Orders boards, normalizes their records, checks for incomplete values, and asks Groq to produce a concise analysis and recommendation.
The project was built in order to avoid sending a large raw board export directly to a language model. Before prompting the model, it creates a compact business summary from the full dataset, including distributions, value statistics, representative records, and data-quality signals.
- Monday.com GraphQL retrieval for the configured Deals and Work Orders boards
- Record normalization into a consistent application shape
- Missing or incomplete value detection
- Business summary generation across the full retrieved dataset
- Natural-language questions through the dashboard
- Groq-generated business analysis using
llama-3.3-70b-versatile - Display of records analyzed, data-quality notes, analysis, and API errors
- Responsive UI built with the Next.js App Router and Tailwind CSS
- Next.js 16.2.10 with the App Router
- React 19.2.4 and TypeScript
- Tailwind CSS 4
- Monday.com GraphQL API
- Groq SDK 1.3.0
- Groq model:
llama-3.3-70b-versatile
The /api/chat route runs the following flow for each question:
Monday.com
↓
Data retrieval
↓
Normalization
↓
Business summary
↓
Data quality checks
↓
Prompt construction
↓
Groq LLM
↓
Business analysis
↓
Next.js dashboard
Monday boards can contain hundreds of items with many column values. Passing every raw record to an LLM is inefficient and can exceed the model context window. generateBusinessSummary() therefore aggregates the complete dataset into field distributions, numeric insights, a limited set of relevant examples, and data-quality information. The prompt uses this compact summary rather than the raw record list.
app/
├── api/
│ ├── chat/route.ts # Fetches data, builds the summary, and requests analysis
│ └── test/route.ts # Returns a small data preview for testing
├── globals.css
├── layout.tsx
└── page.tsx # Dashboard and question form
lib/
├── business.ts # Data retrieval, quality checks, and summary generation
├── gemini.ts # Groq client configuration
├── monday.ts # Monday.com GraphQL client
├── normalize.ts # Monday board/item normalization
└── prompt.ts # LLM prompt construction
public/ # Static assets
Clone the repository and install the dependencies:
git clone https://github.com/Ashish-Raj278/business-intelligence-agent.git
cd business-intelligence-agent
npm installCreate a .env.local file in the project root. The application reads the following environment variables:
MONDAY_API_KEY=your_monday_api_key
MONDAY_DEALS_BOARD_ID=your_deals_board_id
MONDAY_WORK_BOARD_ID=your_work_board_id
GROQ_API_KEY=your_groq_api_keyStart the development server:
npm run devOpen http://localhost:3000.
- Which deals need attention this week?
- How is our sales pipeline looking?
- What are the biggest risks in the current pipeline?
- Are there incomplete fields in our work data?
- Which work orders appear blocked or overdue?
Monday.com Boards
↓
Data Retrieval
↓
Normalization
↓
Business Summary
↓
Data Quality Checks
↓
Prompt Builder
↓
Groq LLM
↓
Business Analysis
↓
Next.js UI
- Monday.com GraphQL: The project queries the selected boards in one request and requests the item column values needed for analysis.
- Normalization: Monday column values are converted into a consistent record structure so the rest of the application does not need to handle raw board responses.
- Data quality checks: Missing, empty, and
Unknownvalues are counted so they can be surfaced alongside the analysis. - Business summary: The application summarizes the entire retrieved dataset instead of truncating it to a small sample before prompting the LLM.
- Grounded prompt: The prompt directs the model to use only the supplied summary and representative records, and to identify when the data is insufficient.
- Analysis depends on the availability and quota of the configured Monday.com and Groq accounts.
- The quality of the result depends on the completeness and consistency of the source board data.
- The application is currently designed around the configured Deals and Work Orders boards.
- Historical trend analysis
- KPI charts and visual summaries
- Authentication and board selection
- Conversation history
- Exportable reports
