Contributing¶
git clone https://github.com/Ademo93/agentforge
cd agentforge
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev,serve,tools,eval]"
pytest
Style¶
- Ruff for lint and format:
ruff check . && ruff format . - Defer heavy imports inside functions (
transformers,sentence-transformers,fastapi,duckduckgo_search) so unit tests stay fast. - Each stage (core, tools, memory, llm, eval, serve) is its own subpackage with a tiny public surface. Keep that boundary.
Adding a tool¶
- Drop
src/agentforge/tools/your_tool.pywith a class exposingname,description,run(input_str) -> str. - Re-export it from
tools/__init__.py. - Write a unit test that calls
tool.run(...)with a known input. - Add a line to the table in
docs/tools.md.
If the tool has side effects (network, disk, DB), the docstring must state its constraints (rate limit, sandbox, read-only).
Adding a metric¶
- Add to
src/agentforge/eval/metrics.pywith the signaturemetric(result: AgentResult, sample: dict) -> float. - Register it in
_REGISTRY. - Add a unit test in
tests/test_eval.py. - Mention it in
docs/evaluation.md.