You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/agentkit-flow-guide.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ sidebar_position: 2
9
9
10
10
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.
11
11
12
-
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.
12
+
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.
13
13
14
14
---
15
15
@@ -38,27 +38,27 @@ Follow the interactive setup:
38
38
39
39
## Project Setup
40
40
41
-
Once your scaffold is ready:
41
+
When your scaffold is ready:
42
42
43
43
```bash
44
44
cd onchain-agent
45
45
npm install
46
46
```
47
47
48
-
Now open the project in your preferred IDE (e.g. Cursor).
48
+
Now open the project in your preferred integrated development environment (IDE) (for example, [Cursor](../cursor/index.md).
49
49
50
50
### Environment Configuration
51
51
52
-
1. Create a `.env.local` file (or edit the one generated).
52
+
1. Create a `.env.local` file (or edit the one that you generated).
53
53
2. Add your API keys (we'll use **Anthropic** here).
54
54
55
55
> You can also use OpenAI, DeepSeek, or any other supported LLM.
56
56
57
57
### Get Your Anthropic API Key
58
58
59
-
- Head to [Anthropic Console](https://console.anthropic.com/dashboard)
60
-
- Create an account and **purchase credits**
61
-
- Click **Create Key**, name it, and copy the API key
59
+
- Head to [Anthropic Console](https://console.anthropic.com/dashboard).
60
+
- Create an account and **purchase credits**.
61
+
- Click **Create Key**, name it, and copy the API key.
Copy file name to clipboardExpand all lines: docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/build-plugin.md
+23-17Lines changed: 23 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,22 +14,24 @@ keywords:
14
14
15
15
# Eliza Plugin Development Guide
16
16
17
-
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.
17
+
## Overview
18
+
19
+
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.
18
20
19
21
## Learning Objectives
20
22
21
-
By the end of this tutorial, you will be able to:
23
+
After you complete this tutorial, you will be able to:
22
24
23
-
- Create a new plugin repository from the template
24
-
- Understand the plugin development workflow
25
-
- Implement custom actions and services
26
-
- Integrate plugins with your Eliza agent
27
-
- Register and publish plugins to the Eliza Plugin Registry
28
-
- Use dependency injection for better plugin architecture
25
+
- Create a new plugin repository from the template.
26
+
- Understand the plugin development workflow.
27
+
- Implement custom actions and services.
28
+
- Integrate plugins with your Eliza agent.
29
+
- Register and publish plugins to the Eliza Plugin Registry.
30
+
- Use dependency injection for better plugin architecture.
29
31
30
32
## Prerequisites
31
33
32
-
Before getting started with Eliza, ensure you have:
34
+
Before you get started with Eliza, make sure you have:
33
35
34
36
-[Node.js 23+] (using [nvm] is recommended)
35
37
-[pnpm 9+]
@@ -41,17 +43,21 @@ Before getting started with Eliza, ensure you have:
41
43
42
44
## Quickstart
43
45
44
-
Please follow the [Quickstart Guide] to set up your development environment.
46
+
Follow the [Quickstart Guide] to set up your development environment.
45
47
46
48
## Plugin Development
47
49
48
50
### Create a Plugin repository from Template
49
51
50
-
Visit [Eliza Plugin Template] and click on the "Use this template" button to create a new repository.
52
+
Visit [Eliza Plugin Template] and click "Use this template" to create a new repository.
53
+
54
+
Or, you can create a new empty repository and copy the files from some examples at the [Eliza Plugins] organization.
51
55
52
-
Or you can create a new empty repository and copy the files from some examples at [Eliza Plugins] organization.
56
+
:::note
53
57
54
-
> 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.**
58
+
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.**
59
+
60
+
:::
55
61
56
62
### Add the Plugin repository to your Eliza project
57
63
@@ -77,7 +83,7 @@ Add the plugin to agent's `package.json`
Check the `agent/package.json` to ensure the plugin is added, you should see something like this:
86
+
Check the `agent/package.json` to make sure the plugin is added. You'll see something like this:
81
87
82
88
```json
83
89
{
@@ -89,7 +95,7 @@ Check the `agent/package.json` to ensure the plugin is added, you should see som
89
95
90
96
### Build the Plugin
91
97
92
-
Build the plugin using the following command:
98
+
Build the plugin with the following command:
93
99
94
100
```bash
95
101
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
113
119
114
120
:::warning
115
121
116
-
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.
122
+
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.
117
123
118
124
:::
119
125
@@ -155,7 +161,7 @@ pnpm start:client
155
161
156
162
You need to register your plugin in the [Eliza Plugin Registry] to make it available for other users.
157
163
158
-
Please follow the guide there, modify the [index.json] and submit a PR to the registry repository.
164
+
Follow the guide there, modify the [index.json]file, and submit a pull request (PR) to the registry repository.
Copy file name to clipboardExpand all lines: docs/blockchain-development-tutorials/use-AI-to-build-on-flow/agents/eliza/index.md
+42-40Lines changed: 42 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,22 +13,24 @@ keywords:
13
13
14
14
# Quickstart Guide to build AI Agent on Flow with Eliza
15
15
16
-
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.
16
+
## Overview
17
+
18
+
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.
17
19
18
20
## Learning Objectives
19
21
20
-
By the end of this tutorial, you will be able to:
22
+
After you complete this tutorial, you will be able to:
21
23
22
-
- Set up the Eliza development environment
23
-
- Configure and deploy an AI agent on Flow
24
-
- Create and customize character configurations
25
-
- Integrate different AI models with your agent
26
-
- Interact with your AI agent through a web interface
27
-
- Add and develop custom plugins for extended functionality
24
+
- Set up the Eliza development environment.
25
+
- Configure and deploy an AI agent on Flow.
26
+
- Create and customize character configurations.
27
+
- Integrate different AI models with your agent.
28
+
- Interact with your AI agent through a web interface.
29
+
- Add and develop custom plugins for extended functionality.
28
30
29
31
## Prerequisites
30
32
31
-
Before getting started with Eliza, ensure you have:
33
+
Before you get started started with Eliza, make sure you have:
32
34
33
35
-[Node.js 23+] (using [nvm] is recommended)
34
36
-[pnpm 9+]
@@ -58,7 +60,7 @@ cd elizaOnFlow
58
60
git checkout main
59
61
```
60
62
61
-
Or, If you want to use the origin Eliza, please run:
63
+
Or, If you want to use the origin Eliza, run:
62
64
63
65
```bash
64
66
# Eliza's characters folder is a submodule
@@ -71,7 +73,7 @@ cd eliza
71
73
git checkout $(git describe --tags --abbrev=0)
72
74
```
73
75
74
-
If you already cloned without submodules, please run:
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.
91
+
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.
90
92
91
93
:::
92
94
93
-
If you are using ElizaOnFlow, you need to install Flow Cadence contracts dependencies to ensure `*.cdc` be correctly linted by Cadence extension.
95
+
If you use ElizaOnFlow, you need to install Flow Cadence contracts dependencies to ensure that the Cadence extension correctly lints `*.cdc`.
94
96
95
97
Install Flow Cadence contracts dependencies:
96
98
@@ -106,37 +108,37 @@ pnpm build
106
108
107
109
## Configure Environment
108
110
109
-
Copy .env.example to .env and fill in the appropriate values.
111
+
Copy `.env.example` to `.env` and fill in the appropriate values.
110
112
111
113
```bash
112
114
cp .env.example .env
113
115
```
114
116
115
117
:::danger
116
118
117
-
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.
119
+
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.
118
120
119
121
:::
120
122
121
-
Edit `.env` and add your values. Do NOT add this file to version control.
123
+
Edit `.env` and add your values. Do **NOT** add this file to version control.
122
124
123
125
### Choose Your Model
124
126
125
127
Eliza supports multiple AI models and you set which model to use inside the character JSON file.
126
-
But remember, once you chosed a model, you need to set up the relevant configuration.
128
+
But remember, after you chosed a model, you need to set up the relevant configuration.
127
129
128
-
Check full list of supported LLMs in origin Eliza: [Models.ts]
130
+
Check the full list of supported LLMs in origin Eliza: [Models.ts]
129
131
130
132
Suggested models:
131
133
132
-
- Use API to access LLM providers
133
-
- OpenAI: set modelProvider as `openai`, and set `OPENAI_API_KEY` in `.env`
134
-
- Deepseek: set modelProvider as `deepseek`, and set `DEEPSEEK_API_KEY` in `.env`
135
-
- Grok: set modelProvider as `grok`, and set `GROK_API_KEY` in `.env`
134
+
- Use API to access LLM providers:
135
+
- OpenAI: set modelProvider as `openai`, and set `OPENAI_API_KEY` in `.env`.
136
+
- Deepseek: set modelProvider as `deepseek`, and set `DEEPSEEK_API_KEY` in `.env`.
137
+
- Grok: set modelProvider as `grok`, and set `GROK_API_KEY` in `.env`.
136
138
- Use local inference
137
-
- Ollama: set modelProvider as `ollama`, and set `OLLAMA_MODEL` in `.env` to the model name you are using in ollama.
139
+
- Ollama: set modelProvider as `ollama`, and set `OLLAMA_MODEL` in `.env` to the model name you use in ollama.
138
140
139
-
> 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`
141
+
> 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`
140
142
141
143
### Setup Agent's Flow Account
142
144
@@ -146,9 +148,9 @@ Create a new Flow account for the Agent. Learn more: [doc]
146
148
flow accounts create
147
149
```
148
150
149
-
> If you are using Testnet, you can get free tokens from [Flow Faucet]
151
+
> If you use Testnet, you can get free tokens from [Flow Faucet]
150
152
151
-
Set Flow blockchain configuration in `.env` with new generated Flow account.
153
+
Set the Flow blockchain configuration in `.env` with a newly-generated Flow account.
For testnet, please check Flow's [Networks] for more information.
162
+
For testnet, check Flow's [Networks] for more information.
161
163
162
164
## Create Your First Agent
163
165
164
166
### Create a Character File
165
167
166
-
Check out the `deps/eliza/characters/` directory for a number of character files to try out.
167
-
Additionally you can override Eliza's `defaultCharacter`by editting `charactor.ts`which will be default used if no character json provided.
168
+
View the `deps/eliza/characters/` directory for a number of character files to try out.
169
+
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.
168
170
169
-
Copy one of the example character files and make it your own
171
+
Copy one of the example character files and make it your own:
run`npx elizaos plugins list` to get a list of available plugins or visit [Eliza Plugins Registry]
201
+
Run`npx elizaos plugins list` to get a list of available plugins or visit [Eliza Plugins Registry]
200
202
201
-
run`npx elizaos plugins add @elizaos-plugins/plugin-NAME` to install the plugin into your instance
203
+
Run`npx elizaos plugins add @elizaos-plugins/plugin-NAME` to install the plugin into your instance
202
204
203
-
To create a new plugin **for your own business**, you can refer to the [plugin development guide].
205
+
To create a new plugin **for your own business**, refer to the [plugin development guide].
204
206
205
207
#### Additional Requirements
206
208
207
-
You may need to install Sharp. If you see an error when starting up, try installing it with the following command:
209
+
You may need to install Sharp. If you see an error when starting up, install it with the following command:
208
210
209
211
```bash
210
212
pnpm install --include=optional sharp
@@ -220,23 +222,23 @@ Open a new terminal window and run the client's http server.
220
222
pnpm start:client
221
223
```
222
224
223
-
Once the client is running, you'll see a message like this:
225
+
After the client is running, you'll see a message like this:
224
226
225
227
```bash
226
228
➜ Local: http://localhost:5173/
227
229
```
228
230
229
-
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.
231
+
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.
230
232
231
233
## Common Issues & Solutions
232
234
233
-
Please check the orgin Eliza's [Common Issues & Solutions]
235
+
Check the orgin Eliza's [Common Issues & Solutions]
234
236
235
237
## Conclusion
236
238
237
239
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.
238
240
239
-
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.
241
+
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.
0 commit comments