Skip to main content
Export any Agent or team to a JSON-safe config dict, and rebuild an equivalent one on the other end.
Reference: PraisonAI PR #4985 — introduces agent_to_dict / agent_from_dict / team_to_dict and defines AGENT_CONFIG_VERSION = 1.

Quick Start

1

Round-trip a tool-less agent

2

Round-trip with tools


How It Works

A tool exports by name because a callable cannot survive JSON, so import re-binds those names through a tool_registry.

What gets exported vs. reset

The exporter derives its field set from the live Agent.__init__ signature, so an attribute that moved into a grouped config never leaks into a config that cannot be imported.

The tools_resolvable flag

Tools export by name because a callable cannot survive JSON, and the flag reports whether every name could be captured. tools_resolvable is False when a tool has no usable name/__name__ — that config cannot round-trip cleanly, and refusing is safer than silently dropping the tool.

Refusals (fail-loud)

Import refuses loudly rather than rebuilding a subtly-wrong agent.

Common Patterns

Diff two team configs

Persist a team to a file, reload it

Hand a Python-built team to the visual builder


When to use team_to_dict vs. agent_to_dict

team_to_dict dumps every member’s config in one call, so reach for it whenever more than one agent is involved.
A tasks_included: False value is the caller’s signal that the team had tasks whose graph did not come across.

Known limits (v1)

Grouped feature configs (output=, reflection=, execution=, caching=, hooks=, skills=, planning=, web=, context=, autonomy=, templates=, learn=, sandbox=, knowledge=, guardrails=, approval=) are not yet serialised. An agent relying on a customised grouped config round-trips to one carrying that config’s defaults, not the original. The team task graph is also not serialised — tasks_included: False reports when tasks were dropped.

Best Practices

Import refuses a tools-declaring config without a tool_registry. That fail-loud path is a feature — it stops you rebuilding a tool-less agent that looks like it chose not to act. Pass tool_registry={name: callable} with every declared tool.
A config with tools_resolvable=False cannot round-trip its tools. Check the flag right after agent_to_dict and fix the tool’s name before saving the blob.
Round-trip only works when version matches AGENT_CONFIG_VERSION. Leave it alone — it bumps only when the schema changes, and a mismatch refuses on import by design.
team_to_dict exports every member, but the task graph is not serialised in v1. Keep task wiring in Python until task-graph serialisation lands; tasks_included: False tells you when tasks were dropped.

Agent Cloning

Produce a second agent from a first, with isolated state

YAML Configuration Reference

The reverse direction — config file to agent