A conversational AI assistant that answers from your own PDFs, the live web, or its own knowledge — you decide, with two toggles. Built in Python as three FastAPI services, styled after python.org, and honest about where every answer came from.
Every answer carries an honest provenance label, so you always know whether it came from your library, the web, the database, or the model itself.
Flip on 🌐 Web and the agent may call Tavily. Source URLs are captured, rendered as clickable citations, and persisted with the conversation.
Flip on 📚 My Library for your ingested PDFs (Pinecone vector search) and the MongoDB MCP CRUD tools. Both toggles off = the model's own knowledge.
History lives in MongoDB via motor. A past-conversations sidebar reopens any chat, and a read-only recall_history tool gives the model exact deep recall.
The retrieval service has a modern upload page: extract → chunk → embed (Ollama) → upsert to Pinecone, plus a Mongo books catalog for per-book narrowing.
When a topic can't be pinned to a specific book, the agent asks "do you mean Game of Thrones or…?" instead of guessing — backed by the catalog.
Recent turns verbatim, older folded into a rolling summary, raw tool observations never replayed — so prompts stay cheap even on local Ollama.
A clean separation: the agent reasons, the retrieval service owns PDFs and vectors, and the MCP server exposes MongoDB as model tools over SSE.
The conversational ReAct agent and chat UI.
PDF ingestion + vector search.
books catalogPOST /api/search streams SSEMongoDB as MCP tools over SSE.
mcp SDKThe agent exposes only the tools its toggles allow: recall_history is always on; My Library adds search_pdf + mcp; Web adds web_search. Backend is Ollama by default, Claude when a key, model, and credit flag are all set.
You type a question and choose Web, My Library, both, or neither.
The agent builds a budgeted prompt: branched system + rolling summary + last K turns.
A ReAct loop calls only the allowed tools — vector search, web, MCP, recall.
Final text is persisted with provenance + citations; raw observations are dropped.
The real UIs, in python.org light theme. (Screenshots are generated by docs/capture_screenshots.py against the running apps.)
Open the agent at :8082. A blue gradient hero over a clean chat column, with the past-conversations sidebar on the right — all in the python.org palette.
Two pills — 🌐 Web and 📚 My Library. Active = filled blue, inactive = blue outline. They gate which tools the agent may use this turn.
Every answer carries an honest source chip — from Web, from My Library, from Database, or model's own knowledge — and web answers list clickable Tavily citations.
The retrieval service at :8081 has a modern drop zone. Drop a PDF, give it a title, and the pipeline extracts, chunks, embeds, and upserts to Pinecone + the catalog.
A built-in panel hits Pinecone directly (the raw vectors the agent uses), so you can confirm a freshly-ingested PDF is findable without going through the LLM.
Every conversation is saved. Click any item to reopen it; the agent reloads the thread and keeps reasoning with full token-budgeted memory.
macOS one-shot setup: installs/verifies Python 3.12+, MongoDB, and Ollama; creates the venv; pulls models; and prepares config.json. Idempotent — safe to re-run.
setup.sh reads
TAVILY_API_KEY, PINECONE_API_KEY, and the Anthropic vars
from your environment if set; otherwise it writes placeholders into
config.json (gitignored) and prints exactly which keys to fill in.
Ollama-only and library/web features degrade gracefully without them.
Verifies Homebrew, installs Python 3.12+, creates .venv, and runs pip install -e ".[dev]".
Installs & starts MongoDB and Ollama, pulls nomic-embed-text (embeddings) and a chat model (e.g. gemma2:2b).
Copies config.example.json → config.json if missing, injecting any keys found in the environment.
Writes run.sh to start all three uvicorn services (agent, retrieval, mcp_server) together.