Spaces:
Sleeping
Sleeping
π οΈ 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:
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
- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -e ".[dev]" # Install with development tools
- Set up API keys:
export OPENAI_API_KEY="your-openai-key"
export TAVILY_API_KEY="your-tavily-key" # Optional, for web search
- Run the application:
chainlit run app.py
π§ͺ Code Quality
To check for dependency issues:
deptry .
For linting:
black .
ruff check .
mypy .