This project implements a multi-agent system using LangChain , where two agents serve distinct but complementary business roles:
- π§ Support Agent: Handles client support, course/class info, and order/payment queries.
- π Dashboard Agent: Provides analytics and insights for business decision-making.
Backend is powered by Flask, MongoDB, and LangChain; while the frontend is hosted via Streamlit.
- Get course/class info (by instructor, status, date)
- Order/payment status by ID or client
- Client info by name/email/phone
- Create new client enquiries and orders
- Multilingual query support (e.g. Hindi)
- Revenue & outstanding dues
- Top courses by enrollment
- Attendance %, drop-off rates
- Active vs inactive clients
- Retains conversation history for follow-up queries
- Translates non-English input (e.g., Hindi β English) before execution
MULTIAGENT-ASSIGNMENT/
βββ backend/
β βββ agents/
β β βββ dashboard_agent.py # Analytics Agent
β β βββ support_agent.py # Support & Service Agent
β βββ models/
β β βββ schemas.py # MongoDB Schemas & Connection
β β βββ seed_data.py # Initial data for testing
β βββ tools/
β β βββ external_api.py # Simulated client/order creation API
β β βββ mongodb_tool.py # CRUD & Aggregation Helpers
β βββ app.py # Main Flask app with API routes
βββ frontend.py # Optional Streamlit interface (hosted)
βββ requirements.txt # Python dependencies
βββ .env # Environment variables (Mongo URI, API keys)
βββ screenshots/
β βββ 1.png, 1.1.png # Example 1: Query + Logs
β βββ 2.png, 2.2.png # Example 2: Query + Logs
β βββ 3.png, 3.3.png # Example 3: Query + Logs
β βββ 4.png, 4.4.png # Example 4: Multilingual + Memory| Query Terminal Logs | Server Terminal |
|---|---|
![]() |
![]() |
| Query Terminal Logs | Server Terminal |
|---|---|
![]() |
![]() |
| Query Terminal Logs | Server Terminal |
|---|---|
![]() |
![]() |
| Query Terminal Logs | Server Terminals |
|---|---|
![]() |
![]() |
In Screenshot 4, the query was made in Hindi and automatically translated. The next query, "what did I ask earlier?", demonstrates memory recall capability.
Follow these steps to set up and run the Multi-Agent AI backend + frontend on your local system.
git clone https://github.com/your-username/multiagent-assignment.git
cd multiagent-assignmentpip install -r requirements.txt
Create a .env file in the root directory:
OPENAI_API_KEY=your_openai_key
MONGODB_URI=your_mongo_connection_uri
This step populates the database with mock data (courses, clients, payments, etc.).
cd backend/models
python seed_data.py
cd ../../backend
python app.py
| Endpoint | Method | Description |
|---|---|---|
/support |
POST | Send queries to the Support Agent |
/dashboard |
POST | Send queries to the Dashboard Agent |
{
"query": "What classes are available this week?"
}-Input should be a natural language query in the query field.
-Non-English queries are automatically translated to English using Google Translate.
-Responses are always returned in English.
-Memory is preserved per agent instance (useful for contextual follow-ups).
- π Natural Language Querying over MongoDB collections
- π§ Memory-enabled Agents for contextual follow-up
- π Multilingual Input Support (via Google Translate)
- π External API Integration for simulating orders and client creation
- π Business Analytics like revenue, attendance, and course trends
- πΌοΈ Visual frontend using Streamlit for live demos
| Layer | Tools Used |
|---|---|
| Agent Logic | LangChain, OpenAI GPT-4o |
| Backend | Python, Flask |
| Database | MongoDB |
| Agent Memory | ConversationBufferMemory (LangChain) |
| Frontend | Streamlit |
| Hosting | Render (Flask backend), Streamlit Cloud |
This project was built as part of a multi-agent backend system following modular LangChain-based architecture, designed to simulate real-world agent collaboration between support and analytics roles.







