Skip to main content

Raglet - RAG starter kit with FastAPI, MCP, and multiple LLM providers

Project description

Chatboti

A simple chatbot example demonstrating how to build an AI agent that uses MCP (Model Context Protocol) to query a RAG database. Includes CLI, web UI, and Docker deployment options.

What It Does

An LLM-powered agent answers questions by searching a simple speaker database using semantic search. The agent uses MCP tools to find the best matching speaker for any topic.

Quick Start

Prerequisites

  • Python 3.13+
  • uv package manager

Installation

uv sync

Configuration

Create a .env file:

CHAT_SERVICE=openai
OPENAI_API_KEY=your-api-key-here

Supported services: openai, bedrock

Three Ways to Run

1. Web UI

uv run chatboti ui-chat

Opens a browser with an interactive chat interface.

2. CLI Chat

uv run chatboti cli-chat

Interactive terminal chat with the agent.

3. Docker

uv run chatboti docker

Builds and runs a Docker container. The Dockerfile is configured for CI/ECS deployment with:

  • Port 80
  • Health endpoint at /health

How It Works

User Query → Agent (LLM) → MCP Tools → RAG Database → Response
  1. Agent - An LLM that decides when to use tools
  2. MCP Server - Provides tools via Model Context Protocol
  3. RAG Service - Semantic search using embeddings on speaker data

Project Structure

chatboti/
├── cli.py           # CLI commands
├── agent.py         # LLM agent with MCP client
├── mcp_server.py    # MCP server with RAG tools
├── rag.py           # Embeddings and semantic search
├── server.py        # FastAPI web server
├── index.html       # Web UI
└── data/            # Speaker database (CSV + embeddings)

API Endpoints

  • / - Web chat interface
  • /chat - Chat API endpoint
  • /health - Health check
  • /info - Service configuration

Environment Variables

Variable Description
CHAT_SERVICE LLM provider: openai or bedrock (required)
EMBED_SERVICE Embedding provider (defaults to CHAT_SERVICE)
OPENAI_API_KEY OpenAI API key
AWS_PROFILE AWS profile for Bedrock

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatboti-0.2.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatboti-0.2.0-py3-none-any.whl (892.3 kB view details)

Uploaded Python 3

File details

Details for the file chatboti-0.2.0.tar.gz.

File metadata

  • Download URL: chatboti-0.2.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for chatboti-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6af510189837d1ef4a7364e2779bfe2f5677145001c63597d7bbc7ef2b103c58
MD5 e925c41a28a3f139ab5a2cb7d8d367ae
BLAKE2b-256 b1f1d5a1e3eb5fbe8ac1ae6346a764e11ec0d480e02331a591a21cbbcc7a6b67

See more details on using hashes here.

File details

Details for the file chatboti-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: chatboti-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 892.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for chatboti-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cac8f387d5bef3d0055233bf130d2580d406bae41460638ce0647fbe7c5e02c7
MD5 e1f7299fca67e8a600d0d69d5e901772
BLAKE2b-256 d0bc8e565fc353902cce7e84e0b1ab5a7543d8490ac37b2fc815fc8598666cc0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page