Skip to main content
The SDK Behavior Matrix lists what each popular knob does, where it surprises people, and which test proves it.
Scope: praisonaiagents Python API, main branch. Test paths are relative to src/praisonai-agents/. Source of truth is the code plus the listed tests — if a docstring disagrees with this page, trust the test, then fix whichever is stale.
If your app disagrees with a row, check the Sharp edge column and reproduce on the real call path before filing a bug.

Quick Start


How to Use This Page

1

Find the knob

Locate the API in the matching section below.
2

Run the listed test

From the SDK’s src/praisonai-agents/ directory: PYTHONPATH=. python -m pytest <test> -q
3

Read the result

Test fails: likely an SDK defect, open a bug. Test passes but behavior differs: it is a sharp edge or a new bug.

1. Chat & Streaming

Streaming is configured through output=, not a constructor kwarg. Agent(stream=True) raises TypeError with the hint “streaming moved into output=; use output=OutputConfig(stream=True).” agent.stream is False unless output="stream" or OutputConfig(stream=True) is used.
When chat() / achat() return None: input guardrail or BEFORE_AGENT hook blocked the run, or the LLM call failed with anything other than ToolExecutionError (history is rolled back and the error is displayed/logged, not raised). Check for None rather than relying on try/except around chat(). An output guardrail rejection returns a fixed refusal string, not None; see agent.last_guardrail_error.

2. Memory Prefetch & Scope

Prefetch recalls relevant long-term memories into the prompt before each turn.

3. Structured Output

output_pydantic / output_json are per-call chat() / achat() kwargs (forwarded by start() / run()) and Task fields — not Agent constructor params. There is no output_json_schema. Native response_format is used when the model supports structured outputs; otherwise the schema is appended to the prompt as text.

4. Teams & Handoff

Teams run tasks in order; handoffs let one agent delegate to another.

5. AG-UI

AG-UI exposes an agent as a FastAPI router that streams events over SSE.

Best Practices

chat() returns None on blocked runs and most LLM failures instead of raising.
chat(output_pydantic=...) returns the raw string on parse failure, so confirm the type before use.
Without MemoryConfig(user_id=...), each agent instance has its own isolated memory.
A passing test with differing behavior points to a sharp edge, not an SDK defect.

Keeping This Page in Sync

Any PR that changes the behavior of a listed API should update the matching row (and its test) here and in the upstream copy at src/praisonai-agents/docs/sdk-behavior-matrix.md.

Streaming

Stream tokens as they arrive

Memory Prefetch

Recall memories before each turn

Structured Output

Get typed results from agents

Multi-Agent Output

Control team output

AG-UI Server

Serve agents over AG-UI

Handoff

Delegate between agents