Skip to main content
The engine ships adapters for LangGraph and Google ADK. If you run a different framework (CrewAI, LlamaIndex, AutoGen, or your own runtime), you can wrap it as an Idun adapter by subclassing BaseAgent. This page covers the abstract surface, the lifecycle the engine expects, and the limits of the extension point today.
The adapter factory in idun_agent_engine.core.config_builder.ConfigBuilder.initialize_agent_from_config is currently a hardcoded if/elif over the AgentFramework enum. Wiring a new adapter therefore requires a small upstream change: either a fork or a PR. There is no Python entry-point hook today. This is on the roadmap; please open an issue if you need a stable plugin API.

The base class

BaseAgent lives in libs/idun_agent_engine/src/idun_agent_engine/agent/base.py. It is an ABC with the following surface:

Required overrides

run is the only path the modern POST /agent/run route uses. invoke and stream exist for the deprecated /agent/invoke and /agent/stream compatibility shims. New adapters should focus on run; invoke and stream can raise NotImplementedError if you do not need the deprecated routes.

Optional overrides

Constructor

Your __init__ must call super().__init__() to populate self.run_event_observers: RunEventObserverRegistry. Run-event observers are how the standalone trace pipeline subscribes to AG-UI events for the local trace store.

Minimal adapter sketch

my_adapter.py

Lifecycle

  1. Boot. The engine reads config.yaml, validates the agent.type field against the AgentFramework enum, and instantiates your adapter class.
  2. initialize(config, observability). Called once. Use this to parse agent.config, instantiate your framework, and register callbacks. Raise an exception to abort boot.
  3. discover_capabilities(). Called by the engine to populate /agent/capabilities. The standalone admin UI uses the result to choose between the chat input and the structured-JSON input.
  4. run_event_observers registration. The engine subscribes its trace pipeline before serving the first request. Your run() method does not need to know about observers: BaseAgent handles dispatch when AG-UI events are yielded.
  5. run(input_data). Called per request to POST /agent/run. The HTTP layer iterates the generator and forwards each event over Server-Sent Events. The deprecated /agent/invoke and /agent/stream routes delegate to invoke() and stream() respectively.

Capability discovery

AgentCapabilities describes what your adapter accepts and returns. The standalone UI uses this to render the right input control.
InputDescriptor.mode is Literal["chat", "structured"]. OutputDescriptor.mode is Literal["text", "structured", "unknown"]. When input.mode == "structured", the standalone chat surface validates that messages[-1].content is JSON matching the schema before forwarding to your adapter.

Wiring the adapter into the engine

Until a plugin API ships, you need to register your adapter in two places.

1. Use or add an enum value

The AgentFramework enum in idun_agent_schema/engine/agent_framework.py already ships a CUSTOM slot that you can claim without forking the schema. If you need a named slot for upstream contribution, add one:

2. Add a branch in ConfigBuilder.initialize_agent_from_config

Then in your config.yaml:

Reference adapter: LangGraph

The LangGraph adapter at libs/idun_agent_engine/src/idun_agent_engine/agent/langgraph/langgraph.py is the most complete worked example. Reading it end-to-end is the fastest way to see how:
  • _load_graph_builder resolves the graph_definition string (file path first, module fallback)
  • _setup_persistence configures InMemorySaver, AsyncSqliteSaver, or AsyncPostgresSaver based on the checkpointer config
  • discover_capabilities() reads graph.input_schema and graph.output_schema to detect chat vs structured mode
  • run() delegates to LangGraph’s AG-UI wrapper (LangGraphAGUIAgent) which emits RunStarted, StepStarted, TextMessageStart / Content / End, ToolCallStart / Args / End, ThinkingStart / End, and RunFinished events
  • get_graph_ir() introspects the compiled graph and emits a framework-agnostic AgentGraph for the admin panel

What’s next

Custom observability handler

The same extension pattern for tracing providers.

SSO

JWT validation works for any adapter.

Troubleshooting

Common boot failures.
Last modified on May 20, 2026