Async Python SDK for the Persona AI platform.
pip install persona-sdk-python Or with uv:
uv add persona-sdk-python Requirements: Python 3.10+
import asyncio from persona_sdk import PersonaSdk async def main(): sdk = PersonaSdk( base_url="https://persona.applica.guru/api", auth="prs_your_project_api_key", ) # List agents in your project -> Paginated[AgentConfiguration] page = await sdk.agents.list() for agent in page.items: print(agent.id, agent.name, agent.model.model_name) await sdk.close() asyncio.run(main()) Authentication The SDK supports two authentication methods via the auth parameter.
A plain string is wrapped automatically in ApiKeyAuthenticationProvider and sent as the x-persona-apikey header. Accepts:
from persona_sdk import PersonaSdk sdk = PersonaSdk( base_url="https://persona.applica.guru/api", auth="prs_your_project_api_key", ) IAM Bearer token For applications that authenticate users via IAM, pass a BearerTokenAuthenticationProvider with a valid JWT:
Implement your own provider by subclassing AuthenticationProvider:
from persona_sdk import AuthenticationProvider class MyProvider(AuthenticationProvider): def headers(self) -> dict[str, str]: return {"x-custom-header": "value"} def credentials(self) -> str: return "my-credentials" Available APIs The PersonaSdk instance exposes one client per resource:
Each API method is fully async. Always close the SDK when done to release the underlying HTTP connection pool:
sdk = PersonaSdk( base_url="https://persona.applica.guru/api", auth="prs_your_api_key", ) try: agents = await sdk.agents.list() finally: await sdk.close() CRUD example Every API method is typed via the pydantic models re-exported from persona-models (e.g. AgentConfiguration, Project, Mission, ...). Write methods accept either a model instance or a plain dict; read methods always return the parsed model (or Paginated[...] for list endpoints).
from persona_sdk import AgentConfiguration, ModelConfiguration # Create an agent from a typed model agent = await sdk.agents.create( AgentConfiguration( name="my-agent", model=ModelConfiguration(model_name="gpt-4o"), ) ) # Read -> AgentConfiguration fetched = await sdk.agents.get(agent.id) # Update (mutate the model and send it back) fetched.name = "renamed-agent" await sdk.agents.update(agent.id, fetched) # Delete await sdk.agents.delete(agent.id) A plain dict is still accepted for backwards compatibility:
agent = await sdk.agents.create({"name": "my-agent", "model": {"modelName": "gpt-4o"}}) AI System Instructions Generation Generate system instructions for an agent using the project's AI architect:
# Generate from a description instructions = await sdk.agents.generate_system_instructions( "Create a customer support agent that handles billing inquiries" ) # Multi-turn refinement with session ID instructions = await sdk.agents.generate_system_instructions( "Add a rule to always ask for the order number first", session_id="my-session-id", ) # Get the project's architect agent configuration -> AgentConfiguration architect = await sdk.agents.get_architect() Pagination List endpoints return a Paginated[ ] with typed .items, .total, .page and .size:
page = await sdk.agents.list(keyword="bot", page=1, size=20) # page.items -> list[AgentConfiguration] # page.total -> 42 # page.page -> 1 # page.size -> 20 Model aliases A model alias is a named indirection: agents set their model to alias: and the alias holds the concrete provider/model, ordered fallbacks and optional defaults, so changing one alias moves every agent that uses it. Writing needs a super admin, a project admin or the project API key.
from persona_sdk import ModelAlias, ModelAliasDefaults, alias_ref # Create: only name, target, projectId, description, fallbacks and defaults are # sent (health, history and timestamps are managed by the server). A plain dict # with the same keys works too. alias = await sdk.model_aliases.create( ModelAlias( name="smart-default", target="openai/gpt-5", fallbacks=["anthropic/claude-sonnet-4"], defaults=ModelAliasDefaults(max_output_tokens=4000), ) ) # Point an agent at it agent.model.model_name = alias_ref("smart-default") # "alias:smart-default" page = await sdk.model_aliases.list(keyword="smart", page=1, size=20) alias = await sdk.model_aliases.get(alias.id) # Move every agent to another model (name and scope are immutable) alias.target = "grok/grok-4" alias = await sdk.model_aliases.update(alias.id, alias) impact = await sdk.model_aliases.impact(alias.id) # AliasImpact: total, usages alias = await sdk.model_aliases.check(alias.id) # runs the health check now print(alias.health.status, alias.health.issues) Suggestions Replacement and fallback candidates for the alias' target (or for another model, e.g. a fallback that went missing). A proposal only: nothing is applied.
sugg = await sdk.model_aliases.suggestions(alias.id, model="grok/grok-4", limit=5) for s in sugg.replacements: print(s.model, s.context_window, s.warnings) Deleting an alias that is in use Deleting an alias still referenced by agents is refused with a 409. The SDK raises the usual httpx.HTTPStatusError; ModelAliasesApi.in_use reads the blocking agents from it, or returns None for any other error:
import httpx from persona_sdk import ModelAliasesApi try: await sdk.model_aliases.remove(alias.id) except httpx.HTTPStatusError as e: impact = ModelAliasesApi.in_use(e) if impact is None: raise print(f"used by {impact.total} agent(s):", [u.agent_id for u in impact.usages]) Notifications In-platform notifications (e.g. an alias whose model is being retired). A project sees its own; platform-wide ones are for super admins.
page = await sdk.notifications.list(unread_only=True, page=1, size=20) badge = await sdk.notifications.unread_count() # int n = await sdk.notifications.mark_read(page.items[0].id) # -> Notification await sdk.notifications.mark_all_read(project_id="p1") # returns None Workflows If your workflows service runs on a different host, pass workflows_url:
from persona_sdk import PersonaClient from persona_sdk.runners import AgentRunner, invoke_tool, retrieve_resource client = PersonaClient( base_url="https://persona.applica.guru/api", auth="prs_...", ) # Run an agent in an existing session runner = AgentRunner(client=client, agent_id="agent-1", session_code="sess-1") response = await runner.run("Hello, agent!") # Invoke an MCP tool directly result = await invoke_tool( client=client, mcp_server_name="my-mcp", transport=..., tool_name="search", args={"query": "hello"}, ) Proxy support sdk = PersonaSdk( base_url="https://persona.applica.guru/api", auth="prs_...", proxy="http://proxy.local:8080", ) License Proprietary — © Applica Software Guru
Both files in this release have provenance metadata.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 22, 2026 2 release files Full provenance
Nov 13, 2026 2 release files Full provenance
Oct 28, 2026 2 release files Full provenance
Sep 25, 2026 2 release files Full provenance
Sep 21, 2026 2 release files No provenance
Jul 20, 2026 2 release files No provenance
Jul 19, 2026 2 release files No provenance
Jul 17, 2026 2 release files No provenance
Jul 7, 2026 2 release files No provenance
Jun 30, 2026 2 release files No provenance
Jun 18, 2026 2 release files No provenance
Jun 17, 2026 2 release files No provenance
Jun 11, 2026 2 release files No provenance
Jun 8, 2026 2 release files No provenance
May 14, 2026 2 release files No provenance
May 11, 2026 2 release files No provenance
Apr 21, 2026 2 release files No provenance
Apr 12, 2026 2 release files No provenance
Apr 9, 2026 2 release files No provenance
Mar 23, 2026 2 release files No provenance
Mar 19, 2026 2 release files No provenance
Mar 13, 2026 2 release files No provenance




