Skip to main content

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

The commands and their purposes are summarized below.

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 the MemoryStore class:
Add the store to your app configuration:
Call .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 through RequestContext:
The memory manager supports full CRUD operations:

Best Practices

  • Define clear, focused schemas. Use strict_schema=True in production.
  • Use USER_SPECIFIC for personal data, APPLICATION_WIDE for shared resources, and SESSION_LEVEL for 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 initialize Logger with the name of your tool:
Log messages at the appropriate severity level:

Log Levels

Log Message Structure

Each log message is automatically structured with these fields:
The logger automatically includes the current UTC timestamp, session ID, and user ID from the request context.

Example

Receiving Logs

Logs are delivered via SSE. Use a raw SSE client or the MCP client to receive them. SSE client:
MCP client:
The MCP client approach provides built-in session management, automatic reconnection handling, and integration with MCP’s event system.

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 DEBUG for troubleshooting, INFO for normal flow, and reserve WARNING and ERROR for actionable conditions.