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
- Add
src/ragforge/vectorstore/your_backend.py that implements upsert,
search, count.
- Re-export the class from
vectorstore/__init__.py.
- Write tests against the in-memory baseline so behavior is comparable.
Adding a new metric
- Add to
src/ragforge/eval/metrics.py with the signature
metric(question, answer, contexts, ground_truth, *, encoder) -> float.
- Register it in
evaluate() and __all__.
- Add a unit test.