You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tracks documentation work for the SDK change in MervinPraison/PraisonAI#1550 ("fix: ManagedAgent provider overload conflates hosted-runtime vs LLM-routing"). The PR landed on main and introduces two new canonical agent backends (HostedAgent, LocalAgent) and deprecates the overloaded ManagedAgent(provider=...) factory pattern.
This issue requires both new content and updates to existing pages. See sections below.
SDK Change Summary (ground truth — read before writing docs)
The PR adds these files in praisonai-package/src/praisonai/:
praisonai/integrations/hosted_agent.py — new HostedAgent + HostedAgentConfig
praisonai/integrations/local_agent.py — new LocalAgent + LocalAgentConfig
praisonai/__init__.py and praisonai/integrations/__init__.py — top-level exports for the new classes
examples/python/managed-agents/provider/ — new canonical examples (runtime_hosted_anthropic.py, runtime_local_openai.py, runtime_local_gemini.py, runtime_local_ollama.py)
tests/unit/integrations/test_backend_semantics.py — tests covering all semantic requirements
⚠️Mandatory before writing any page: Open the actual SDK source files above and verify every parameter, type, and default. Do not paraphrase from this issue — the issue is a starting brief, the SDK is the source of truth.
Two new canonical classes
Class
Semantic meaning
Replaces
HostedAgent
Entire agent loop runs on a cloud-managed runtime (Anthropic only today). Tools, context, execution all in the cloud.
ManagedAgent(provider="anthropic", ...)
LocalAgent
Agent loop runs locally in your process. Optional compute= for sandboxing tools in cloud (E2B, Modal, Flyio, Daytona, Docker). LLM is selected via config.model=.
ManagedAgent(provider="openai"/"gemini"/"ollama"/"local", ...) and any ManagedAgent(provider="e2b"/"modal"/...) cases
Imports (verify against praisonai/__init__.py and praisonai/integrations/__init__.py)
# Top-level (preferred for users)frompraisonaiimportHostedAgent, HostedAgentConfig, LocalAgent, LocalAgentConfig# Or via integrationsfrompraisonai.integrationsimportHostedAgent, HostedAgentConfig, LocalAgent, LocalAgentConfig# Agent itselffrompraisonaiagentsimportAgent
Class signatures (verify in source — do not blindly copy)
# hosted_agent.pyHostedAgentConfig=ManagedConfig# alias of existing ManagedConfigclassHostedAgent(AnthropicManagedAgent):
def__init__(
self,
provider: str="anthropic",
config: Optional[Any] =None,
**kwargs,
):
# Raises ValueError if provider != "anthropic" with helpful migration hint
# local_agent.pyLocalAgentConfig=LocalManagedConfig# alias of existing LocalManagedConfigclassLocalAgent(LocalManagedAgent):
def__init__(
self,
compute: Optional[Any] =None, # "e2b" | "modal" | "flyio" | "daytona" | "docker" | Noneconfig: Optional[Any] =None,
**kwargs,
):
# If provider= is passed, emits DeprecationWarning but routes through for back-compat
ManagedAgent factory behaviour after PR (deprecation matrix)
Call
Behaviour
ManagedAgent() (no provider)
Auto-detects: anthropic if ANTHROPIC_API_KEY/CLAUDE_API_KEY set, else local. No deprecation warning (auto-detected path stays quiet).
One-sentence intro — what it does (entire loop in Anthropic's cloud), not how.
Hero Mermaid diagram — graph LR showing User → HostedAgent → Anthropic cloud → tools running there → response. Use the standard color palette (#8B0000, #189AB4, #10B981, #F59E0B, #6366F1, white text, #7C90A0 strokes).
Quick Start — <Steps> with two <Step>s:
Simple Usage — minimal HostedAgent(provider="anthropic", config=HostedAgentConfig(model="claude-3-5-sonnet-latest", system="...")) wrapped in an Agent(name=..., backend=hosted). Show agent.start("...").
With Tools and Multi-Turn — show tools=[{"type": "agent_toolset_20260401"}] and a second agent.start() call to demonstrate session continuity. Mirror examples/python/managed-agents/provider/runtime_hosted_anthropic.py from the SDK PR.
How It Works — sequenceDiagram showing User → Agent → HostedAgent → Anthropic Cloud (loop + tools + LLM all on the right side) → response.
When to Use HostedAgent vs LocalAgent — graph TB decision diagram (the user said: "If multiple options in one page, people might be confused on what to choose, so create the mermaid diagram to choose what option at what instance").
Configuration Options — link to auto-generated SDK reference cards (/docs/sdk/reference/typescript/classes/HostedAgentConfig etc.) plus a small table of the most user-relevant fields (model, system, name, tools). Verify by reading ManagedConfig (which HostedAgentConfig aliases).
Common Patterns:
Multi-turn conversation in the same session (Anthropic keeps state in the cloud).
Usage tracking via hosted.retrieve_session() (returns the unified SessionInfo shape — link to managed-agents-session-info).
Listing sessions via hosted.list_sessions().
Migrating from ManagedAgent — short section showing the before/after:
Best Practices — <AccordionGroup> with 3–4 entries (managing API costs, choosing tools, session reuse, error handling around the not yet availableValueError for non-Anthropic providers).
Related — <CardGroup cols={2}> linking to local-agent, managed-agent-persistence, managed-agents-session-info, managed-cli.
2. docs/features/local-agent.mdx (new)
Page for the LocalAgent class. Required sections:
Frontmatter — title: "Local Agent", sidebarTitle: "Local Agent", description: "Run the agent loop locally with any LLM and optional cloud-sandboxed tools", icon: "desktop".
One-sentence intro — agent loop runs locally; LLM choice via config.model; optional compute= for cloud tool sandboxing.
Hero Mermaid diagram — graph LR showing local Python process containing the agent loop, LLM call going out (any provider via litellm routing), and tools either local-subprocess or in cloud compute. Standard palette.
With Cloud Compute Sandbox — LocalAgent(compute="e2b", config=LocalAgentConfig(model="gpt-4o-mini", tools=["execute_command", "read_file", "write_file"])).
How It Works — sequenceDiagram showing the local loop, LLM HTTP call (OpenAI/Gemini/Ollama via litellm prefixes), and tool execution either locally or routed to E2B/Modal/etc.
Choosing an LLM — <Tabs> with one tab per provider (OpenAI, Gemini, Ollama, Anthropic-via-LLM-only, custom litellm prefix). Each tab shows the model= string. Mirror examples/python/managed-agents/provider/runtime_local_*.py files added in the PR.
Choosing a Compute Backend — <Tabs> for None (local subprocess), "docker", "e2b", "modal", "flyio", "daytona". Each tab shows the one-line change. Plus a graph TB decision diagram for "which compute do I pick".
Configuration Options — link to auto-generated reference for LocalAgentConfig (alias of LocalManagedConfig). Show only the user-relevant fields in a table.
Common Patterns:
Switching LLMs without touching the rest of the code (just change model=).
Tool execution and tools=[...] parameter.
Multi-turn conversation with locally-maintained session state.
Usage tracking via local.retrieve_session().
Migrating from ManagedAgent — table covering each old pattern → new pattern:
Best Practices — <AccordionGroup> (pick a compute backend matching your trust level, use litellm prefixes, prefer LocalAgent over the deprecated factory, avoid provider= kwarg).
Related — links to hosted-agent, sandbox, managed-agent-persistence.
This page currently uses ManagedAgent(provider="anthropic", ...) everywhere.
Add a <Note> callout near the top: "ManagedAgent is deprecated as of PR #1550. New code should use HostedAgent for Anthropic-hosted runs (this page) or LocalAgent for local loops. Existing imports continue to work but emit a DeprecationWarning for non-Anthropic providers."
Update every code example to use HostedAgent + HostedAgentConfig instead of ManagedAgent(provider="anthropic", config=ManagedConfig(...)). Imports become:
Keep all the database-backend tabs (SQLite, PostgreSQL, MySQL, Redis, MongoDB, ClickHouse, JSON Files) — only the agent backend changes.
Update the ## Configuration Options table heading from "ManagedAgent API Reference" to "HostedAgent API Reference" and update card hrefs to /docs/sdk/reference/typescript/classes/HostedAgent and /docs/sdk/reference/typescript/classes/HostedAgentConfig.
Update the existing sequence diagram label from ManagedAgent → HostedAgent.
Update the ## Related cards to also link to the new local-agent.mdx and hosted-agent.mdx pages.
Optional rename consideration: if the site naming convention prefers it, this page can be renamed to hosted-agent-persistence.mdx. Default: keep the file name and slug to avoid breaking external links — only update the content. If renaming, add the old slug to docs.json redirects.
Add a <Note> at the top: the unified retrieve_session() shape applies to bothHostedAgent and LocalAgent (the new canonical classes), as well as the deprecated ManagedAgent factory.
Replace the Quick Start examples to use HostedAgent (anthropic) and LocalAgent (local) — drop ManagedAgent from the Quick Start. Keep the schema content unchanged.
Update the ## Related cards to point at /docs/features/hosted-agent and /docs/features/local-agent (currently they point at /docs/concepts/managed-agents and /docs/concepts/managed-agents-local which appear not to exist — verify and fix the dead links while you're there).
5. docs/features/managed-cli.mdx — UPDATE (light)
Update the "Related" <CardGroup> to add a card linking to the new hosted-agent.mdx page (the CLI manages Anthropic-hosted resources, so HostedAgent is the relevant Python-side counterpart).
In the agents create row, change "See ManagedAgent docs" → "See HostedAgent docs" with a link to /docs/features/hosted-agent.
Navigation/sidebar update
6. docs.json — UPDATE
Add the two new pages under the Features group (per AGENTS.md rule: "Update docs.json to add pages under 'Features' group, NEVER under 'Concepts'"). Suggested placement: keep them adjacent to the existing managed-agent entries so users find them together. The exact entries should be:
examples/python/managed-agents/provider/all_providers.py (modified in PR) → local-agent.mdx Compute Backends tabs.
examples/python/managed-agents/provider/local_basic.py (modified in PR) → local-agent.mdx simplest Quick Start.
Each example in the docs must be the shortest copy-paste-runnable form (per AGENTS.md writing rules). Strip print debug statements that aren't required to demonstrate the concept.
User Interaction Flow (per AGENTS.md rule 11)
Both pages must show, near the top, a real user interaction flow. Suggested:
HostedAgent page: a developer wires HostedAgent into an existing Agent, calls agent.start("..."), gets a streamed response, asks a follow-up that uses session continuity, then calls hosted.retrieve_session() to log usage.
LocalAgent page: a developer picks an LLM via model=, calls agent.start("..."), and (in a second step) flips to compute="e2b" to sandbox tool execution without changing any other line.
Constraints & Guard-Rails (from AGENTS.md)
The implementing agent must:
Read the actual SDK source for every parameter before writing — do not copy this issue verbatim.
Place new files under docs/features/ only. Do not touch docs/concepts/.
Never edit docs/js/ or docs/rust/ (auto-generated).
Use Mintlify components (<Steps>, <AccordionGroup>, <CardGroup>, <Tabs>).
Include a hero Mermaid diagram on every page using the standard color palette (#8B0000, #189AB4, #10B981, #F59E0B, #6366F1; white text; #7C90A0 strokes).
Default to no comments in code examples; use realistic but minimal data; never use placeholder secrets like "your-key-here".
Use simple imports (from praisonai import ..., from praisonai.integrations import ..., from praisonaiagents import Agent) — no deep paths in user-facing examples.
Page tone: non-developer-friendly, agent-centric (top-of-page example must use Agent(...)), make the reader feel "is it really this easy?"
One-sentence section intros. No forbidden phrases ("In this section…", "As you can see…", "Please note that…", "Let's take a look at…", "The following example shows…", "It's important to note that…").
Active voice. Direct.
After writing, validate docs.json is valid JSON.
Open a PR (never push directly to main). Use a feature branch.
Context
Tracks documentation work for the SDK change in MervinPraison/PraisonAI#1550 ("fix: ManagedAgent provider overload conflates hosted-runtime vs LLM-routing"). The PR landed on
mainand introduces two new canonical agent backends (HostedAgent,LocalAgent) and deprecates the overloadedManagedAgent(provider=...)factory pattern.This issue requires both new content and updates to existing pages. See sections below.
SDK Change Summary (ground truth — read before writing docs)
The PR adds these files in
praisonai-package/src/praisonai/:praisonai/integrations/hosted_agent.py— newHostedAgent+HostedAgentConfigpraisonai/integrations/local_agent.py— newLocalAgent+LocalAgentConfigpraisonai/integrations/managed_agents.py—ManagedAgentfactory updated with deprecation warnings + provider routingpraisonai/__init__.pyandpraisonai/integrations/__init__.py— top-level exports for the new classesexamples/python/managed-agents/provider/— new canonical examples (runtime_hosted_anthropic.py,runtime_local_openai.py,runtime_local_gemini.py,runtime_local_ollama.py)tests/unit/integrations/test_backend_semantics.py— tests covering all semantic requirementsTwo new canonical classes
HostedAgentManagedAgent(provider="anthropic", ...)LocalAgentcompute=for sandboxing tools in cloud (E2B, Modal, Flyio, Daytona, Docker). LLM is selected viaconfig.model=.ManagedAgent(provider="openai"/"gemini"/"ollama"/"local", ...)and anyManagedAgent(provider="e2b"/"modal"/...)casesImports (verify against
praisonai/__init__.pyandpraisonai/integrations/__init__.py)Class signatures (verify in source — do not blindly copy)
ManagedAgentfactory behaviour after PR (deprecation matrix)ManagedAgent()(no provider)anthropicifANTHROPIC_API_KEY/CLAUDE_API_KEYset, elselocal. No deprecation warning (auto-detected path stays quiet).ManagedAgent(provider="anthropic", ...)AnthropicManagedAgent. Still works.ManagedAgent(provider="openai"/"gemini"/"ollama"/"local", ...)DeprecationWarning. Routes toLocalManagedAgent.ManagedAgent(provider="e2b"/"modal"/"flyio"/"daytona"/"docker", ...)DeprecationWarning, routes toLocalManagedAgent(compute=<provider>)for back-compat.ManagedAgent(provider="<unknown>")ValueErrorwith migration hint pointing atLocalAgent.Documentation Work Required
Folder placement (per
AGENTS.md)All new and updated files go under
docs/features/. Do NOT touchdocs/concepts/(human-only). Do not edit auto-generateddocs/js/ordocs/rust/.Two NEW pages to create
1.
docs/features/hosted-agent.mdx(new)Page for the
HostedAgentclass. Required sections perAGENTS.mdtemplate:title: "Hosted Agent",sidebarTitle: "Hosted Agent",description: "Run the entire agent loop on Anthropic's managed cloud runtime",icon: "cloud".graph LRshowing User → HostedAgent → Anthropic cloud → tools running there → response. Use the standard color palette (#8B0000,#189AB4,#10B981,#F59E0B,#6366F1, white text,#7C90A0strokes).<Steps>with two<Step>s:HostedAgent(provider="anthropic", config=HostedAgentConfig(model="claude-3-5-sonnet-latest", system="..."))wrapped in anAgent(name=..., backend=hosted). Showagent.start("...").tools=[{"type": "agent_toolset_20260401"}]and a secondagent.start()call to demonstrate session continuity. Mirrorexamples/python/managed-agents/provider/runtime_hosted_anthropic.pyfrom the SDK PR.sequenceDiagramshowing User → Agent → HostedAgent → Anthropic Cloud (loop + tools + LLM all on the right side) → response.graph TBdecision diagram (the user said: "If multiple options in one page, people might be confused on what to choose, so create the mermaid diagram to choose what option at what instance")./docs/sdk/reference/typescript/classes/HostedAgentConfigetc.) plus a small table of the most user-relevant fields (model,system,name,tools). Verify by readingManagedConfig(whichHostedAgentConfigaliases).hosted.retrieve_session()(returns the unifiedSessionInfoshape — link tomanaged-agents-session-info).hosted.list_sessions().ManagedAgent— short section showing the before/after:<AccordionGroup>with 3–4 entries (managing API costs, choosing tools, session reuse, error handling around thenot yet availableValueErrorfor non-Anthropic providers).<CardGroup cols={2}>linking tolocal-agent,managed-agent-persistence,managed-agents-session-info,managed-cli.2.
docs/features/local-agent.mdx(new)Page for the
LocalAgentclass. Required sections:title: "Local Agent",sidebarTitle: "Local Agent",description: "Run the agent loop locally with any LLM and optional cloud-sandboxed tools",icon: "desktop".config.model; optionalcompute=for cloud tool sandboxing.graph LRshowing local Python process containing the agent loop, LLM call going out (any provider via litellm routing), and tools either local-subprocess or in cloud compute. Standard palette.<Steps>:LocalAgent(config=LocalAgentConfig(model="gpt-4o-mini"))+Agent(backend=local).LocalAgent(compute="e2b", config=LocalAgentConfig(model="gpt-4o-mini", tools=["execute_command", "read_file", "write_file"])).sequenceDiagramshowing the local loop, LLM HTTP call (OpenAI/Gemini/Ollama via litellm prefixes), and tool execution either locally or routed to E2B/Modal/etc.<Tabs>with one tab per provider (OpenAI, Gemini, Ollama, Anthropic-via-LLM-only, custom litellm prefix). Each tab shows themodel=string. Mirrorexamples/python/managed-agents/provider/runtime_local_*.pyfiles added in the PR.<Tabs>forNone(local subprocess),"docker","e2b","modal","flyio","daytona". Each tab shows the one-line change. Plus agraph TBdecision diagram for "which compute do I pick".LocalAgentConfig(alias ofLocalManagedConfig). Show only the user-relevant fields in a table.model=).tools=[...]parameter.local.retrieve_session().ManagedAgent— table covering each old pattern → new pattern:ManagedAgent(provider="openai", config=LocalManagedConfig(model="gpt-4o"))LocalAgent(config=LocalAgentConfig(model="gpt-4o"))ManagedAgent(provider="ollama", config=LocalManagedConfig(model="llama3"))LocalAgent(config=LocalAgentConfig(model="ollama/llama3"))ManagedAgent(provider="gemini", ...)LocalAgent(config=LocalAgentConfig(model="gemini/gemini-2.0-flash"))ManagedAgent(provider="e2b", ...)LocalAgent(compute="e2b", config=LocalAgentConfig(...))ManagedAgent(provider="modal", ...)LocalAgent(compute="modal", config=LocalAgentConfig(...))<AccordionGroup>(pick a compute backend matching your trust level, use litellm prefixes, preferLocalAgentover the deprecated factory, avoidprovider=kwarg).hosted-agent,sandbox,managed-agent-persistence.Existing pages to update
3.
docs/features/managed-agent-persistence.mdx— UPDATEThis page currently uses
ManagedAgent(provider="anthropic", ...)everywhere.<Note>callout near the top: "ManagedAgentis deprecated as of PR #1550. New code should useHostedAgentfor Anthropic-hosted runs (this page) orLocalAgentfor local loops. Existing imports continue to work but emit aDeprecationWarningfor non-Anthropic providers."HostedAgent+HostedAgentConfiginstead ofManagedAgent(provider="anthropic", config=ManagedConfig(...)). Imports become:## Configuration Optionstable heading from "ManagedAgent API Reference" to "HostedAgent API Reference" and update card hrefs to/docs/sdk/reference/typescript/classes/HostedAgentand/docs/sdk/reference/typescript/classes/HostedAgentConfig.ManagedAgent→HostedAgent.## Relatedcards to also link to the newlocal-agent.mdxandhosted-agent.mdxpages.hosted-agent-persistence.mdx. Default: keep the file name and slug to avoid breaking external links — only update the content. If renaming, add the old slug to docs.json redirects.4.
docs/features/managed-agents-session-info.mdx— UPDATE<Note>at the top: the unifiedretrieve_session()shape applies to bothHostedAgentandLocalAgent(the new canonical classes), as well as the deprecatedManagedAgentfactory.HostedAgent(anthropic) andLocalAgent(local) — dropManagedAgentfrom the Quick Start. Keep the schema content unchanged.## Relatedcards to point at/docs/features/hosted-agentand/docs/features/local-agent(currently they point at/docs/concepts/managed-agentsand/docs/concepts/managed-agents-localwhich appear not to exist — verify and fix the dead links while you're there).5.
docs/features/managed-cli.mdx— UPDATE (light)<CardGroup>to add a card linking to the newhosted-agent.mdxpage (the CLI manages Anthropic-hosted resources, so HostedAgent is the relevant Python-side counterpart).agents createrow, change "See ManagedAgent docs" → "See HostedAgent docs" with a link to/docs/features/hosted-agent.Navigation/sidebar update
6.
docs.json— UPDATEAdd the two new pages under the Features group (per
AGENTS.mdrule: "Update docs.json to add pages under 'Features' group, NEVER under 'Concepts'"). Suggested placement: keep them adjacent to the existing managed-agent entries so users find them together. The exact entries should be:After modification, validate
docs.jsonis still valid JSON.Examples to mirror
The PR adds runnable examples that should be adapted (shortened to "minimal way to do X") for the docs:
examples/python/managed-agents/provider/runtime_hosted_anthropic.py→hosted-agent.mdxQuick Start.examples/python/managed-agents/provider/runtime_local_openai.py→local-agent.mdxOpenAI tab.examples/python/managed-agents/provider/runtime_local_gemini.py→local-agent.mdxGemini tab.examples/python/managed-agents/provider/runtime_local_ollama.py→local-agent.mdxOllama tab.examples/python/managed-agents/provider/all_providers.py(modified in PR) →local-agent.mdxCompute Backends tabs.examples/python/managed-agents/provider/local_basic.py(modified in PR) →local-agent.mdxsimplest Quick Start.Each example in the docs must be the shortest copy-paste-runnable form (per
AGENTS.mdwriting rules). Strip print debug statements that aren't required to demonstrate the concept.User Interaction Flow (per AGENTS.md rule 11)
Both pages must show, near the top, a real user interaction flow. Suggested:
HostedAgentinto an existingAgent, callsagent.start("..."), gets a streamed response, asks a follow-up that uses session continuity, then callshosted.retrieve_session()to log usage.model=, callsagent.start("..."), and (in a second step) flips tocompute="e2b"to sandbox tool execution without changing any other line.Constraints & Guard-Rails (from AGENTS.md)
The implementing agent must:
docs/features/only. Do not touchdocs/concepts/.docs/js/ordocs/rust/(auto-generated).<Steps>,<AccordionGroup>,<CardGroup>,<Tabs>).#8B0000,#189AB4,#10B981,#F59E0B,#6366F1; white text;#7C90A0strokes)."your-key-here".from praisonai import ...,from praisonai.integrations import ...,from praisonaiagents import Agent) — no deep paths in user-facing examples.Agent(...)), make the reader feel "is it really this easy?"docs.jsonis valid JSON.Suggested PR Title
docs(features): add HostedAgent + LocalAgent pages, update ManagedAgent referencesAcceptance Checklist
docs/features/hosted-agent.mdxcreated, follows AGENTS.md template, runs cleanly when previewed.docs/features/local-agent.mdxcreated, follows AGENTS.md template, runs cleanly when previewed.docs/features/managed-agent-persistence.mdxupdated to useHostedAgent, deprecation note added, deadRelatedlinks fixed.docs/features/managed-agents-session-info.mdxupdated to referenceHostedAgent/LocalAgent, brokenRelatedlinks fixed.docs/features/managed-cli.mdxupdated with link to the newhosted-agent.mdx.docs.jsonincludes both new pages in the Features group, file is valid JSON./docs/concepts/managed-agents*remain anywhere in the touched files.main(do NOT modifydocs/concepts/).Reference Links
praisonai-package/src/praisonai/praisonai/integrations/hosted_agent.pypraisonai-package/src/praisonai/praisonai/integrations/local_agent.pypraisonai-package/src/praisonai/praisonai/integrations/managed_agents.py(factory updated)praisonai-package/src/praisonai/examples/python/managed-agents/provider/runtime_*.pypraisonai-package/src/praisonai/tests/unit/integrations/test_backend_semantics.py