diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/agentkit-flow-guide.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/agentkit-flow-guide.md index 1671fd548b..e98e92c3d6 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/agentkit-flow-guide.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/agentkit-flow-guide.md @@ -9,7 +9,7 @@ sidebar_position: 2 AgentKit is an ecosystem-agnostic modular developer toolkit that lets you rapidly build, deploy, and iterate on AI agents using pre-configured environments and ready-to-use templates. -In this guide, you'll set up your own custom agent running on **Flow's EVM-compatible testnet**, powered by **Langchain** and **Anthropic's Claude** LLM. +In this guide, you'll set up your own custom agent that runs on **Flow's EVM-compatible testnet**, powered by **Langchain** and **Anthropic's Claude** LLM. --- @@ -38,27 +38,27 @@ Follow the interactive setup: ## Project Setup -Once your scaffold is ready: +When your scaffold is ready: ```bash cd onchain-agent npm install ``` -Now open the project in your preferred IDE (e.g. Cursor). +Now open the project in your preferred integrated development environment (IDE) (for example, [Cursor](../cursor/index.md). ### Environment Configuration -1. Create a `.env.local` file (or edit the one generated). +1. Create a `.env.local` file (or edit the one that you generated). 2. Add your API keys (we'll use **Anthropic** here). > You can also use OpenAI, DeepSeek, or any other supported LLM. ### Get Your Anthropic API Key -- Head to [Anthropic Console](https://console.anthropic.com/dashboard) -- Create an account and **purchase credits** -- Click **Create Key**, name it, and copy the API key +- Head to [Anthropic Console](https://console.anthropic.com/dashboard). +- Create an account and **purchase credits**. +- Click **Create Key**, name it, and copy the API key. - Add this to your `.env.local`: ```env @@ -67,11 +67,11 @@ ANTHROPIC_API_KEY=your_api_key_here ### Wallet Setup with MetaMask -1. Add [Flow Testnet](https://developers.flow.com/evm/using) to MetaMask -2. Use the [Faucet](https://faucet.flow.com/fund-account) to fund your wallet +1. Add [Flow Testnet](https://developers.flow.com/evm/using) to MetaMask. +2. Use the [Faucet](https://faucet.flow.com/fund-account) to fund your wallet. 3. Get your private key: - - Click the `...` menu in MetaMask > **Account Details** - - Enter your password, copy the private key + - Click the `...` menu in MetaMask > **Account Details**. + - Enter your password, copy the private key. 4. Add it to `.env.local`: ```env @@ -102,7 +102,7 @@ http://localhost:3000 ## Configure Your LLM -If your agent doesn't respond yet — no worries! You still need to configure your **LLM and client libraries**. +If your agent doesn't respond yet, no worries! You still need to configure your **LLM and client libraries**. ### Choose a Model @@ -210,13 +210,13 @@ Want to skip the setup? > [Fork the Flow AgentKit Starter](https://github.com/Aliserag/flow-agentkit-starter) -This starter includes all necessary config to start building immediately on Flow. +This starter includes all of the necessary configurations to start building immediately on Flow. --- ## Adding AgentKit to an Existing Project -Already have a project and want to add AgentKit? Follow these steps to integrate it into your existing codebase: +Already have a project and want to add AgentKit? Follow these steps to integrate it into your codebase: ### Install the Package diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/build-plugin.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/build-plugin.md index 699d2a72e3..cae3027067 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/build-plugin.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/build-plugin.md @@ -14,22 +14,24 @@ keywords: # Eliza Plugin Development Guide -Plugins are a powerful way to extend the functionality of your Eliza AI agents. This guide will walk you through the process of creating custom plugins that can enhance your agent's capabilities, from simple utilities to complex integrations with external services. You'll learn how to leverage the plugin system to create modular and reusable components for your AI agents. +## Overview + +Plugins are a powerful way to extend the functionality of your Eliza AI agents. This guide will walk you through the process of how to create custom plugins that can enhance your agent's capabilities, from simple utilities to complex integrations with external services. You'll learn how to leverage the plugin system to create modular and reusable components for your AI agents. ## Learning Objectives -By the end of this tutorial, you will be able to: +After you complete this tutorial, you will be able to: -- Create a new plugin repository from the template -- Understand the plugin development workflow -- Implement custom actions and services -- Integrate plugins with your Eliza agent -- Register and publish plugins to the Eliza Plugin Registry -- Use dependency injection for better plugin architecture +- Create a new plugin repository from the template. +- Understand the plugin development workflow. +- Implement custom actions and services. +- Integrate plugins with your Eliza agent. +- Register and publish plugins to the Eliza Plugin Registry. +- Use dependency injection for better plugin architecture. ## Prerequisites -Before getting started with Eliza, ensure you have: +Before you get started with Eliza, make sure you have: - [Node.js 23+] (using [nvm] is recommended) - [pnpm 9+] @@ -41,17 +43,21 @@ Before getting started with Eliza, ensure you have: ## Quickstart -Please follow the [Quickstart Guide] to set up your development environment. +Follow the [Quickstart Guide] to set up your development environment. ## Plugin Development ### Create a Plugin repository from Template -Visit [Eliza Plugin Template] and click on the "Use this template" button to create a new repository. +Visit [Eliza Plugin Template] and click "Use this template" to create a new repository. + +Or, you can create a new empty repository and copy the files from some examples at the [Eliza Plugins] organization. -Or you can create a new empty repository and copy the files from some examples at [Eliza Plugins] organization. +:::note -> Note: Flow's Eliza plugin template is using Dependency Injection(`@elizaos-plugins/plugin-di`), you can learn more about the Dependency Injection in the [plugin's README.md]. It allows you can use `Class` instead of `Object` for your `Actions`, `Providers`, `Services`, and etc. **If you don't want to use it, you can follow the other examples in Eliza Plugins organiazation.** +Flow's Eliza plugin template uses Dependency Injection(`@elizaos-plugins/plugin-di`). You can learn more about the Dependency Injection in the [plugin's README.md]. It allows you can use `Class` instead of `Object` for your `Actions`, `Providers`, `Services`, and so on. **If you don't want to use it, you can follow the other examples in Eliza Plugins organiazation.** + +::: ### Add the Plugin repository to your Eliza project @@ -77,7 +83,7 @@ Add the plugin to agent's `package.json` pnpm add @elizaos-plugins/plugin-foo@'workspace:*' --filter ./agent ``` -Check the `agent/package.json` to ensure the plugin is added, you should see something like this: +Check the `agent/package.json` to make sure the plugin is added. You'll see something like this: ```json { @@ -89,7 +95,7 @@ Check the `agent/package.json` to ensure the plugin is added, you should see som ### Build the Plugin -Build the plugin using the following command: +Build the plugin with the following command: ```bash pnpm build --filter ./packages/plugin-foo @@ -113,7 +119,7 @@ Let's say you want to add the plugin to the `sample` character which is `charact :::warning -If you are using Dependency Injection(`@elizaos-plugins/plugin-di`) in your plugin, remember to add it to the `postProcessors` field. And **`clients` field is deprecated** in the latest version of Eliza, so if you want to add clients you also need to use `plugins` field. +If you use Dependency Injection(`@elizaos-plugins/plugin-di`) in your plugin, remember to add it to the `postProcessors` field. And **`clients` field is deprecated** in the latest version of Eliza, so if you want to add clients, you also need to use `plugins` field. ::: @@ -155,7 +161,7 @@ pnpm start:client You need to register your plugin in the [Eliza Plugin Registry] to make it available for other users. -Please follow the guide there, modify the [index.json] and submit a PR to the registry repository. +Follow the guide there, modify the [index.json] file, and submit a pull request (PR) to the registry repository. ## Conclusion diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/index.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/index.md index a8dee47f6f..4e7bad6e39 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/index.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/index.md @@ -13,22 +13,24 @@ keywords: # Quickstart Guide to build AI Agent on Flow with Eliza -Eliza is a powerful framework for building AI agents that can interact with users through natural language. This tutorial will guide you through setting up and deploying an AI agent on the Flow blockchain using Eliza. You'll learn how to create intelligent agents that can understand and respond to user queries, while leveraging Flow's secure and scalable infrastructure. +## Overview + +Eliza is a powerful framework for building AI agents that can interact with users through natural language. This tutorial will guide you through how to set up and deploy an AI agent on the Flow blockchain with Eliza. You'll learn how to create intelligent agents that can understand and respond to user queries, while leveraging Flow's secure and scalable infrastructure. ## Learning Objectives -By the end of this tutorial, you will be able to: +After you complete this tutorial, you will be able to: -- Set up the Eliza development environment -- Configure and deploy an AI agent on Flow -- Create and customize character configurations -- Integrate different AI models with your agent -- Interact with your AI agent through a web interface -- Add and develop custom plugins for extended functionality +- Set up the Eliza development environment. +- Configure and deploy an AI agent on Flow. +- Create and customize character configurations. +- Integrate different AI models with your agent. +- Interact with your AI agent through a web interface. +- Add and develop custom plugins for extended functionality. ## Prerequisites -Before getting started with Eliza, ensure you have: +Before you get started started with Eliza, make sure you have: - [Node.js 23+] (using [nvm] is recommended) - [pnpm 9+] @@ -58,7 +60,7 @@ cd elizaOnFlow git checkout main ``` -Or, If you want to use the origin Eliza, please run: +Or, If you want to use the origin Eliza, run: ```bash # Eliza's characters folder is a submodule @@ -71,7 +73,7 @@ cd eliza git checkout $(git describe --tags --abbrev=0) ``` -If you already cloned without submodules, please run: +If you already cloned without submodules, run: ```bash # Fetch submodules @@ -86,11 +88,11 @@ pnpm install --no-frozen-lockfile :::warning -Please only use the `--no-frozen-lockfile` option when you're initially instantiating the repo or are bumping the version of a package or adding a new package to your package.json. This practice helps maintain consistency in your project's dependencies and prevents unintended changes to the lockfile. +Only use the `--no-frozen-lockfile` option when you're initially instantiating the repo or bump the version of a package or add a new package to your `package.json` file. This practice helps maintain consistency in your project's dependencies and prevents unintended changes to the lockfile. ::: -If you are using ElizaOnFlow, you need to install Flow Cadence contracts dependencies to ensure `*.cdc` be correctly linted by Cadence extension. +If you use ElizaOnFlow, you need to install Flow Cadence contracts dependencies to ensure that the Cadence extension correctly lints `*.cdc`. Install Flow Cadence contracts dependencies: @@ -106,7 +108,7 @@ pnpm build ## Configure Environment -Copy .env.example to .env and fill in the appropriate values. +Copy `.env.example` to `.env` and fill in the appropriate values. ```bash cp .env.example .env @@ -114,29 +116,29 @@ cp .env.example .env :::danger -In normal development, it's a best practice to use a `.env` to protect API keys and other sensitive information. When working with crypto, it's **critical** to be disciplined and always use them, even in test projects or tutorials. If you expose a wallet key, you might lose everything in that wallet immediately, or someone might watch it for years and rug you the day you put something valuable there. +In normal development, it's a best practice to use a `.env` to protect API keys and other sensitive information. When you work with crypto, it's **critical** to always use them, even in test projects or tutorials. If you expose a wallet key, you might lose everything in that wallet immediately, or someone might watch it for years and rob you the day you put something valuable there. ::: -Edit `.env` and add your values. Do NOT add this file to version control. +Edit `.env` and add your values. Do **NOT** add this file to version control. ### Choose Your Model Eliza supports multiple AI models and you set which model to use inside the character JSON file. -But remember, once you chosed a model, you need to set up the relevant configuration. +But remember, after you chosed a model, you need to set up the relevant configuration. -Check full list of supported LLMs in origin Eliza: [Models.ts] +Check the full list of supported LLMs in origin Eliza: [Models.ts] Suggested models: -- Use API to access LLM providers - - OpenAI: set modelProvider as `openai`, and set `OPENAI_API_KEY` in `.env` - - Deepseek: set modelProvider as `deepseek`, and set `DEEPSEEK_API_KEY` in `.env` - - Grok: set modelProvider as `grok`, and set `GROK_API_KEY` in `.env` +- Use API to access LLM providers: + - OpenAI: set modelProvider as `openai`, and set `OPENAI_API_KEY` in `.env`. + - Deepseek: set modelProvider as `deepseek`, and set `DEEPSEEK_API_KEY` in `.env`. + - Grok: set modelProvider as `grok`, and set `GROK_API_KEY` in `.env`. - Use local inference - - Ollama: set modelProvider as `ollama`, and set `OLLAMA_MODEL` in `.env` to the model name you are using in ollama. + - Ollama: set modelProvider as `ollama`, and set `OLLAMA_MODEL` in `.env` to the model name you use in ollama. -> To choose model, you need to set in charactor configuration. For example: OPENAI, please set `modelProvider: "openai"` in charactor JSON file or `modelProvider: ModelProviderName.OPENAI` in `charactor.ts` +> To choose a model, you need to set in charactor configuration. For example: OPENAI, set `modelProvider: "openai"` in charactor JSON file or `modelProvider: ModelProviderName.OPENAI` in `charactor.ts` ### Setup Agent's Flow Account @@ -146,9 +148,9 @@ Create a new Flow account for the Agent. Learn more: [doc] flow accounts create ``` -> If you are using Testnet, you can get free tokens from [Flow Faucet] +> If you use Testnet, you can get free tokens from [Flow Faucet] -Set Flow blockchain configuration in `.env` with new generated Flow account. +Set the Flow blockchain configuration in `.env` with a newly-generated Flow account. ```bash FLOW_ADDRESS= @@ -157,16 +159,16 @@ FLOW_NETWORK= # Default: mainnet FLOW_ENDPOINT_URL= # Default: ``` -For testnet, please check Flow's [Networks] for more information. +For testnet, check Flow's [Networks] for more information. ## Create Your First Agent ### Create a Character File -Check out the `deps/eliza/characters/` directory for a number of character files to try out. -Additionally you can override Eliza's `defaultCharacter` by editting `charactor.ts` which will be default used if no character json provided. +View the `deps/eliza/characters/` directory for a number of character files to try out. +Additionally, you can edit `charactor.ts` to override Eliza's `defaultCharacter` file, which is the default character file used if no character json files are provided. -Copy one of the example character files and make it your own +Copy one of the example character files and make it your own: ```bash cp characters/scooby.character.json characters/sample.character.json @@ -176,13 +178,13 @@ cp characters/scooby.character.json characters/sample.character.json ### **Start the Agent** -Inform it which character you want to run: +Tell it which character you want to run: ```bash pnpm start --character="characters/sample.character.json" ``` -Or you can use `pnpm start:debug` for more debugging logs: +Or, you can use `pnpm start:debug` for more debugging logs: ```bash pnpm start:debug --character="characters/sample.character.json" @@ -196,15 +198,15 @@ pnpm start --characters="characters/sample.character.json, characters/scooby.cha ### Add / Develop Plugins -run `npx elizaos plugins list` to get a list of available plugins or visit [Eliza Plugins Registry] +Run `npx elizaos plugins list` to get a list of available plugins or visit [Eliza Plugins Registry] -run `npx elizaos plugins add @elizaos-plugins/plugin-NAME` to install the plugin into your instance +Run `npx elizaos plugins add @elizaos-plugins/plugin-NAME` to install the plugin into your instance -To create a new plugin **for your own business**, you can refer to the [plugin development guide]. +To create a new plugin **for your own business**, refer to the [plugin development guide]. #### Additional Requirements -You may need to install Sharp. If you see an error when starting up, try installing it with the following command: +You may need to install Sharp. If you see an error when starting up, install it with the following command: ```bash pnpm install --include=optional sharp @@ -220,23 +222,23 @@ Open a new terminal window and run the client's http server. pnpm start:client ``` -Once the client is running, you'll see a message like this: +After the client is running, you'll see a message like this: ```bash ➜ Local: http://localhost:5173/ ``` -Simply click the link or open your browser to `http://localhost:5173/`. You'll see the chat interface connect to the system, and you can begin interacting with your character. +Click the link or open your browser to `http://localhost:5173/`. You'll see the chat interface connect to the system, and you can now interact with your character. ## Common Issues & Solutions -Please check the orgin Eliza's [Common Issues & Solutions] +Check the orgin Eliza's [Common Issues & Solutions] ## Conclusion In this tutorial, you've learned how to build and deploy an AI agent on the Flow blockchain using Eliza. You've gained hands-on experience with setting up the development environment, configuring agents, creating character configurations, integrating AI models, and developing custom plugins. -The Eliza framework provides a powerful way to create intelligent agents that can understand and respond to user queries while leveraging Flow's secure and scalable infrastructure. By completing this tutorial, you now have the foundation to build more sophisticated AI agents and create unique user experiences through character customization and plugin development. +The Eliza framework provides a powerful way to create intelligent agents that can understand and respond to user queries while leveraging Flow's secure and scalable infrastructure. Now taht you've completed this tutorial, you now have the foundation to build more sophisticated AI agents and create unique user experiences through character customization and plugin development. [Node.js 23+]: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm [nvm]: https://github.com/nvm-sh/nvm diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/index.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/index.md index 78f8363767..4662424ed2 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/index.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/index.md @@ -16,13 +16,15 @@ keywords: # AI Agents -AI agents represent the next evolution in blockchain interaction, combining artificial intelligence with blockchain capabilities to create autonomous systems that can execute complex tasks, interact with smart contracts, and automate workflows. This section explores how to build intelligent agents that leverage Flow's unique features to create powerful, self-directing blockchain applications. +## Overview -Unlike traditional chatbots or simple AI assistants, blockchain AI agents can autonomously execute transactions, manage digital assets, interact with DeFi protocols, and coordinate complex multi-step operations across the Flow ecosystem. These agents bridge the gap between AI decision-making and blockchain execution, enabling new forms of automated financial services, gaming mechanics, and decentralized applications. +AI agents represent the next evolution in blockchain interaction. They combine artificial intelligence with blockchain capabilities to create autonomous systems that can execute complex tasks, interact with smart contracts, and automate workflows. This section explores how to build intelligent agents that leverage Flow's unique features to create powerful, self-directing blockchain applications. + +Unlike traditional chatbots or simple AI assistants, blockchain AI agents can autonomously execute transactions, manage digital assets, interact with DeFi protocols, and coordinate complex multi-step operations across the Flow ecosystem. These agents bridge the gap between AI decision-making and blockchain execution, which allows new forms of automated financial services, gaming mechanics, and decentralized applications. ## [Eliza on Flow] -Learn how to build conversational AI agents on Flow using Eliza, a framework for creating intelligent agents that interact through natural language. Set up agents with customizable personalities, integrate multiple AI models, and connect to Flow's blockchain infrastructure. +Learn how to build conversational AI agents on Flow using [Eliza](../agents/eliza/index.md), a framework for creating intelligent agents that interact through natural language. Set up agents with customizable personalities, integrate multiple AI models, and connect to Flow's blockchain infrastructure. ### [Eliza Plugin Development Guide] @@ -34,7 +36,7 @@ Create autonomous AI agents that interact with Flow's blockchain using AgentKit. ## Key Benefits of AI Agents on Flow -**Autonomous Execution**: Agents can independently execute complex blockchain operations without human intervention, from simple token transfers to sophisticated DeFi strategies. +**Autonomous Execution**: Agents can independently execute complex blockchain operations without human intervention, from simple token transfers to sophisticated decentralized finance (DeFi) strategies. **Flow-Native Integration**: Leverage Flow's unique multi-role architecture, built-in randomness, and efficient transaction processing for enhanced agent capabilities. @@ -48,11 +50,11 @@ Create autonomous AI agents that interact with Flow's blockchain using AgentKit. **Conversational Interfaces**: Build Eliza-powered agents that can provide natural language interfaces to Flow applications, helping users navigate complex DeFi protocols or gaming mechanics through conversation. -**Automated Trading**: Build agents that can analyze market conditions, execute trades, and manage portfolios across Flow's DeFi ecosystem while communicating decisions to users. +**Automated Trading**: Build agents that can analyze market conditions, execute trades, manage portfolios across Flow's DeFi ecosystem, and communicate decisions to users. **Gaming Automation**: Create intelligent NPCs or automated players that can interact with Flow-based games, manage in-game assets, and execute complex game mechanics with personality-driven responses. -**Portfolio Management**: Develop agents that can automatically rebalance portfolios, compound yields, and optimize asset allocation based on market conditions while providing conversational feedback. +**Portfolio Management**: Develop agents that can automatically rebalance portfolios, compound yields, optimize asset allocation based on market conditions, and provide conversational feedback. **Protocol Automation**: Build agents that can interact with complex DeFi protocols, execute arbitrage opportunities, and manage liquidity positions with intelligent decision-making capabilities. @@ -60,7 +62,7 @@ Create autonomous AI agents that interact with Flow's blockchain using AgentKit. ## Conclusion -AI agents combine artificial intelligence with blockchain capabilities to create autonomous systems on Flow. Whether building conversational agents with Eliza or autonomous systems with AgentKit, these tutorials provide the foundation for creating intelligent blockchain applications that can execute transactions, engage users, and automate complex workflows across the Flow ecosystem. +AI agents combine artificial intelligence with blockchain capabilities to create autonomous systems on Flow. Whether you want to build conversational agents with Eliza or autonomous systems with AgentKit, these tutorials provide the foundation for you to create intelligent blockchain applications that can execute transactions, engage users, and automate complex workflows across the Flow ecosystem.