Skip to content

feat: implement Multi-Agent Foundation (tool reranking, rejection, metrics) - #8

Merged
cherninkiy merged 16 commits into
mainfrom
dev
Apr 27, 2026
Merged

feat: implement Multi-Agent Foundation (tool reranking, rejection, metrics)#8
cherninkiy merged 16 commits into
mainfrom
dev

Conversation

@cherninkiy

Copy link
Copy Markdown
Owner

Summary

This PR implements Multi-Agent Foundation, laying the groundwork for the HolobiontLLM architecture. Key enhancements include:

  1. Advanced Metrics System: Extended execution tracking with success_score, trajectory_id, and step_number to enable future agent performance analysis and self-learning loops.
  2. Tool Management Module: Introduced a new core module (tool_management.py) featuring:
    • Tool Reranking: Dynamic re-scoring of tools based on success history and context relevance.
    • Rejection Handling: A robust mechanism for agents to explicitly reject tool usage with categorized reasons and alternative suggestions.
  3. Project Cleanup & Localization:
    • Removed redundant dependency files (requirements.txt) in favor of pyproject.toml.
    • Stripped internal development tags from code.
    • Translated the project roadmap (HOLOBIONT_ROADMAP.md) to English.
    • Added metrics.jsonl to .gitignore.

These changes transform RawLLM from a simple executor into a multi-agent ready platform with basic introspection capabilities.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation / chore

Checklist

  • My changes follow the project coding style (flake8 passes)
  • I have added or updated tests to cover my changes (27 new tests added, total 211 passed)
  • pytest tests/ --cov=core --cov-fail-under=90 passes locally
  • I have updated relevant documentation (README.md, docstrings, HOLOBIONT_ROADMAP.md)
  • My PR targets the correct base branch (dev)

Manual Verification:

  • Run rawllm metrics success-rate to verify new aggregation logic.
  • Trigger a tool call with low confidence to observe the ToolRejectionHandler in action.
  • Verify ToolReranker sorts tools correctly when history data is present.

Automated Tests:

  • All existing tests pass (211 total).
  • New tests cover ToolReranker scoring factors and ToolRejectionHandler reason detection.
  • Coverage remains above 90% for the core module.

Migration Notes:

  • requirements.txt and requirements-dev.txt have been removed. Users must now install via poetry install or pip install -e ..
  • Log files (metrics.jsonl) are now ignored by default; ensure you backup existing logs if needed before pulling.

- Delete requirements.txt and requirements-dev.txt
- Dependencies managed via pyproject.toml
- Remove extensive Python/IDE-specific patterns
- Keep essential entries: venvs, __pycache__, .egg-info, OS files
- Ensure .vscode/ is properly ignored
- Add success_score, trajectory_id, and step_number parameters to log_execution
- Extend docstrings with detailed parameter descriptions
- Implement data dict structure for flexible event logging
- Add comprehensive tests for new metric fields and aggregation
- Enable foundation for agent performance analysis and optimization
- Add ToolReranker class with success history and context relevance scoring
- Implement ToolRejectionHandler with 7 distinct rejection reasons
- Introduce confidence threshold filtering for tool selection
- Provide alternative tool suggestions on rejection
- Add RejectionReason enum for structured error handling
- Include comprehensive test suite with 20+ test cases
- Enable smarter tool selection and error recovery for agents
- Mark Tasks 1.1.1, 1.1.2, and 1.4.1 as completed (✅)
- Update sprint timeline with actual Sprint 1 deliverables
- Translate success criteria to Russian and mark Phase 1 progress
- Remove all 'Phase 1', 'Phase 2', 'Task' tags from content
- Reflect current architecture state post-implementation
- Add detailed next steps for Sprints 2-9
- Add Sprint 1 completion status (metrics, reranking, rejection)
- Update Quick Start with Poetry installation instructions
- Document new metrics CLI commands (trajectory, success-rate)
- Update Architecture diagram with tool_management.py
- Add reference to HOLOBIONT_ROADMAP.md
- Translate HOLOBIONT_ROADMAP.md from Russian to English
- Add metrics.jsonl to .gitignore to prevent committing runtime data
- Remove metrics.jsonl from repository

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the foundation for the HolobiontLLM multi-agent system, specifically focusing on Sprint 1 deliverables: tool reranking, rejection handling, and extended metrics for trajectory tracking. While the new logic is implemented in core/tool_management.py and core/metrics.py with accompanying tests, the reviewer noted that the new tool management components are not yet integrated into the core execution loop. Additionally, several formatting issues were identified in the .gitignore and README.md files, and there is an opportunity to optimize the history tracking logic using collections.deque.

Comment thread HOLOBIONT_ROADMAP.md
Comment thread .gitignore Outdated
Comment thread .gitignore Outdated
Comment thread README.md Outdated
Comment thread core/tool_management.py Outdated
Comment thread core/tool_management.py Outdated
@cherninkiy
cherninkiy merged commit fb785e9 into main Apr 27, 2026
1 check passed
@cherninkiy
cherninkiy deleted the dev branch April 27, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants