Work with agents
Use agents when you need to release agents, state persistence, and recovery.
Prerequisites
- Access to the project source code
- Familiarity with the files under src/attune/agents/**
Steps
-
Understand the current behavior. Read the entry points to see what agents does today before making changes. The primary functions are:
get_langchain_adapter()insrc/attune/agent_factory/adapters/__init__.py— Get LangChain adapter (lazy import).get_langgraph_adapter()insrc/attune/agent_factory/adapters/__init__.py— Get LangGraph adapter (lazy import).get_autogen_adapter()insrc/attune/agent_factory/adapters/__init__.py— Get AutoGen adapter (lazy import).get_haystack_adapter()insrc/attune/agent_factory/adapters/__init__.py— Get Haystack adapter (lazy import).wrap_wizard()insrc/attune/agent_factory/adapters/wizard_adapter.py— Quick helper to wrap a wizard as an agent.
-
Locate the right function to change. Each function has a single responsibility. Read its docstring, parameters, and return type to confirm it owns the behavior you need to modify.
-
Make your change. Follow existing patterns in the file — naming conventions, error handling style, and logging.
-
Run the related tests. This catches regressions before they reach other developers. Target with
pytest -k "agents".
Key files
src/attune/agents/**src/attune/agent_factory/**
Common modifications
Functions you are most likely to modify:
get_langchain_adapter()insrc/attune/agent_factory/adapters/__init__.pyget_langgraph_adapter()insrc/attune/agent_factory/adapters/__init__.pyget_autogen_adapter()insrc/attune/agent_factory/adapters/__init__.pyget_haystack_adapter()insrc/attune/agent_factory/adapters/__init__.pywrap_wizard()insrc/attune/agent_factory/adapters/wizard_adapter.pysafe_agent_operation()insrc/attune/agent_factory/decorators.pyretry_on_failure()insrc/attune/agent_factory/decorators.pylog_performance()insrc/attune/agent_factory/decorators.py