Go to file
2025-06-27 23:25:17 +07:00
.trae/rules initial commit 2025-06-24 09:41:02 +07:00
.windsurf/rules initial commit 2025-06-24 09:41:02 +07:00
app feat: add FileTypeIngestionError exception and enforce file type validation in RAG service 2025-06-27 23:25:17 +07:00
scripts feat: update environment configuration and database settings in .env and docker-compose 2025-06-27 23:25:03 +07:00
.env.example feat: update environment configuration and database settings in .env and docker-compose 2025-06-27 23:25:03 +07:00
.gitignore feat(base): provide base code that work 2025-06-24 15:10:09 +07:00
docker-compose.yml feat: update environment configuration and database settings in .env and docker-compose 2025-06-27 23:25:03 +07:00
Dockerfile initial commit 2025-06-24 09:41:02 +07:00
Makefile feat: update environment configuration and database settings in .env and docker-compose 2025-06-27 23:25:03 +07:00
pyproject.toml feat(base): provide base code that work 2025-06-24 15:10:09 +07:00
README.md feat: update environment configuration and database settings in .env and docker-compose 2025-06-27 23:25:03 +07:00
ruff.toml chore: add run command and target version 2025-06-27 21:50:43 +07:00
uv.lock feat(base): provide base code that work 2025-06-24 15:10:09 +07:00

PlainRAG

PlainRAG is RAG application without LLM orchestration frameworks like Langchain or Haystack but with LiteLLM, Transformers, FastAPI.

Quick Start

  1. You need to install uv first
  2. Copy .env.example to .env and fill in your values.
  3. Run the following command to build and start the services:
make install-deps # or uv sync
make create-tables
make start

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 password
  • DB_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.