Ragent banner
Pawan2141-git Pawan2141-git

Ragent

AI community

Description

Agentic RAG chatbot that answers questions from uploaded PDFs using semantic search (FAISS + embeddings), with automatic fallback to real-time web search (Tavily) when the document lacks the answer. Built with LangChain's tool-calling agents, Claude/Gemini LLM, and a Streamlit chat interface.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

RAGent

RAGent is a Streamlit research assistant that answers questions about an uploaded PDF. It searches the document first with RAG (Gemini embeddings and FAISS), then uses Tavily web search only when the document does not contain the answer.

Features

  • Upload a PDF and chat with its contents.
  • Gemini-powered embeddings and responses.
  • FAISS similarity search over the document.
  • Tavily web-search fallback for information outside the PDF.
  • Optional command-line version for a PDF placed in data/.

Prerequisites

  • Python 3.12 or later
  • A Google API key for Gemini
  • A Tavily API key

Setup

Clone the repository and create a virtual environment:

git clone https://github.com/YOUR-USERNAME/Ragent.git
cd Ragent
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt

Create your local environment file and add your own keys:

Copy-Item .env.example .env
GOOGLE_API_KEY=your_google_api_key
TAVILY_API_KEY=your_tavily_api_key

On macOS or Linux, activate the environment with `source .venv/bin/activate` instead.

Run the web app

streamlit run app.py

Open the local URL shown in the terminal, upload a PDF from the sidebar, and ask a question.

Optional command-line mode

Place a PDF in `data/`, then run:

python main.py

The command-line script creates a local FAISS index in `faiss_index/` the first time it runs. Both PDFs in `data/` and generated indexes are intentionally ignored by Git.

Security

Never commit `.env` or real API keys. This repository includes `.env.example` only as a safe template. Review any document before adding it to GitHub; PDFs can contain confidential or copyrighted material.

Project structure

app.py             Streamlit user interface
main.py            Optional command-line agent
requirements.txt   Python dependencies
.env.example       API-key template (no secrets)