Building a Team of AI Agents: How We Created Neo to Make Data Talk

10 min
 read
l
Vasudev Gupta
l
July 17, 2025
Table of Content
Generative AI

Why One AI Brain Isn't Enough

When we started this project, we tried using a single large language model to handle everything from understanding questions to creating visualizations. We quickly ran into problems:

  • The model would forget important details during complex analysis
  • It couldn't effectively handle both SQL queries and document analysis
  • When it made mistakes, it couldn't reliably fix them
  • The entire system would fail if any part of the process broke down

It was like asking one person to be simultaneously a detective, data analyst, and graphic designer. Even the most capable person would struggle with wearing so many hats at once.

The Three-Agent Approach: A Team of Specialists

Instead of one AI trying to do everything, we built Neo with three specialized agents that work together:

  1. Planning Agent: Understands what the user wants and creates a step-by-step plan
  2. Analyst Agent: Executes the plan by working with databases and documents
  3. Visualization Agent: Turns the results into charts and explanations

Let's look at each one and the tools they use to get their jobs done.

The Planning Agent: Figuring Out What to Do

The Planning Agent is like a project manager. When you ask a question like "How do our premium product sales compare to budget this quarter, and what does the annual report say about our strategy in this segment?", this agent breaks it down into clear steps.

Tools and Environment

The Planning Agent has access to:

  • Memory Tool: Keeps track of previous conversations and findings
  • Task Breakdown Tool: Helps split complex questions into smaller tasks
  • Plan Verification Tool: Checks if the plan makes sense given what we know

Here's what the Planning Agent does in action:

User: "How do our premium product sales compare to budget
this quarter, and what does the annual report say about our strategy
in this segment?"

Planning Agent thinks:
1. I need to get quarterly sales data for premium products
2. I need to compare that to budget figures
3. I need to find mentions of premium product strategy in the annual report
4. I should connect the financial performance with the stated strategy

Planning Agent creates a plan:
- STEP 1: Query the sales database for premium product performance this quarter
- STEP 2: Query the budget database to get targets for premium products
- STEP 3: Calculate variance between actual and budget
- STEP 4: Search the annual report for sections about premium product strategy
- STEP 5: Create a visualization comparing performance to budget
- STEP 6: Summarize findings and connect to strategic goals

The Planning Agent then passes this plan to the Analyst Agent to execute.

The Analyst Agent: Getting and Processing the Data

The Analyst Agent is our data specialist. It takes the plan and works with databases and documents to get the necessary information.

Tools and Environment

The Analyst Agent works in two main environments:

1. Database Environment: Where it can write and run SQL queries

  • SQL Generation Tool: Helps write accurate database queries
  • Query Execution Tool: Runs the queries against your actual database
  • Error Correction Tool: Fixes SQL syntax or logic errors
  • Calculator Tool: Performs calculations on the data

2. Document Environment: Where it can search through company documents

  • RAG Tool: Retrieves relevant information from documents
  • Document Parser Tool: Extracts structured data from PDFs, Word docs, etc.
  • Web Search Tool: Finds relevant external information when needed

Here's the Analyst Agent at work:

Analyst Agent receives plan and starts with Step 1:
"I need to query the sales database for premium product performance this quarter"

Analyst Agent examines database schema to understand available tables
- Finds tables: products, sales, categories, time_periods

Analyst Agent writes SQL:
SELECT
   p.product_name,
   SUM(s.revenue) as total_revenue,
   SUM(s.quantity) as units_sold
FROM
   sales s
JOIN
   products p ON s.product_id = p.id
JOIN
   categories c ON p.category_id = c.id
JOIN
   time_periods t ON s.time_id = t.id
WHERE
   c.category_name = 'Premium'
   AND t.quarter = 'Q1'
   AND t.year = '2024'
GROUP BY
   p.product_name
ORDER BY
   total_revenue DESC;

Analyst Agent executes query and receives results...

Next, for Step 4:
"I need to search the annual report for premium product strategy"

Analyst Agent uses RAG Tool to search company documents:
- Searches for: "premium product strategy" AND "annual report" AND "2024"
- Finds relevant sections on pages 12-14 of the annual report
- Extracts key points about focusing on premium segment with new product launches

The Analyst Agent works through each step of the plan, collecting all the data needed. It can handle errors by trying different approaches when something doesn't work. For example, if a table name has changed, it can examine the schema again and update its query.

When the analysis is complete, it passes the data to the Visualization Agent.

The Visualization Agent: Making Data Understandable

The Visualization Agent takes the raw data and turns it into charts and explanations that make sense to humans.

Tools and Environment

