Skip to content

Ayushhpatel04/Adaptive-MultiAgent-Chatbot-System

Repository files navigation

Multi-Agent Chatbot System

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.

Features

  • 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

Prerequisites

  • Python 3.8+
  • Ollama installed and running locally (default port: 11434)
  • The Mistral model loaded in Ollama

Installation

  1. Clone the repository:
git clone <repository-url>
cd multiagent_chatbot
  1. Install dependencies:
pip install -r requirements.txt
  1. Make sure Ollama is running with the Mistral model:
ollama run mistral

Usage

  1. Start the FastAPI server:
python main.py
  1. The API will be available at http://localhost:8000

API Endpoints

  • 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"

Example Usage

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())

Architecture

The system consists of:

  1. Base Agent: Abstract base class with common functionality
  2. 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
  3. FastAPI Application: Coordinates between agents and provides REST API

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages