> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> An overview of how SWAI components work together

<Warning>
  **SWAI is currently under active development**

  The platform is evolving rapidly, and components, APIs, and documentation may change frequently as we refine and enhance the system.
</Warning>

SWAI is designed with a modular architecture that allows different components to work together seamlessly while maintaining flexibility for creators.

This overview provides a high-level understanding of how the system is structured — and how it powers real-time logic inside CTZN.

## Core Components

The SWAI platform consists of four primary modules that work in harmony to create intelligent, adaptive agent systems:

<CardGroup cols={2}>
  <Card title="Cortex" icon="brain" href="/cortex/overview">
    The decision-making center that combines AI reasoning with state machines to create predictable yet intelligent behavior patterns.
  </Card>

  <Card title="Engram" icon="database" href="/engram/overview">
    The comprehensive memory system that manages short-term, long-term, and shared memory across agents and user experiences.
  </Card>

  <Card title="Synapse" icon="bolt" href="/synapse">
    The event processing system that enables real-time responses to on-chain behaviour, social inputs, and user interactions.
  </Card>

  <Card title="Kinesis" icon="gears" href="/kinesis">
    The action layer that executes skills and enables agents to interact with users, systems, and the world.
  </Card>
</CardGroup>

## How They Work Together

<img src="https://mintcdn.com/hideoutlabs/cbcidFJ3ucYStbSH/images/overview.png?fit=max&auto=format&n=cbcidFJ3ucYStbSH&q=85&s=fb60b6bb2a537bc1ebaff901be07a574" alt="SWAI Platform Overview" className="rounded-lg" width="1838" height="933" data-path="images/overview.png" />

The SWAI architecture follows an information flow that mimics human cognition:

1. **Perception** - Events and inputs are processed through Synapse
2. **Memory** - Information is stored and retrieved via Engram
3. **Decision** - The Cortex evaluates options and determines actions
4. **Action** - Kinesis executes the chosen actions in the environment

This cycle creates a continuous feedback loop that allows agents to learn, adapt, and evolve over time — which is core to how SWAI drives scoring and outcomes within CTZN.

## Design Philosophy

SWAI's architecture is built on three core principles:

<CardGroup cols={3}>
  <Card title="Modularity" icon="puzzle-piece">
    Components can be used independently or together, allowing for flexible implementation.
  </Card>

  <Card title="Scalability" icon="arrow-up-right-dots">
    The system is designed to handle everything from basic scoring logic to complex, multi-agent ecosystems.
  </Card>

  <Card title="Interoperability" icon="link">
    SWAI works with existing AI models, blockchain systems, and web services through standardized interfaces.
  </Card>
</CardGroup>

<Callout type="info">
  This modular approach means you can start with just the components you need and expand your implementation as your requirements grow.
</Callout>

In the following sections, we'll dive deeper into each component and provide practical examples of how they can be implemented in your projects.
