SDK Architecture
The AgenticAI SDK separates operations into two phases: design-time (configuration) and runtime (execution). During design-time, you define your app, agents, and tools. At runtime, those definitions execute as a deployed application. The SDK has two major components:- agentic-core — A Python library that provides design-time configuration models and runtime interfaces.
- Workspace — A project scaffold with a CLI for building, packaging, and deploying your app.
Component Interaction
The diagram below shows how SDK components interact with the platform.agentic-core Library
agentic-core is the foundational library for both design-time and runtime needs.
Design-Time Module
agenticai_core.designtime provides builder-pattern classes for configuring entities. The builder classes capture entity relationships and offer an autocomplete-friendly API for configuring:
- Apps with custom orchestrators.
- Agents with specific roles and capabilities.
- Tools with various implementations.
- LLM models with configurable parameters.
Runtime Module
agenticai_core.runtime provides:
- Abstract interfaces — Base classes (
abstract_agent,abstract_orchestrator) that your custom implementations must extend. - Request/response classes — Classes that parse and encapsulate agentic conversation state across a session.
- MCP server — An SSE (Server-Sent Events) transport server for real-time communication. The MCP server lifecycle is tied to the application — calling
app.start()automatically starts the MCP server.
Library Structure
Design-Time Model
The following class diagram shows the relationships between design-time entities.Runtime Model
At runtime, a separate set of classes manages agent execution and message passing. The following class diagram shows the runtime components and their relationships.Workspace
The Workspace is a project scaffold that includes:- A skeleton project structure to bootstrap new apps.
- Example implementations for custom orchestrators and tools.
- Environment configuration management for dev, staging, and production.
- A CLI (
run.py) for common development and deployment tasks.
Workspace Structure
CLI Reference
Deployment Workflow
The following sequence diagram shows the complete lifecycle from development to undeployment. The workflow has five phases:Platform APIs
Memory Stores
Memory stores provide persistent data storage scoped to the user, application, or session. You configure them at design-time and access them in your tools at runtime.Configuration
Define a memory store using theMemoryStore class:
.set_memory_store() for each store to add multiple stores to the same app.
Scopes
Retention Policies
Runtime Usage
Access memory stores in your tools throughRequestContext:
Best Practices
- Define clear, focused schemas. Use
strict_schema=Truein production. - Use
USER_SPECIFICfor personal data,APPLICATION_WIDEfor shared resources, andSESSION_LEVELfor temporary state. - Choose retention policies based on data sensitivity and privacy requirements.
- Use projections in
get_content()to retrieve only the fields you need. - Always handle memory access errors and provide fallback values.
Logging
The SDK provides a structured logging system for tools. Logs are sent to the platform in real-time over SSE.Usage in Tools
Import and initializeLogger with the name of your tool:
Log Levels
Log Message Structure
Each log message is automatically structured with these fields:Example
Receiving Logs
Logs are delivered via SSE. Use a raw SSE client or the MCP client to receive them. SSE client:Best Practices
- Use descriptive logger names that identify the tool or component — for example,
'GreetTool'or'MultiplyMatricesTool'. - Include relevant context (parameters, request IDs) in log messages.
- Log errors with enough detail to diagnose the issue, including stack traces when available.
- Use
DEBUGfor troubleshooting,INFOfor normal flow, and reserveWARNINGandERRORfor actionable conditions.