Skip to content

Fix/agnets#91

Merged
Iamsdt merged 10 commits intomainfrom
fix/agnets
Apr 6, 2026
Merged

Fix/agnets#91
Iamsdt merged 10 commits intomainfrom
fix/agnets

Conversation

@Iamsdt
Copy link
Copy Markdown
Collaborator

@Iamsdt Iamsdt commented Apr 6, 2026

This pull request refactors the way tools are configured and injected into the Agent class, moving from the previous tools parameter to a new, more flexible tool_node parameter. It also introduces first-class support for agent-level memory integration and improves error handling for tool resolution. The changes clarify the API, simplify the code, and enhance extensibility for advanced use cases.

Tool configuration and API refactor:

  • The Agent class now accepts a tool_node parameter, which can be a ToolNode instance or a string referencing a named graph node, instead of the previous tools and tool_node_name parameters. This makes tool wiring explicit and more flexible, both for inline and graph-based workflows. [1] [2] [3] [4]
  • The _setup_tools method in AgentExecutionMixin is updated to normalize and handle the new tool_node parameter, supporting both direct instances and lazy DI resolution via string names.
  • The public get_tool_node() method now simply returns the agent-owned ToolNode if configured.

Agent memory integration:

  • Agent-level memory is now supported by accepting an optional memory parameter (of type MemoryConfig) in the Agent constructor and initializing it via the new AgentMemoryMixin. This enables long-term memory tools and system prompts to be injected into the agent. [1] [2] [3]

Improved error handling:

  • ToolNode resolution by name now raises a clear RuntimeError if the referenced node is missing or not a ToolNode, instead of logging a warning and continuing. This prevents silent failures and surfaces misconfigurations early.

Documentation and examples:

  • The Agent class docstring and usage examples are updated to reflect the new tool_node API, including both inline and named ToolNode patterns, and to clarify the role of the memory parameter. [1] [2] [3] [4]

Cleanup and modernization:

  • Unused imports and legacy code paths for the old tools parameter are removed, and type annotations are modernized for clarity and correctness. [1] [2]

These changes modernize the agent interface, improve reliability, and lay the groundwork for more advanced agent memory and tool composition features.

Iamsdt added 10 commits April 6, 2026 00:51
…g unused agents, and updating documentation for clarity
…r improved tool management and clarity; update related documentation and examples accordingly.
…cy and clarity; ensure ToolNode initialization is validated before skill setup.
…rganization

- Moved agent imports to the end of the __all__ list for better readability.
- Ensured consistency in the order of exports by grouping tools and agents separately.
- Introduced MemoryConfig, UserMemoryConfig, and AgentMemoryConfig for managing user and agent memory.
- Updated Agent class to accept MemoryConfig and handle memory initialization.
- Added user_memory_tool and agent_memory_tool for model-facing memory operations.
- Refactored memory handling in the agent to support preload and search functionalities.
- Enhanced tests to cover new memory configurations and tool behaviors.
- Created MemoryPlan.md to outline the new memory architecture and implementation strategy.
…d clarity; remove unnecessary dynamic imports.
…ry handling; enhance long-term memory prompts and version bump
…memory tool imports for improved organization
@Iamsdt Iamsdt merged commit bc0ae5d into main Apr 6, 2026
5 of 6 checks passed
@Iamsdt Iamsdt deleted the fix/agnets branch April 6, 2026 13:54
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.

1 participant