Client

Multi-Agent Ollama-ChatBot

Built a chatbot trained to explain what AI is to university-educated students.
Project image

Introducing Ollama-ChatBot: A Multi-Agent AI Chatbot Built with FastAPI

Welcome to Ollama-ChatBot! This project is an open-source, FastAPI-based chatbot system that uses multiple intelligent agents to answer a wide range of questions. Whether you're looking for general knowledge, information about Concordia University's Computer Science admissions, or curious about artificial intelligence, this chatbot is designed to help.

Check out the demo video on YouTube:
Ollama-ChatBot Demo


What Is Ollama-ChatBot?

Ollama-ChatBot is a conversational AI assistant that intelligently routes user queries to specialized "agents." Each agent is tailored for a particular domain:

  • General Knowledge Agent: Answers a broad range of factual and conversational questions.
  • Concordia CS Admissions Agent: Provides answers specific to Concordia University's Computer Science program, leveraging a custom knowledge retriever and the university’s open data API.
  • AI Specialist Agent: Explains AI concepts, neural networks, and machine learning topics in-depth.

The chatbot manages conversation context using vector embeddings and can retrieve knowledge from Wikipedia and other sources for up-to-date answers. Everything is accessible through a RESTful API and an interactive web frontend.


Tools and Technologies Used

Here's a breakdown of the main tools and libraries that power Ollama-ChatBot:

  • FastAPI:
    The web framework for serving the chatbot API. Fast, async, and easy to document.

  • Ollama:
    For running local language models. Supports models like Mistral, which you can pull and serve locally.

  • LangChain:
    Used for agent orchestration and prompt management, specifically the langchain_ollama module for interfacing with Ollama models.

  • Python 3.8+:
    The backend is entirely built in Python for ease of development and cross-platform support.

  • Frontend:

    • HTML/CSS/JavaScript for the user interface.
    • Custom chat UI for a conversational experience.
    • Real-time communication with the FastAPI backend.
  • Vector Store & Embeddings:
    Used to store and retrieve conversation context, allowing the chatbot to maintain coherent, multi-turn conversations.

  • Knowledge Retrieval:

    • Wikipedia API for general facts.
    • Concordia University Open Data API for admissions and program-specific information.

Project Structure

TEXT
Ollama-ChatBot/
├── app/
│   ├── agents/        # Specialized agent logic
│   ├── core/          # Agent router and orchestration
│   ├── memory/        # Vector store and context manager
│   └── knowledge/     # Custom knowledge retrievers (Wikipedia, Concordia API)
├── frontend/          # Web UI (HTML/CSS/JS)
├── requirements.txt   # Python dependencies
└── run.py             # Entrypoint for FastAPI server

How It Works

  1. Ask a Question:
    Use the web UI or send a POST request to /chat with your message.

  2. Router Agent:
    The system examines your query and routes it to the appropriate specialized agent.

  3. Context Management:
    The chatbot maintains context with vector embeddings, so it can handle multi-turn conversations and follow-ups.

  4. Knowledge Retrieval:
    Specialized agents pull information from Wikipedia, the Concordia API, or their internal knowledge.

  5. Response:
    The answer is returned via the API and displayed in the chat interface.


Getting Started

  1. Clone the repository: bash git clone https://github.com/JaedenRotondo/Ollama-ChatBot.git cd Ollama-ChatBot

  2. Set up your Python environment: bash python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt

  3. Set up Ollama and pull the Mistral model: bash ollama pull mistral ollama serve

  4. Run the FastAPI server: bash python run.py

  5. Open the frontend (optional):

    • Open frontend/public/index.html in your browser, or connect to http://localhost:8000/docs for API docs.

Demo

Watch the full walkthrough and demo here:
YouTube: Ollama-ChatBot Demo by Jaeden Rotondo


License

MIT License