Overview
The brain of SWAI agents
Cortex is where all decisions are made — including scoring, reactions, and outcomes inside CTZN — based on signals coming from Synapse.
It functions as the brain of SWAI agents, processing information through a state machine that maintains predictable behavior while allowing for natural responses.
At its core, Cortex uses chain of thought reasoning to break down complex problems into manageable steps.
This approach helps agents make decisions that feel well-considered and human-like.
When Cortex receives an event, it analyzes the incoming information, retrieves relevant context from memory, applies deliberative reasoning to evaluate options, integrates behavioural modifiers based on personality traits, and finally selects the most appropriate action.
This structured approach allows agents to respond thoughtfully to various situations while maintaining consistency in their behavior.
By evaluating outcomes and storing results for future reference, Cortex continuously adapts its responses to be more effective.
SWAI agents can seamlessly switch between different model providers based on specific requirements, performance considerations, or availability, without disrupting the core reasoning architecture.
Core architecture
Built on Stately.ai, Cortex combines AI creativity with state machine reliability to create predictable yet natural interactions.
LLM reasoning
Reasoning models like DeepSeek power chain-of-thought reasoning and real-time decision-making in live systems like CTZN
State machines
Predictable workflows that maintain natural interactions
Web3 integration
On-chain personality and state traits stored using Metaplex Core — powering dynamic, verifiable agent logic within CTZN
Event processing
Multi-source input handling for context-aware decisions
Architecture details
Explore the detailed architecture of Cortex, including state diagrams, reasoning processes, and practical examples of how agents make decisions.
Decision making process
Input gathering
- Personality traits (stored on-chain)
- Event streams from Synapse
- Background story elements
- Current state context
State evaluation
- Current agent status
- Available actions
- Transition conditions
LLM reasoning
- Understand context
- Generate responses
- Make decisions
Action execution
- Validated against state rules
- Executed in sequence
- Logged for verification
Model providers
Cortex is designed to work with multiple AI model providers, allowing for flexibility in choosing the right model for specific agent needs.
This provider-agnostic approach enables SWAI to leverage the unique strengths of different models while maintaining consistent reasoning patterns and decision-making capabilities.
Through together.ai infrastructure, we can train and deploy custom AI models specifically tailored to unique agent requirements and specialized use-cases, enhancing performance for domain-specific tasks.