The Visualization Agent uses:

  • Chart Creation Tool: Generates different types of visualizations (bar charts, line graphs, etc.)
  • Layout Tool: Arranges multiple visualizations together
  • Explanation Generator: Creates text to explain what the charts show
  • JavaScript Environment: Where it can write code for interactive visualizations

Here's how it works:

Visualization Agent receives analysis results:
- Premium product sales: $4.2M (15% below budget)
- Budget target was: $4.95M
- Annual report highlights strategy to grow premium segment by 20%

Visualization Agent decides to create:
1. A comparison bar chart showing actual vs budget
2. A table with product-level details
3. A callout box with annual report insights

The agent writes JavaScript code to create these visualizations:
{
 "charts": [
   {
     "type": "bar",
     "data": {
       "labels": ["Actual Sales", "Budget Target"],
       "datasets": [{
         "data": [4200000, 4950000],
         "backgroundColor": ["#36A2EB", "#FFCE56"]
       }]
     },
     "options": {
       "title": "Premium Product Sales Q1 2024",
       "annotation": {
         "drawTime": "afterDatasetsDraw",
         "annotations": [{
           "type": "line",
           "mode": "horizontal",
           "scaleID": "y-axis-0",
           "value": 4950000,
           "borderColor": "red",
           "borderWidth": 2,
           "label": {
             "content": "Budget Target",
             "enabled": true
           }
         }]
       }
     }
   },
   // Additional visualization code...
 ]
}

Visualization Agent also creates explanation text:
"Premium product sales reached $4.2M in Q1 2024, 15% below the budgeted target of $4.95M. This presents a challenge to the strategy outlined in the annual report, which aims to grow the premium segment by 20% this year. The biggest gaps were in Product A and Product C, while Product B is performing above expectations."

The Visualization Agent doesn't just create charts—it thinks about the best way to present information to answer the specific question you asked.

How the Agents Work Together: A True Loop

What makes Neo powerful isn't just having three specialized agents—it's how they work together in a loop. Here's the complete process:

  1. User asks a question
  2. Planning Agent creates a plan
  3. Analyst Agent gathers and processes data, but might discover something unexpected
  4. Planning Agent updates the plan based on this new information
  5. Analyst Agent continues with the revised plan
  6. Visualization Agent creates charts and explanations
  7. User sees results and asks follow-up questions
  8. The process repeats, but with memory of previous questions and findings

This loop allows the system to handle complex questions that would be impossible in a single pass.

Keeping Your Data Secure

A major concern with any AI system is data security. Neo is designed with security in mind:

  • All processing happens within your secure environment
  • We use encryption to protect any data being processed
  • The agents never send your actual data to external LLMs
  • Only questions and results are processed by the AI models, not your raw data

Real Examples of Neo in Action

Here are some real questions that Neo has helped our clients answer:

  • "Show me which customer segments have the highest churn rate over the past year, and what do our customer survey responses say about these segments?"
  • "Compare our Q1 marketing spend to our sales pipeline growth, and check our strategy documents to see if we're focusing on the right channels."
  • "Analyze our product returns by region and manufacturer, and find any quality issues mentioned in supplier communications."

In each case, Neo was able to connect information across databases and documents to provide insights that would be difficult to discover manually.

The Benefits of a Multi-Agent Approach

Using multiple agents instead of a single AI model has several key advantages:

  1. Better error handling: If one step fails, the system can try a different approach
  2. Specialized expertise: Each agent can be optimized for its specific job
  3. Transparent process: You can see exactly what each agent is doing at each step
  4. Adaptable workflow: The system can change its approach based on what it discovers

What's Next for Neo

We're continuing to improve Neo with new capabilities:

  • More specialized agents for different types of analysis
  • Better tool integration with existing business software
  • Enhanced collaboration features for teams working with the same data
  • Industry-specific knowledge for different sectors like healthcare or finance

Conclusion: AI Teamwork Makes the Dream Work

Building Neo has taught us that the future of AI isn't about making one model do everything—it's about creating teams of specialized agents that work together. Just like human teams benefit from having members with different skills, AI systems are more powerful when they combine different types of expertise.

By giving each agent the right tools and a clear role, we've created a system that can handle complex data questions across structured databases and unstructured documents. The result is a more natural, more capable way to interact with your business data.

If you're interested in learning more about Neo or seeing it in action, feel free to reach out to our team.

This blog is part of our series on practical applications of AI. Check out our other posts on making AI work for your business.

Related blogs

previous arrownext arrow
Partner with us & drive smarter decisions
Let’s craft intelligent solutions together—turning your data into unstoppable growth.