Thank you for your interest in contributing! This document provides guidelines to help you get started.
This project follows the Microsoft Open Source Code of Conduct. By participating, you agree to uphold this code. Report unacceptable behaviour to the repository maintainers.
- Use GitHub Issues to report bugs or request features.
- Check existing issues before creating a new one.
- Include steps to reproduce, expected vs actual behaviour, and your environment details.
- Fork the repository.
- Create a branch from
main:git checkout -b feature/your-feature-name
- Make your changes following the guidelines below.
- Run tests to ensure nothing is broken:
python -m venv .venv .venv\Scripts\activate # Windows source .venv/bin/activate # macOS/Linux pip install -r requirements.txt set MOCK_MODE=1 # Windows export MOCK_MODE=1 # macOS/Linux pytest tests/ -v
- Commit with a clear message:
git commit -m "feat: add treasury LCR metric computation" - Push and open a Pull Request against
main.
git clone <your-fork-url>
cd bankquery-copilot-local
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtRun the app in mock mode (no Foundry Local needed):
set MOCK_MODE=1
streamlit run app.py| Directory | Purpose |
|---|---|
agents/ |
Multi-agent pipeline (one file per agent) |
core/ |
Shared utilities (Foundry client, executor, schema validation) |
data/ |
Local JSON demo datasets + glossary |
schemas/ |
JSON Schema for QueryPlan validation |
tests/ |
pytest test suite |
demo/ |
Curated demo prompts |
- Python 3.10+ — use type hints and
from __future__ import annotations. - Keep files short and focused — each agent is a single file.
- Use inline comments for non-obvious logic; avoid redundant docstrings.
- Every agent inherits from
BaseAgentand implementsasync def run(self, message: AgentMessage) -> AgentMessage. - Deterministic agents (OntologyAgent, PlannerAgent, ExecutorAgent) must never call the model.
- Model-calling agents (GeneratorAgent, ExplainerAgent) must handle fallback gracefully.
- All QueryPlan output must conform to
schemas/query_plan.schema.json. - If adding new metrics, update the schema's
metricsenum, the executor, and the ontology. - Error/refusal objects must also be schema-valid (use
build_error_plan()).
- Demo data lives in
data/*.json— keep it synthetic and small. - Never include real customer, financial, or transaction data.
- When adding new datasets, follow the existing flat-JSON-array pattern.
- Financial terms go in
data/glossary.json. - Each entry must include:
term,full_name,domain,definition,formula,dataset,synonyms,example_prompt,unit,regulatory_context. - Use terminology consistent with Morgan Stanley, JPMorgan, HSBC conventions.
- Tests use
pytestand always run in mock mode (MOCK_MODE=1set inconftest.py). - Add tests for any new metric, agent, or validation path.
- Test categories:
test_schema.py— schema conformancetest_executor.py— execution correctnesstest_repair.py— repair loop + end-to-end pipeline
- Glossary: Add the term to
data/glossary.json. - Ontology: Add to
ONTOLOGYdict inagents/ontology_agent.pywith keywords. - Schema: Add to the
metricsenum inschemas/query_plan.schema.json. - Executor: Add computation function in
core/executor.pyand wire it intoexecute_query_plan(). - Data: Ensure
data/*.jsonhas sufficient rows to demonstrate the metric. - Tests: Add test cases in
tests/test_executor.py. - Demo: Optionally add a demo prompt to
demo/demo_prompts.jsonl.
- Create
agents/your_agent.pyinheriting fromBaseAgent. - Wire it into the pipeline in
agents/coordinator_agent.py. - Add tests covering the agent's behaviour.
Use Conventional Commits:
| Prefix | Usage |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation only |
test: |
Adding or updating tests |
refactor: |
Code restructuring (no behaviour change) |
chore: |
Maintenance (deps, CI, config) |
By contributing, you agree that your contributions will be licensed under the MIT License.