Thank you for your interest in contributing to RAG Financial Multimodal!
git clone https://github.com/your-org/rag-financial-multimodal
cd rag-financial-multimodal
python3.11 -m venv .venv && source .venv/bin/activate
pip install -e ".[all]"
pip install pytest pytest-asyncio pytest-cov pytest-mock black ruff mypy
cp .env.example .env # set OPENAI_API_KEY-
Create a branch from
develop(notmain):git checkout develop && git pull git checkout -b feat/your-feature-name -
Write code following the standards below.
-
Run the full check suite before pushing:
ruff check src/ tests/ # lint black --check src/ tests/ # formatting mypy src/rag_system/config.py # types pytest tests/unit/ -v # unit tests pytest tests/integration/ -v # integration tests
-
Open a PR against
develop. PRs require:- All CI checks green
- At least one approving review
- No regression on eval gate (faithfulness drop < 5%)
- Dependency injection, not global state. Every component is passed in; never import and instantiate inside business logic.
- Async-first. All I/O (HTTP calls, file reads, vector store ops) must be
async def. Useasyncio.to_thread()for blocking libs. - Config from
get_config(). Never hardcode model names, URLs, or keys. - Every new component implements its ABC. New parsers inherit
BaseParser, new vector stores inheritBaseVectorStore, etc. - Tests for every new component. Minimum: happy path, error path, edge case (empty input). Aim for 80%+ branch coverage on new code.
-
Implement the ABC in
src/rag_system/components/vector_store/__init__.py:class MyVectorStore(BaseVectorStore): @property def name(self) -> str: return "my_store" async def initialize(self, ...): ... async def upsert(self, ...): ... async def search(self, ...): ... async def delete(self, ...): ...
-
Register in the factory:
def build_vector_store(provider=None): if name == "my_store": return MyVectorStore() ...
-
Add config option to
VectorStoreConfig.providerinconfig.py. -
Write unit tests in
tests/unit/test_vector_store.py. -
Update
README.mdarchitecture table and.env.example.
- Formatter:
black(line length 100) - Linter:
ruff(see[tool.ruff]inpyproject.toml) - Types: All public functions must have type annotations
- Docstrings: Google style for all public classes and methods
- Imports:
isortwithprofile = "black"
Follow Conventional Commits:
feat(retriever): add Qdrant vector store adapter
fix(guardrails): handle empty context list in numeric check
docs(readme): update deployment section for Helm v3
test(pot): add timeout edge case
refactor(pipeline): extract _redact_elements to separate method
High-quality eval samples are critical. To add new ones:
- Find a publicly available financial filing (10-K/10-Q/earnings release).
- Identify a question with a verifiable numerical answer.
- Add to
evals/golden_datasets/financial_qa.jsonlas:{ "question": "...", "ground_truth": "...", "source_documents": ["filename.pdf"], "expected_page": 12, "expected_numeric_values": ["$23.35B", "9%"], "tags": ["revenue", "yoy", "quarterly"] } - Run
rag-financial evaluateto confirm the new sample doesn't regress metrics.
- Bugs: Open a GitHub issue with the
buglabel. Include: Python version, OS, error traceback, minimal repro steps. - Security vulnerabilities: See SECURITY.md — do not open a public issue.
- Feature requests: Open a GitHub issue with the
enhancementlabel and link to the roadmap item if applicable.