Skip to content

shafiqul-islam-sumon/ragent-chatbot

Repository files navigation

🤖 RAGent Chatbot — Intelligent RAG + ReAct Assistant

💡 Blog Guide: How This Chatbot is Built

The RAGent Chatbot is a smart, modular, and explainable AI assistant that combines Retrieval-Augmented Generation (RAG) with ReAct-style agent reasoning. It goes beyond document Q&A — deciding when to read, when to think, and when to act using tools like web search, Wikipedia, calculator, and more.

RAGent Chatbot UI Preview

🧠 What Can RAGent Do?

  • 📄 Answer questions from uploaded documents (PDF, DOCX, PPTX, XLSX, TXT, CSV, JSON)
  • 🛠️ Use external tools dynamically — web search, weather, Wikipedia, calculator, etc.
  • 🔍 Combine semantic and keyword search using hybrid retrieval
  • 🧠 Think step-by-step using the ReAct agent framework
  • 💬 Maintain chat context using memory for natural multi-turn conversations

🧱 Architecture Highlights

  • 🤖 ReAct Agent: Reasoning + tool calling in a loop: Thought → Action → Observation → Final Answer
  • 📚 RAG Pipeline: Retrieves relevant chunks from Qdrant DB and answers with Gemini LLM
  • 🛠️ Custom Tooling: Extensible tool framework (BaseTool) with weather, web, wiki, calculator, LLM, etc.
  • 💾 Memory: Per-session chat history powered by MemoryManager
  • 🖥️ Gradio UI: Intuitive chat + upload interface

🛠 Tech Stack

Layer Technology
🧠 LLM Google Gemini via LangChain
📦 Embeddings BAAI/bge-base-en-v1.5
🔍 Vector DB Qdrant (supports hybrid search)
💬 UI Gradio
🧰 Tools Tavily API, OpenWeather, Wikipedia, Calculator

📸 Live Preview

Try the RAGent Chatbot in your browser and upload your own documents:

🧪 Sample Prompts

  • 🗃️ "What is the IT budget for 2023?" → Answer from your document using rag_search
  • 🌦️ "What’s the weather in Tokyo today?" → Uses weather tool via OpenWeather API
  • 📚 "What is quantum computing?" → Searches Wikipedia
  • ➗ "What’s 245 * 92?" → Invokes calculator
  • ✍️ "Summarize the benefits of LangChain" → Falls back to llm_instruction tool

🚀 How It Works (Quick Summary)

  1. 📂 Upload documents → Processed & chunked with overlapping windows
  2. 📦 Store chunks → Embedded using BAAI and stored in Qdrant with tokenized keywords
  3. 💬 Ask a question → ReAct agent decides whether to use:
    • rag_search for document-based answers
    • tools like web_search, wikipedia, calculator, weather
    • or fallback to Gemini via llm_instruction
  4. 🔄 Responds intelligently → Step-by-step reasoning with full transparency
  5. 🧠 Context retained → Chat memory keeps track of all past Q&A

✨ Want to Learn More?

📘 Dive deeper into the design, code, and reasoning logic in our full blog post:

👉 📝 Read the Full Guide

This guide walks you through the architecture, ReAct prompts, tool integration, and Qdrant-based hybrid search — everything from concept to deployment.

About

RAGent Chatbot is a smart AI assistant that combines Retrieval-Augmented Generation (RAG) with a tool-using LLM agent. It can answer user queries using uploaded documents, perform web searches, summarize text, solve math expressions, check weather, and more — all powered by LangChain, Qdrant, and Gemini.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages