Spaces:
Sleeping
Sleeping
File size: 2,490 Bytes
b44bcb9 059d9b6 b44bcb9 059d9b6 b44bcb9 059d9b6 b44bcb9 059d9b6 b44bcb9 059d9b6 b44bcb9 059d9b6 b44bcb9 059d9b6 b44bcb9 059d9b6 b44bcb9 059d9b6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# π οΈ Developer Documentation
## π¦ Project Structure
```
.
βββ app.py # Main Chainlit application
βββ app_simple_rag.py # Simplified RAG application
βββ pyproject.toml # Project configuration and dependencies
βββ pstuts_rag/ # Core package
β βββ pstuts_rag/ # Source code
β βββ __init__.py
β βββ datastore.py # Vector database management
β βββ loader.py # Data loading utilities
β βββ rag.py # RAG implementation
β βββ agents.py # Team agent implementation
β βββ ...
βββ data/ # Dataset files
βββ README.md # User documentation
```
## π§© Dependency Structure
Dependencies are organized into logical groups:
- **Core**: Basic dependencies needed for the RAG system (includes Jupyter support)
- **Dev**: Development tools (linting, testing, etc.)
- **Web**: Dependencies for web server functionality
- **Extras**: Additional optional packages (numpy, ragas, tavily)
You can install different combinations using pip's extras syntax:
```bash
pip install -e ".[dev,web]" # Install core + dev + web dependencies
```
## π§ Technical Details
The application uses LangChain, LangGraph, and Chainlit to create an agentic RAG system:
### Key Components
- **DatastoreManager**: Manages the Qdrant vector store and document retrieval
- **RAGChainFactory**: Creates retrieval-augmented generation chains
- **PsTutsTeamState**: Manages the state of the agent-based system
- **Langgraph**: Implements the routing logic between different agents
## π Running Locally
1. Create a virtual environment (recommended):
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
2. Install dependencies:
```bash
pip install -e ".[dev]" # Install with development tools
```
3. Set up API keys:
```bash
export OPENAI_API_KEY="your-openai-key"
export TAVILY_API_KEY="your-tavily-key" # Optional, for web search
```
4. Run the application:
```bash
chainlit run app.py
```
## π§ͺ Code Quality
To check for dependency issues:
```bash
deptry .
```
For linting:
```bash
black .
ruff check .
mypy .
```
## π Resources
- [Chainlit Documentation](https://docs.chainlit.io)
- [LangChain Documentation](https://python.langchain.com/docs/get_started/introduction)
- [LangGraph Documentation](https://langchain-ai.github.io/langgraph/) |