Architecture Overview

AA Kit is built on a modular, layered architecture that prioritizes simplicity, interoperability, and production readiness.

Layered Architecture

Each layer builds on the one below, creating a robust foundation for AI agents.

Application Layer

Your AI agents and applications

Custom AgentsMulti-Agent SystemsBusiness Logic

Agent Layer

Core agent functionality and reasoning

Agent CoreReasoning EngineTool Registry

Protocol Layer

MCP protocol and communication

MCP ServerMCP ClientProtocol Handlers

Provider Layer

LLM providers and integrations

OpenAIAnthropicModel Management

Infrastructure Layer

Production features and reliability

Rate LimitingCachingCircuit Breakers

Core Components

Understanding the key components that make AA Kit powerful yet simple.

Agent Core

The heart of every agent. Manages state, conversations, and tool execution.

  • Stateless design for scalability
  • Session-based context management
  • Async-first architecture
  • Type-safe interfaces

Reasoning Engine

Pluggable reasoning patterns for different use cases.

  • Simple (direct responses)
  • ReAct (tool usage)
  • Chain of Thought
  • Custom patterns

MCP Integration

Every agent is an MCP server, ensuring universal compatibility.

  • Native MCP protocol
  • Auto tool conversion
  • Service discovery
  • Bidirectional communication

Memory System

Flexible memory backends for stateless agents.

  • In-memory (dev)
  • Redis (production)
  • SQLite (local)
  • PostgreSQL (coming)

Production Features

Enterprise-grade reliability built into every agent.

  • Connection pooling
  • Hierarchical timeouts
  • Response caching
  • Graceful degradation

Tool System

Powerful tool integration with automatic MCP conversion.

  • Function decorators
  • Type inference
  • Automatic documentation
  • Tool composition

Request Flow

How a request flows through the AA Kit architecture

1

Request Received

Client sends a message to the agent

2

Rate Limiting

Check rate limits and apply throttling if needed

3

Cache Check

Look for semantically similar cached responses

4

Context Loading

Load session context from memory backend

5

Reasoning

Apply reasoning pattern (Simple, ReAct, CoT)

6

Tool Execution

Execute any required tools via MCP

7

Response Generation

Generate response using selected LLM

8

Context Update

Update session context in memory

9

Response Caching

Cache response for future similar requests

10

Return Response

Send response back to client

Design Principles

The guiding principles that shape every decision in AA Kit

Simplicity First

The most common use cases should require minimal code. Complexity is progressive.

Universal Interoperability

Every agent speaks MCP. No agent is an island.

Production by Default

Enterprise features aren't add-ons, they're built into the core.

Developer Experience

APIs should be intuitive, errors should be helpful, documentation should be excellent.

Built for Scale, Designed for Simplicity

Start building on a solid architectural foundation.

Explore the Docs