Skip to content

Commit

Permalink
New proj with cohere - rag + agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Madhuvod committed Dec 14, 2024
1 parent 6493b58 commit e95972d
Show file tree
Hide file tree
Showing 4 changed files with 431 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

68 changes: 68 additions & 0 deletions rag_tutorials/rag_agent_cohere/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# RAG Agent with Cohere 🤖

A RAG Agentic system built with Cohere's new model Command-r7b-12-2024, Qdrant for vector storage, Langchain for RAG and LangGraph for orchestration. This application allows users to upload documents, ask questions about them, and get AI-powered responses with fallback to web search when needed.

## Demo



## Features

- **Document Processing**
- PDF document upload and processing
- Automatic text chunking and embedding
- Vector storage in Qdrant cloud

- **Intelligent Querying**
- RAG-based document retrieval
- Similarity search with threshold filtering
- Automatic fallback to web search when no relevant documents found
- Source attribution for answers

- **Advanced Capabilities**
- DuckDuckGo web search integration
- LangGraph agent for web research
- Context-aware response generation
- Long answer summarization

- **Model Specific Features**
- Command-r7b-12-2024 model for Chat and RAG
- cohere embed-english-v3.0 model for embeddings
- create_react_agent function from langgraph
- DuckDuckGoSearchRun tool for web search

## Prerequisites

### 1. Cohere API Key
1. Go to [Cohere Platform](https://dashboard.cohere.ai/api-keys)
2. Sign up or log in to your account
3. Navigate to API Keys section
4. Create a new API key

### 2. Qdrant Cloud Setup
1. Visit [Qdrant Cloud](https://cloud.qdrant.io/)
2. Create an account or sign in
3. Create a new cluster
4. Get your credentials:
- Qdrant API Key: Found in API Keys section
- Qdrant URL: Your cluster URL (format: `https://xxx-xxx.aws.cloud.qdrant.io`)


## How to Run

1. Clone the repository:
```bash
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
cd rag_tutorials/rag_agent_cohere
```

2. Install dependencies:
```bash
pip install -r requirements.txt
```

```bash
streamlit run rag_agent_cohere.py
```


Loading

0 comments on commit e95972d

Please sign in to comment.