← Back to projects

Agentic RAG Chatbot

Description

Agentic RAG Chatbot is a multi-tool conversational AI assistant that goes beyond simple document Q&A. Rather than being locked into a single mode, the assistant behaves like an agent — it holds a normal conversation, answers questions grounded in an uploaded PDF or a website, looks up live stock prices, and searches the web, deciding on its own which capability a given question actually requires.

At its core, the project is built using LangGraph, which models the assistant as a state graph rather than a fixed prompt chain. A single chat node handles the language model's reasoning, and a conditional edge decides, turn by turn, whether the model needs to call a tool or can respond directly. When a tool is required, control passes to a dedicated tools node and back to the chat node, so the conversation always ends with a natural, LLM-generated response rather than raw tool output.

Document intelligence is handled through a Retrieval-Augmented Generation (RAG) pipeline. Users can upload a PDF or submit any website URL per chat thread; the content is loaded, split into overlapping chunks, converted into vector embeddings using HuggingFace Sentence Transformers, and indexed with FAISS for fast similarity search. When a question relates to the uploaded content, the assistant retrieves the most relevant chunks before answering — keeping responses grounded in the actual source rather than the model's own assumptions.

Beyond documents, the assistant is extended with real-time tools: a web search tool for current information not present in any document, and a live stock price lookup tool powered by the Alpha Vantage API. These are exposed to the language model (hosted on Groq, running Llama 3.3 70B) as callable functions, letting the model itself decide when a plain answer isn't enough and a live lookup is needed.

Every conversation is persisted using SQLite-based checkpointing built into LangGraph, with each chat assigned its own thread ID. This means a user can run multiple independent conversations side by side — each with its own uploaded PDF or website — close the app, and resume any thread later with full message history intact.

The interface is built with Streamlit, supporting streaming responses, a sidebar for managing multiple chat threads, and simple in-chat controls for uploading a PDF or triggering website ingestion. The result is a single assistant that feels like a normal chatbot on the surface, but is quietly orchestrating retrieval, tool calls, and long-term memory underneath.

Key Features

Technologies Used