A sophisticated multi-agent chatbot system that leverages Ollama for intelligent conversations across multiple domains. The system includes specialized agents for general queries, Concordia University Computer Science admissions, and AI-related questions.
- Multi-agent Architecture: Different agents handle specific domains
- General Knowledge Agent
- Concordia CS Admission Agent
- AI Specialist Agent
- Context-aware Conversations: Maintains conversation history and context
- Knowledge Integration: Uses Wikipedia and domain-specific knowledge bases
- Multi-turn Conversations: Supports ongoing dialogues with memory
- Python 3.8+
- Ollama installed and running locally (default port: 11434)
- The Mistral model loaded in Ollama
- Clone the repository:
git clone <repository-url>
cd multiagent_chatbot- Install dependencies:
pip install -r requirements.txt- Make sure Ollama is running with the Mistral model:
ollama run mistral- Start the FastAPI server:
python main.py- The API will be available at
http://localhost:8000
-
POST /chat
- Send a message to the chatbot
- Request body:
{ "text": "your message here", "context": {} // optional }
-
GET /conversation_history/{agent_name}
- Retrieve conversation history for a specific agent
- agent_name: "general", "admission", or "ai"
-
POST /clear_history/{agent_name}
- Clear conversation history for a specific agent
- agent_name: "general", "admission", or "ai"
import requests
# Send a message
response = requests.post(
"http://localhost:8000/chat",
json={"text": "What are the admission requirements for Concordia CS?"}
)
print(response.json())
# Get conversation history
history = requests.get("http://localhost:8000/conversation_history/admission")
print(history.json())The system consists of:
- Base Agent: Abstract base class with common functionality
- Specialized Agents:
- General Knowledge Agent: Handles general queries using Wikipedia
- Admission Agent: Specializes in Concordia CS admission information
- AI Agent: Handles AI-related queries with technical expertise
- FastAPI Application: Coordinates between agents and provides REST API
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.