A modular, domain-specific validation system built using the LangChain framework. It uses external knowledge sources like Tavily Search, Wikipedia and DuckDuckGo, along with LLM-powered tools, to verify the correctness of statements in various domains — including math, factual knowledge, language, and code. This system does not generate new answers — it only checks and validates existing statements for accuracy and soundness.
This system uses LangChain, an open framework for developing LLM-powered applications, to create a multi-agent architecture where each agent specializes in verifying different types of inputs.
The agents work collaboratively, ensuring that the main agent can intelligently delegate verification tasks, retrieve external information, and present fact-checked results with reasoning.
.
├── main_agent.py # Main controller; routes statements to specific agents
├── router_agent.py # Identifies domain using search tools
├── math_agent.py # Validates math-related expressions and logic
├── english_agent.py # Checks grammar, language correctness, and clarity
├── coding_agent.py # Audits coding claims and language usage
├── factual_agent.py # Uses Wikipedia & DuckDuckGo for fact-checking
├── requirements.txt # All dependencies and LLM tooling
└── README.md # This documentation
-
LangChain-Based Agent Architecture Designed using LangChain’s modular components, agents, and tool integrations.
-
Domain Routing Agent Uses search-based heuristics to determine whether the claim is factual, mathematical, coding-related, or linguistic.
-
Fact-Checker Queries Wikipedia and Tavily Search to validate real-world claims.
-
Math Reasoning Checker Uses
LLMMathChainfor numerical expression verification. -
Code Logic Validator Audits basic programming knowledge across multiple languages and concepts.
-
Language Assessment Agent Detects grammar errors and suggests fixes.
-
Clone the Repository:
git clone https://github.com/yourusername/multi-agent-verification-framework.git cd multi-agent-verification-framework -
Install Dependencies:
pip install -r requirements.txt
-
Add API Keys: Create a
.envfile and add:GOOGLE_API_KEY=your_google_api_key
Run the validation system:
python main_agent.py- The system asks for user input (e.g., a claim or statement).
- It identifies the domain via
router_agent.py. - It then routes the input to the appropriate validation agent.
- The selected agent uses LLM + external tools to verify the truthfulness and explain the result.
| Input Statement | Routed Agent | Result |
|---|---|---|
| "Python is a compiled language." | Factual Agent | Incorrect – it's interpreted |
| "He go to school everyday." | English Agent | Incorrect – grammar fixed |
| "2 + 2 × 3 = 12" | Math Agent | Incorrect – verified by order |
"len('hello') returns 5 in Python." |
Coding Agent | Correct – confirmed |
Defined in requirements.txt. Includes:
langchainlangchain-google-genailangchain-communityduckduckgo-searchwikipedia-apipython-dotenv
All built around the LangChain framework.
Soumya Sourav Das