we are raising our maiden funding round
by Vidushee Geetam on February 10, 2025
Building AI agents that can understand and execute natural language instructions—like booking a restaurant table or calling a cab—is exciting. However, one of the biggest challenges in making these agents reliable is preventing them from hallucinating incorrect information. In this blog, I’ll discuss how I solve this problem by injecting real-world, stateless data into the AI’s reasoning process.
The Problem: AI Hallucinations
LLMs (Large Language Models) are powerful, but they don’t inherently know what applications a user has connected, what projects they are working on, or specific contextual details. Without access to real-time data, they make educated guesses, often leading to hallucinations, where they confidently provide incorrect information.
For example, if a user asks:
“Book a meeting with Alice from the marketing team.”
Without real-world knowledge, the AI might generate a plausible but incorrect response:
“Sure! Scheduling a meeting with Alice in Zoom for tomorrow at 10 AM.”
But Alice may not even exist in the user's system. For example, the actual person might be named Allison but you mistakenly say Alice, or the preferred meeting platform may be Google Meet instead of Zoom. This is where a structured intelligence layer becomes essential.
The Solution: Feeding Real Data into AI Context
To prevent hallucinations, I implemented a backend system that pulls relevant, stateless data points from various services where the AI agent operates. Here’s how it works:
Extracting Real-Time Data
I make API calls to services the AI agent is integrated with, for example, workspace tools, calendar apps, and CRM systems.
Stateless data like names of applications, user accounts, and project names are extracted.
Storing and Structuring the Data
The extracted data is dumped into a database.
This creates a knowledge base containing only verified information.
Passing Context to the AI Agent
I define my proto files (structured data formats) to communicate this knowledge to an intelligence layer.
The AI agent receives this structured, real-world data in natural language before generating responses.
Appending Data to the AI’s Thought Process
Before responding to a user’s query, the agent retrieves and appends this contextual data to its reasoning process.
This ensures that responses are grounded in reality, reducing hallucinations.
Real-World Example
Imagine a user issues the command:
“Book a meeting with Alice from the marketing team at 10 AM.”
Here’s how my AI agent ensures accuracy:
Fetch Relevant Data
The backend queries the integrated workspace tools to check:
Does an Alice exist in the marketing team?
What platform does the user typically use for meetings?
Is 10 AM available on Alice’s calendar?
Generate a Fact-Based Response
Instead of hallucinating, the AI uses real data to respond:
“I found Alice in the marketing team. She is available at 10 AM on Google Meet. Would you like me to send a calendar invite?”
By using structured, real-time context, the AI provides precise and reliable responses.
Key Takeaways
Contextual Grounding: LLMs lack real-time data but can be improved by integrating external, verified data sources.
Custom Intelligence Layer: Defining structured proto files ensures data consistency when passing it to the AI.
Reduced Hallucination: Injecting real-world context into the AI’s decision-making significantly improves accuracy.
This method has been a game-changer in ensuring that AI agents act as reliable assistants rather than just smart-sounding guessers. By structuring and appending real-time data, I’ve successfully minimized AI hallucinations, making the system truly useful in real-world applications.
Sources: Knowledge shared by colleagues at work and my trials and errors. And of course, I used ChatGPT to polish my writing :)