https://github.com/krishstwt/rag_vs_agenticrag
This is a sample repository for the How Does Agentic RAG Outperform Traditional RAG? A TypeScript Journey with Pinecone and DeepSeek blog on medium
https://github.com/krishstwt/rag_vs_agenticrag
cohere generative-ai langgraph-js llm pinecone rag vector-database
Last synced: 10 months ago
JSON representation
This is a sample repository for the How Does Agentic RAG Outperform Traditional RAG? A TypeScript Journey with Pinecone and DeepSeek blog on medium
- Host: GitHub
- URL: https://github.com/krishstwt/rag_vs_agenticrag
- Owner: krishstwt
- Created: 2025-05-11T05:40:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-18T13:30:59.000Z (12 months ago)
- Last Synced: 2025-09-01T00:47:21.212Z (10 months ago)
- Topics: cohere, generative-ai, langgraph-js, llm, pinecone, rag, vector-database
- Language: TypeScript
- Homepage: https://medium.com/@krishmakhijani/how-does-agentic-rag-outperform-traditional-rag-a-typescript-journey-with-pinecone-and-deepseek-9d6b91045e90
- Size: 1.31 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RAG vs AgenticRAG
This project compares **Retrieval-Augmented Generation (RAG)** with **Agentic RAG** for querying and analyzing PDF documents using Pinecone, LangChain, and Groq.
## Prerequisites
1. **Node.js** and **Bun** installed.
2. API keys for:
- Pinecone
- OpenAI
- Cohere
- Groq
- LlamaParse (Llama Cloud)
## Setup
### 1. Install Dependencies
Run the following command to install all dependencies:
```bash
bun install
```
### 2. Set Up Environment Variables
Create a `.env` file in the root directory and add the following keys:
```env
PINECONE_API_KEY=your_pinecone_api_key
OPENAI_API_KEY=your_openai_api_key
COHERE_API_KEY=your_cohere_api_key
GROQ_KEY=your_groq_api_key
LLAMA_CLOUD_API_KEY=your_llama_cloud_api_key
```
### 3. Add PDF to Vector Store
To parse and store a PDF in Pinecone, run the following script:
```bash
bun run src/scripts/vectorStore.ts
```
This script uses LlamaParse to extract text from the PDF and stores it in Pinecone.
### 4. Run Traditional RAG
To execute the **Traditional RAG** agent, run:
```bash
bun run src/agent/traditional_rag_agent.ts
```
This agent performs a similarity search in Pinecone and returns the most relevant information.
### 5. Run Agentic RAG
To execute the **Agentic RAG** agent, run:
```bash
bun run src/agent/agentic_rag_agent.ts
```
This agent includes additional steps like query rewriting and relevance checking to improve the quality of the response.
## Project Structure
- **`src/scripts/vectorStore.ts`**: Parses and stores PDFs in Pinecone.
- **`src/tools/pinecone_search.ts`**: Handles Pinecone similarity search and Cohere reranking.
- **`src/agent/traditional_rag_agent.ts`**: Implements the Traditional RAG pipeline.
- **`src/agent/agentic_rag_agent.ts`**: Implements the Agentic RAG pipeline with query rewriting and relevance checking.
## Notes
- Ensure the PDF path in `vectorStore.ts` is correct before running the script.
- The project uses Groq for LLM inference, but you can replace it with other models if needed.
## License
This project is open-source and available under the MIT License.