> For the complete documentation index, see [llms.txt](https://collabrachain.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://collabrachain.gitbook.io/docs/tech-stack/xmtp-and-ai-agent.md).

# XMTP & AI Agent

The communication and intelligence layers work together to create the intuitive, chat-based user experience that defines CollabraChain. This combination transforms a simple messaging app into a powerful interface for controlling on-chain actions.

#### **The Role of XMTP**

XMTP (Extensible Message Transport Protocol) provides the fundamental communication channel. We chose XMTP for several key reasons:

* **End-to-End Encryption:** All messages, including project negotiations and file links, are private and secure.
* **Wallet-Based Identity:** Users are identified by their wallet addresses, providing a secure and web3-native identity layer without relying on phone numbers or emails.
* **Decentralization & Portability:** The network is decentralized, and users own their communication history, which they can take to any XMTP-compatible client.
* **Programmability:** Messages are not just text; they are structured data that our AI agent can listen for and react to.

#### **The Role of the Coinbase AgentKit AI**

The AI Agent, built with Coinbase AgentKit, is the intelligent engine that lives inside the XMTP chat. It acts as the bridge between human language and blockchain transactions.

1. **Listens for Commands:** The agent is invited into the project group chat and listens for specific commands directed at it (e.g., `@agent create project...`).
2. **Parses Natural Language:** It uses Natural Language Processing (NLP) to understand the user's intent, extracting key details like milestone descriptions, budgets, and approval confirmations.
3. **Executes On-Chain Transactions:** After parsing a valid command, the agent securely constructs and sends a transaction to our smart contracts on Base. It manages its own wallet and gas fees to perform these actions on behalf of the users.
4. **Provides Feedback:** After the transaction is confirmed on-chain, the agent posts a confirmation message back into the chat, closing the loop and informing the users of the result.

This workflow makes interacting with a complex smart contract system as easy as talking to a project manager. To see the agent's implementation, visit the [XMTP (AI Agent) repository](https://github.com/CollabraChain/xmtp).
