This is a Retrieval-Augmented Generation (RAG) solution built using the Langchain framework. The project is designed to load documents from a data directory, store them in a vector database (Qdrant), and enable semantic search and chat capabilities using local LLMs via Ollama.
The project follows a phased development approach with CLI entry points for different functionalities like document loading, retrieval, and chat.
### Key Technologies:
- **Framework**: Langchain
- **Vector Storage**: Qdrant
- **Embeddings**: Ollama (with fallback option for OpenAI via OpenRouter)
- **Chat Models**: Ollama
- **Data Directory**: `./../../../data` (relative to project root)
- **Virtual Environment**: Python venv in `venv/` directory
- [ ] Create `agent.py` with Ollama-powered chat agent
- [ ] Integrate with retrieval functionality
- [ ] Add CLI command for chat interaction
## Environment Configuration
The project uses environment variables for configuration:
```env
OLLAMA_EMBEDDING_MODEL=MODEL # Name of the Ollama model for embeddings
OLLAMA_CHAT_MODEL=MODEL # Name of the Ollama model for chat
```
## Building and Running
Since the project is in early development stages, the following steps are planned:
1.**Setup Virtual Environment**:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
```
2.**Install Missing Dependencies** (as development progresses):
```bash
pip install loguru qdrant-client # Examples of needed libraries
```
3.**Configure Environment**:
```bash
cp .env.dist .env
# Edit .env with appropriate values
```
4.**Run CLI Commands**:
```bash
python cli.py ping
```
## Development Conventions
- Use `loguru` for logging with rotation to `logs/dev.log` and stdout
- Follow Langchain best practices for RAG implementations
- Prioritize open-source solutions that don't require external API keys
- Implement proper error handling and document processing tracking
- Use modular code organization with separate files for different components
## Current Status
The project is in early development phase. The virtual environment is set up and dependencies are defined, but the core functionality (CLI, document loading, vector storage, etc.) is yet to be implemented according to the planned phases.