
contextual qa agent
一个使用 ChromaDB 和 RAG 技术的多步推理代理,支持知识检索和工具使用。
Repository Info
About This Server
一个使用 ChromaDB 和 RAG 技术的多步推理代理,支持知识检索和工具使用。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
🤖 Multi-Step Agent with ChromaDB RAG
A powerful multi-step agent that implements Retrieval-Augmented Generation (RAG) using ChromaDB, Groq, and Helicone for comprehensive observability.
✨ Features
- 🧠 Multi-step reasoning process
- 📚 ChromaDB vector database integration
- 🔍 Query classification
- 🚀 Automatic knowledge base seeding
- ⏱️ Tool usage (knowledge retrieval and current time)
- 📊 Detailed Helicone session tracking
- 🌐 Simple REST API interface
🛠️ Setup
Prerequisites
- Node.js (v16+)
- npm or yarn
- Groq API key
- Helicone API key
- ChromaDB (running on port 8000)
Installation
- Clone the repository
git clone https://github.com/rubaiat-hossain/contextual-qa-agent.git
cd contextual-qa-agent
- Install dependencies
npm install
- Create a
.envfile with your API keys
GROQ_API_KEY=your_groq_api_key
HELICONE_API_KEY=your_helicone_api_key
- Start ChromaDB
You need a running ChromaDB instance. You can start one with Docker:
docker run -p 8000:8000 ghcr.io/chroma-core/chroma:latest
🚀 Running the Server
Start the server with:
npx tsx main.ts
The server will be running at http://localhost:3000, and will automatically seed ChromaDB with initial knowledge if the collection is empty.
📝 API Usage
Query the Agent
curl -X POST http://localhost:3000/analyze \
-H "Content-Type: application/json" \
-d '{"text": "what is ai?"}'
Sample Queries
- "What is AI?"
- "Tell me about Helicone"
- "What is RAG?"
- "What is the Model Context Protocol?"
- "What time is it?"
Health Check
curl http://localhost:3000/health
🧩 How It Works
The agent follows a 4-step process:
- 🔍 Classification: Determines if the query is a question or general statement
- 🔎 Knowledge Retrieval or Tool Use:
- For questions: Retrieves information from ChromaDB
- For general queries: Gets current time
- 🤔 Reasoning: Develops a plan for answering based on retrieved information
- 💬 Response Generation: Creates a helpful, natural response
All steps are tracked in Helicone for observability with session paths:
/classify/knowledge-retrieval/reasoning/final-response
📊 Helicone Integration
This project includes detailed Helicone logging with:
- Session tracking
- Tool usage logging
- Custom properties for filtering and analysis
Visit your Helicone dashboard to view detailed analytics on your agent's performance.
💾 ChromaDB Knowledge Base
The system automatically seeds ChromaDB with initial knowledge about:
- AI fundamentals
- Helicone platform
- RAG architecture
- Observability in AI
- Model Context Protocol (MCP)
- LLMOps
You can extend the knowledge base by modifying the seedKnowledgeBase() function.
📄 License
MIT
Quick Start
Clone the repository
git clone https://github.com/rubaiat-hossain/contextual-qa-agentInstall dependencies
cd contextual-qa-agent
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.