> ## 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.

# SWAI Synapse

> Real-time event processing system

Think of how your eyes and ears help you notice things around you. That's what **Synapse** does for SWAI agents - it helps them see and hear what's happening.

**Synapse** is like the agent's nervous system, keeping it alert and ready to respond to whatever happens nearby.

**Synapse** receives input from the external environment — including user actions, on-chain data, and off-chain signals — and routes it to Cortex for analysis and decision-making.

This process is core to real-time responsiveness within CTZN.

The cool thing about **Synapse** is that it uses a simple, consistent way to handle information. This means it can connect to all kinds of different systems as long as they speak the same language.

<Note>
  **Synapse** connects directly with Cortex (the decision-making module) to process information and determine appropriate responses in real-time.
</Note>

## Signal processing

<Steps>
  <Step title="Signal detection">
    Continuously monitors and captures incoming signals from various sources
  </Step>

  <Step title="Priority assessment">
    Evaluates signal importance based on setup instructions and current agent state
  </Step>

  <Step title="Queue management">
    Organizes signals into priority queues for efficient processing and to prevent system overload during high-volume periods
  </Step>

  <Step title="Signal transmission">
    Forwards prioritized signals to Cortex for decision-making and reasoning
  </Step>
</Steps>

## Signal sources

**Synapse**'s flexible architecture allows for endless integration possibilities.

From social platforms to blockchain networks, any system that generates events can be connected to your SWAI agent.

<AccordionGroup>
  <Accordion title="Social interactions" icon="comments">
    Monitors engagement across platforms:

    * Replies and mentions
    * Likes and reactions
    * Shares and retweets
    * Direct messages
  </Accordion>

  <Accordion title="On-chain activity" icon="cube">
    Tracks blockchain events:

    * Token transfers
    * NFT sales and mints
    * Smart contract interactions
    * Governance proposals
  </Accordion>

  <Accordion title="External systems" icon="plug">
    Integrates with various platforms:

    * E-commerce transactions
    * Payment systems
    * Content management
    * Analytics platforms
  </Accordion>
</AccordionGroup>

## Signal format

All events in **Synapse** are standardized into signals with this structure:

```typescript theme={null}
interface Signal {
    timestamp: number;    // When the event occurred
    description: string;  // Human-readable event description
    priority: number;     // Importance level (1-5)
    labels: string[];     // Event categories
    metadata: object;     // Additional context
}
```

<Warning>
  All signals must follow this format to ensure consistent processing across the system.
</Warning>

#### Queue Management

Events are processed according to their priority level:

<AccordionGroup>
  <Accordion title="High Priority" icon="bolt">
    Direct questions and critical alerts receive immediate attention
  </Accordion>

  <Accordion title="Medium Priority" icon="clock">
    Standard interactions are processed in order of arrival
  </Accordion>

  <Accordion title="Low Priority" icon="arrow-down">
    Routine updates are handled when resources are available
  </Accordion>
</AccordionGroup>

This prioritization maintains consistency in agent behavior and ensures a coherent experience throughout interactions.
