> For the complete documentation index, see [llms.txt](https://asynchronus.gitbook.io/asynchronus-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asynchronus.gitbook.io/asynchronus-docs/building-with-graph-developer-guide.md).

# Building with Graph (Developer Guide)

Welcome, builders! This guide is your entry point to **Graph**, the Asynchronus Agent Development Framework. If you're looking to create intelligent, autonomous agents that can navigate and operate within the Web3 world, you're in the right place.

### Introduction to Graph

**Why We Built Graph:** The vision of an Agentic Web3 Economy requires a diverse and powerful ecosystem of agents. We needed a framework that would:

1. **Simplify Development:** Abstract away complexities, allowing developers to focus on agent logic and capabilities.
2. **Ensure Composability:** Enable agents to discover, communicate, and collaborate seamlessly.
3. **Promote Intelligence:** Natively integrate AI and large language models (LLMs) into the agent core.
4. **Guarantee Security & Modularity:** Provide a robust structure for building and deploying reliable agents.

**What is Graph?** Graph is a **LangChain-based Typescript framework**.

* **LangChain Base:** By building on LangChain, we leverage a powerful, industry-standard library for developing applications powered by language models. This provides a rich set of tools for prompts, chains, memory, and, most importantly, agentic architectures.
* **Typescript:** We chose Typescript for its strong typing, which is essential for building complex, reliable systems, and its widespread adoption within the Web3 and modern development communities.

Graph provides the structure, templates, and toolkits you need to design, build, test, and deploy agents capable of interacting with blockchains, DeFi protocols, off-chain data, and other Asynchronus agents.

### Agent Modularity & Tools

The real power of Graph agents comes from their **tools**. Tools are modular components that give agents specific capabilities – their "senses" and "hands" in the Web3 world.

* **Using Pre-built Tools:** Graph aims to provide a library of common tools:
  * **Web3 RPCs:** Interact with blockchains (e.g., `getBalance`, `sendTransaction` via Alchemy/Infura).
  * **DeFi Protocols:** Specific wrappers for Aave (`lend`, `borrow`), Uniswap (`swap`, `checkPrice`), Curve, etc.
  * **Data Oracles:** Access price feeds or off-chain data.
* **Creating Custom Tools:** You can easily build your own tools by extending the `BaseTool` class, defining its input/output, and implementing its execution logic.
* **Model Context Protocols (MCPs):** These are a special class of tools designed to interface with sophisticated AI models or curated data sources, enabling higher-level reasoning and intelligence.

Agents become powerful by *composing* these tools. An arbitrage agent might combine multiple DEX tools with a Web3 RPC tool and an MCP for market analysis.

### Multi-Agent Simulation & Testing

Before deploying agents that might handle real assets, rigorous testing is essential. Graph provides a **simulation environment** to test how your agents behave and interact.

* **Local Testing:** Use standard Typescript testing frameworks (like Jest or Vitest) to unit-test your tools and agent logic.
* **Simulation CLI:** Use the Graph CLI to run multi-agent scenarios:Bash

  ```
  graph simulate --scenario scenarios/my_test.json
  ```
* **Scenario Definition:** Define scenarios in a configuration file, specifying:
  * Which agents participate.
  * Their initial state and configurations.
  * The tasks or prompts they receive.
  * Expected outcomes or conditions to monitor.

This allows you to observe communication, coordination, and potential failure points in a safe, controlled environment.

### Deploying Agents

Once your agent is built and tested, you can deploy it to make it discoverable and usable within the Asynchronus network.

1. **Configure `graph.config.ts`:** Define your agent's metadata, required permissions, and deployment settings (e.g., public/private, hosting).
2. **Run Deploy Command:**&#x42;ash

   ```
   graph deploy --network mainnet # or testnet
   ```
3. **Registration:** The deployment process will package your agent, potentially deploy it to a decentralized hosting solution (like IPFS) or a secure execution environment, and crucially, **register its capabilities** in the **Asynchronus Agent Registry**.

This registration makes your agent visible to Shell and other agents, allowing it to be included in complex workflows. You can choose to deploy agents for private use or list them publicly in the upcoming **Open Agent Marketplace**.

### Contributing to Graph

Asynchronus and Graph are built to be an open and collaborative ecosystem. We welcome contributions from the community!

* **Report Bugs:** Find issues? Let us know via the GitHub Issues tab on our repository: `https://github.com/Asynchronus-ai/`.
* **Suggest Features:** Have ideas for new tools, framework enhancements, or agent types? Start a discussion.
* **Submit Code:** Fork the repository, make your improvements, and submit a Pull Request. Please follow our contribution guidelines regarding code style and testing.
* **Build Public Tools:** Create useful tools and share them with the community.

Together, we can build the foundational infrastructure for the Agentic Web3 Economy.

***

This developer guide provides a roadmap for building with Graph. As we approach the release (June 2025), this documentation will be expanded with detailed API references, tutorials, and more code examples. Happy building!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://asynchronus.gitbook.io/asynchronus-docs/building-with-graph-developer-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
