This is my first Retrieval-Augmented Generation (RAG) project that combines:
- 📚 Semantic search over documents
- 🧮 A calculator tool for precise math
- 🔗 Agent workflows using LangGraph
- 🤖 Claude for reasoning and response generation
-
🔍 Knowledge Base Search
- Uses FAISS for fast vector similarity search
- Supports querying custom documents
-
🧮 Calculator Tool
- Handles numerical queries accurately
- Avoids LLM hallucinations in math
-
🔄 LangGraph Agent Workflow
- Routes queries intelligently between tools
- Supports multi-step reasoning
-
🤖 Claude Integration
- Generates context-aware, high-quality responses
.
├── faiss_index/ # Stored vector database
├── sample_docs/ # Input documents for RAG
├── agent.py # LangGraph agent logic
├── ingest.py # Document processing & embedding
├── app.py # Main app entry point
├── main.py # Alternate runner / testing
├── experiments.ipynb # Experiments & testing
├── .env # API keys
├── requirements.txt / pyproject.toml
└── README.mdgit clone https://github.com/your-username/rag-agent.git
cd rag-agentpython -m venv .venv
.venv\Scripts\activate # Windowspip install -r requirements.txtCreate a .env file:
ANTHROPIC_API_KEY=your_claude_api_key(Optional depending on embeddings)
OPENAI_API_KEY=
GOOGLE_API_KEY=python ingest.pyThis will:
- Load documents from
sample_docs/ - Convert them into embeddings
- Store them in
faiss_index/
python app.py- “Summarize the documents”
- “What is discussed in the knowledge base?”
- “What is 125 * 48?”
- “Find and calculate key metrics from the data”
-
User query is passed to the LangGraph agent
-
Agent decides:
- Use calculator tool OR
- Perform vector search
-
Relevant context is retrieved from FAISS
-
Claude generates the final response
- Built a full RAG pipeline from scratch
- Integrated tools into an agent workflow
- Learned vector databases (FAISS)
- Handled real-world issues like rate limits