Skip to content

feat: implement core agent primitives (ReAct and Planner) - #319

Open
Kaap10 wants to merge 1 commit into
codeforstartups:developmentfrom
Kaap10:feat/agent-primitives-react-planner
Open

Kaap10 wants to merge 1 commit into
codeforstartups:developmentfrom
Kaap10:feat/agent-primitives-react-planner

Conversation

@Kaap10

@Kaap10 Kaap10 commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR introduces the foundational agent architecture on top of the newly integrated multi-provider chat abstractions. It provides a robust, strictly-typed tool execution framework, a resilient ReAct loop capable of autonomous tool-use and error recovery, and a Planner for decomposing complex goals into sequential execution steps. This sets up the critical infrastructure needed for more advanced agentic workflows in the future.

Related issue

Fixes #288

Changes

  • Implemented AgentTool class and a @tool decorator that leverages inspect.signature to automatically extract docstrings and generate strict JSON schemas (including robust support for __future__ stringified annotations).
  • Implemented ReActAgent with synchronous (run) and asynchronous (arun) Think-Act-Observe loops, complete with step budget guards to prevent infinite loops and graceful observation-based error handling for failed tool executions.
  • Implemented Planner agent to break down high-level objectives into strictly ordered PlanStep sequences using structured JSON outputs.
  • Added a comprehensive suite of unit tests (tests/test_agents.py) verifying multi-step tool execution, async runtimes, budget exhaustion, unregistered tools, and error recovery using a deterministic offline fake model.

Testing

  • Tests pass locally
  • Ruff checks pass
  • Documentation updated, if applicable (N/A for internal architecture, but docstrings are strictly enforced)

Checklist

  • My changes are focused and relevant to this pull request.
  • I have added or updated tests where appropriate.
  • I have reviewed my changes for unrelated modifications.
  • I have updated documentation where necessary.

@Kaap10

Kaap10 commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

Ready for review!

This branch has not been deployed

No deployments
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.

Agent primitives: tool-calling loop (ReAct) + planner

1 participant