Skip to main content
This guide walks you through building a multi-agent application with the AgenticAI Core SDK. You’ll define agents, tools, memory stores, and an orchestrator, then launch the application server.

Prerequisites

  • AgenticAI Core SDK installed and configured.
  • A configured LLM provider connection (OpenAI, Anthropic, or Azure OpenAI).
  • Python 3.8+ with async/await support.

Application components

Build the application

1. Define the application

Create an App instance with a name and orchestration type:

2. Create agents

Define agents for each domain or function in your application:
See Creating Agents for roles, sub-types, and prompt configuration.

3. Define tools

Register tools using the @Tool.register decorator. Agents can invoke them during task execution:
See Working with Tools for custom, inline, and library tool types.

4. Set up memory stores

Configure persistent storage for conversation state, user preferences, or application-wide data:
See Memory Stores for scopes, retention policies, and namespaces.

5. Configure advanced features

Set application-wide settings such as streaming, file attachments, and filler messages:

6. Assemble the application

Combine all components into the App instance:

7. Implement the orchestrator

Subclass AbstractOrchestrator to define routing logic:
See Custom Orchestration for message handling, routing strategies, and memory-aware orchestration.

8. Start the application

Launch the MCP server with your orchestrator:

Complete example

Best practices

  • Agent design: Keep agents focused on specific domains. Write detailed descriptions — the orchestrator uses them for routing. Include prompt guidelines and examples.
  • Tool design: Make tools single-purpose with clear descriptions. Handle errors and return meaningful messages.
  • Memory management: Choose the right scope (USER_SPECIFIC, SESSION_LEVEL, or APPLICATION_WIDE). Define schemas for strict validation in production. Set retention policies that match actual data lifetime.
  • Orchestration: Implement a route_to_user fallback for unmatched queries. Maintain context across conversation turns using memory stores.