Skip to content

Contributing

git clone https://github.com/Ademo93/ragforge
cd ragforge
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[dev,serve,eval]"
pytest

Style

  • Ruff for both lint and format. Run ruff check . && ruff format ..
  • Each stage of the pipeline (ingest, embed, vectorstore, rerank, llm, eval, serve) is its own subpackage with a tiny public surface. Keep that boundary.
  • Defer heavy imports inside functions: sentence-transformers, qdrant-client, fastapi, and turboquant should not be imported at package-load time so the test runner stays fast.

Adding a new vector store

  1. Add src/ragforge/vectorstore/your_backend.py that implements upsert, search, count.
  2. Re-export the class from vectorstore/__init__.py.
  3. Write tests against the in-memory baseline so behavior is comparable.

Adding a new metric

  1. Add to src/ragforge/eval/metrics.py with the signature metric(question, answer, contexts, ground_truth, *, encoder) -> float.
  2. Register it in evaluate() and __all__.
  3. Add a unit test.