Documentation
chatbot-app Docs
An educational, multi-provider conversational AI stack built with LangChain and LangGraph — a CLI, a FastAPI service, optional local RAG, and an agent whose tool calls always require human approval.
What is chatbot-app?
chatbot-app is a single-session, in-memory CLI chatbot with a pluggable chat model backend — Gemini by default, with OpenAI, Anthropic, or local Ollama also supported. It exposes the same core LangChain Expression Language (LCEL) chain through two interfaces: an interactive Rich-powered terminal client and a FastAPI REST service.
Three optional layers sit on top of the base chat flow:
- Retrieval-augmented generation —
--raggrounds answers in local documents fromdocs/via a persisted ChromaDB vector store, with citations. - A REST API — JWT-authenticated, rate-limited endpoints for chat, RAG, and the agent, with per-session JSON-backed history.
- A LangGraph agent —
--agentgives the model three tools (web_search,calculator,read_doc), gated behind a mandatory human-in-the-loop approval step. No tool ever executes without explicit approval, in either the CLI or the API.
Getting Started
Set up a virtual environment, install dependencies, configure a provider, and run your first chat.
Configuration & LLM Providers
The full environment variable table and the Gemini / OpenAI / Anthropic / Ollama provider dispatch.
RAG Pipeline
Loader, chunker, embeddings, vector store, and retrieval — how
--rag grounds answers with citations.REST API Reference
Every endpoint, auth flow, rate limit, and validation rule behind the FastAPI service.
LangGraph Agent
The three tools, the mandatory approval gate, and the CLI vs. API approve/reject flows.
CLI Reference
Every flag
src/main.py understands, and how to exit a session.Security
JWT secret handling, path-traversal containment, the AST-restricted calculator, and rate-limit design.