> For the complete documentation index, see [llms.txt](https://theswarm.slamai.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://theswarm.slamai.xyz/features/system-architecture.md).

# System Architecture

The SWARM is an advanced system that utilizes SLAMai, a modular AI-powered infrastructure integrating LangGraph, ReAct agents, and custom AI models to process and enrich blockchain-related queries. This architecture enables structured, validated, and enriched responses by combining AI with blockchain-specific agents, ensuring high-quality insights and interactions.

System Architecture

<div><figure><img src="/files/SG68k0jKfSeKqWcw7Kr3" alt=""><figcaption></figcaption></figure> <figure><img src="/files/hWi3Kq8bZNdgrlKyPUDi" alt=""><figcaption></figcaption></figure> <figure><img src="/files/rGMqzVVhSM7af1CzVeNN" alt=""><figcaption></figcaption></figure></div>

The SWARM operates on a robust AI-driven framework divided into two key components:

1. LangGraph-Based Processing – Manages prompt enrichment, validation, and agent-based query resolution.
2. User Flow – Defines how users interact with The SWARM via terminal access or AI-driven agents.

**LangGraph-Based Processing**

LangGraph serves as the core framework that structures The SWARM's AI workflows. When a user submits a query, it is processed through multiple layers before producing a final, refined response:

* Supervisor Node – The central controller that manages interactions with multiple ReAct agents.
* ReAct Agents – Specialized AI components that process data based on different data domains:
* * CryptoSlam NFT Agent: Handles NFT-related queries, providing insights on ownership, transactions, and market trends.
  * EVM Agent: Focuses on Ethereum-based smart contract interactions, transactions, and event decoding.
  * Other Agents: Additional AI agents can be introduced to extend functionality.
* Prompt Enricher – Enhances the original user prompt by incorporating relevant data from ReAct agents.
* Validation Step – Ensures the prompt is correctly formatted and contains sufficient information before execution.
* Response Generation – After validation, the system finalizes the enriched query and prepares it for output.

**User Flow**

The SWARM is designed for an intuitive and efficient user experience:

1. A user submits a blockchain-related query through an application utilizing The SWARM.
2. The request is forwarded to the SLAMai API, which acts as the intermediary between the front-end and backend processing.
3. The LangGraph API processes the request, leveraging:
   * A fine-tuned AI model optimized for blockchain-specific inquiries.
   * The capability for engineers to define and integrate custom AI models, requiring authentication.
4. The processed response is then returned to the user.

**Customization and Extensibility**

The SWARM is designed with flexibility in mind, allowing for the following customizations:

* Fine-tuned Models: Utilizing pre-trained AI models optimized for blockchain analysis and queries.
* Custom AI Models: Engineers can introduce proprietary AI models by passing them as parameters, enabling further customization.
* Modular Agents: The architecture supports the integration of additional ReAct agents to expand functionality for new blockchain ecosystems and data sources.

By leveraging SlamAI, The SWARM ensures that blockchain-related queries are processed with accuracy, efficiency, and adaptability, making it a powerful tool for blockchain intelligence and data-driven decision-making.
