mirror of
https://github.com/Sosokker/plain-rag.git
synced 2025-12-18 06:34:03 +01:00
1.8 KiB
1.8 KiB
PlainRAG
PlainRAG is RAG application without LLM orchestration frameworks like Langchain or Haystack but with LiteLLM, Transformers, FastAPI.
Quick Start
- You need to install
uvfirst - Copy
.env.exampleto.envand fill in your values. - Run the following command to build and start the services:
docker compose up db -d
make install-deps # or uv sync
make create-tables
make start
Then navigate to http://127.0.0.1:8000/docs
or
docker compoes up -d
This will use Docker Compose to start the API and database services.
Environment Variables
DB_SERVER: Database server hostname (default: localhost)DB_USER: Database username (default: postgres)DB_PASSWORD: Database passwordDB_NAME: Database name (default: chat_hub)DB_PORT: Database port (default: 5432)
Other variables are documented in .env.example.
Components
- API (
app/api/endpoints.py): FastAPI endpoints for file ingestion, querying, and configuration. - Services (
app/services/):rag_service.py: Core RAG pipeline (ingest, query, stream answers).config_service.py: Manages model and vector store selection.embedding_providers.py: Embedding model integration (e.g., MiniLM).rerankers.py: Reranker model integration (e.g., CrossEncoder).vector_stores.py: Vector database integration (PostgreSQL/pgvector).
- Core (
app/core/):config.py: Application settings and environment management.registry.py: Registry pattern for models and stores.utils.py: Text splitting utilities.exception.py: Custom exceptions.interfaces.py: Abstract interfaces for models and stores.
- Schemas (
app/schemas/):models.py: Pydantic models for API requests/responses.enums.py: Enum definitions for model/store selection.