Skip to content
← All projects
GenAI / AgentsComplete & deployed

Sage - Agentic Multi-Tool RAG Chatbot

A deployed LangGraph assistant that decides per turn whether to answer directly or reach for a tool - web search, live stock quote, calculator, or semantic retrieval over your uploaded PDF - and remembers every conversation across restarts.

100%

Hit-rate@4

1.000

MRR

4

Agent tools

5

API endpoints

Overview

Sage is an agentic RAG assistant built the way real AI products are structured: a lightweight front end talking to an independently deployable, observable, stateful backend.

The LLM chooses the capability per question - web search, finance API, calculator, or retrieval over a user's own PDF - and every conversation persists across restarts and reloads from a sidebar.

Note the ~30s first-message cold start while the serverless backend wakes up.

Impact

  • Built as a thin Streamlit client over a serverless Modal FastAPI backend (5 bearer-authed endpoints, scales to zero).
  • LangGraph conditional tool-execution graph routes across 4 tools with token streaming; Groq Llama-3.1-8B for inference.
  • Per-document RAG in Qdrant (thread-scoped payload filter), cross-restart memory via a Neon Postgres checkpointer, LangSmith tracing.

Architecture

  • Thin client / serverless backend split: the Streamlit UI holds no AI logic, only HTTP calls to the Modal backend.
  • 5 FastAPI endpoints (health, threads, history, ingest, chat) guarded by bearer tokens; /chat streams tokens.
  • Agentic tool loop via a LangGraph StateGraph with a chat node and a ToolNode, routed by tools_condition.
  • Per-thread PDF retrieval scoped by a Qdrant payload filter, so a chat can only ever see its own document.

Evaluation & impact

  • Reproducible 13-question retrieval harness scored at top-4 (the depth the rag_tool actually uses).
  • 100% hit-rate@1, 100% hit-rate@4, and 1.000 MRR - correctness measured, not asserted.
  • Every run is traced end-to-end in LangSmith; the harness cleans up its throwaway Qdrant/Neon data.

Stack