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/litepaper.md
+20-43Lines changed: 20 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,17 @@ sidebar_position: 2
4
4
5
5
# GaiaNet: GenAI Agent Network
6
6
7
+
## Abstract
7
8
8
9
Specialized, finetuned and RAG-enhanced open-source Large Language Models are key elements in emerging AI agent applications. However, those agent apps also present unique challenges to the traditional cloud computing and SaaS infrastructure, including new requirements for application portability, virtualization, security isolation, costs, data privacy, and ownership.
9
10
10
-
GaiaNet is a decentralized computing infrastructure that enables everyone to create, deploy, scale, and monetize their own AI agents that reflect their styles, values, knowledge, and expertise. A GaiaNet node consists of a high-performance and cross-platform application runtime, a finetuned LLM, a knowledge embedding model, a vector database, a prompt manager, and a plugin system for calling external tools and functions using LLM outputs. It can be deployed by any knowledge worker as a digital twin for work. Similar GaiaNet nodes are organized into GaiaNet domains, which offer trusted and reliable AI agent services to the public. The GaiaNet node and domains are governed by the GaiaNet DAO. Through Purpose Bound Money smart contracts, the GaiaNet network is a decentralized marketplace for AI agent services.
11
-
11
+
GaiaNet is a decentralized computing infrastructure that enables everyone to create, deploy, scale, and monetize their own AI agents that reflect their styles, values, knowledge, and expertise. A GaiaNet node consists of a high-performance and cross-platform application runtime, a finetuned LLM, a knowledge embedding model, a vector database, a prompt manager, an open API server, and a plugin system for calling external tools and functions using LLM outputs. It can be deployed by any knowledge worker as a digital twin and offered as a web API service. A new class of tradeable assets and a marketplace could be created from individualized knowledge bases and components. Similar GaiaNet nodes are organized into GaiaNet domains, which offer trusted and reliable AI agent services to the public. The GaiaNet node and domains are governed by the GaiaNet DAO (Decentralized Autonomous Organization). Through Purpose Bound Money smart contracts, the GaiaNet network is a decentralized marketplace for AI agent services.
12
12
13
13
## Introduction
14
14
15
15
The emergence of ChatGPT and Large Language Model (LLM) has revolutionized how humans produce and consume knowledge. Within a year, AI-native applications have evolved from chatbots to copilots, to agents.
16
16
17
-
18
-
>AI agents would increasingly evolve from supportive tools (akin to Copilots) to autonomous entities capable of completing tasks independently. — Dr. Andrew Ng at Sequoia Capital AI Ascent 2024 Summit
19
-
17
+
> AI agents would increasingly evolve from supportive tools (akin to Copilots) to autonomous entities capable of completing tasks independently. — Dr. Andrew Ng at Sequoia Capital AI Ascent 2024 Summit
20
18
21
19
Agents are software applications that can complete tasks on its own autonomously like a human. The agent can understand the task, plan the steps to complete the task, execute all the steps, handle errors and exceptions, and deliver the results. While a powerful LLM could act as the “brain” for the agent, we need to connect to external data sources (eyes and ears), domain-specific knowledge base and prompts (skills), context stores (memory), and external tools (hands). For agent tasks, we often need to customize the LLM itself
22
20
@@ -38,10 +36,7 @@ Goal #1: Empower individuals to incorporate his/her private knowledge and expert
38
36
39
37
Goal #2: Enable individuals to provide and scale their LLM agents as services, and get compensated for their expertise and work.
40
38
41
-
42
-
>GaiaNet is “YouTube for knowledge and skills.”
43
-
44
-
39
+
> GaiaNet is “YouTube for knowledge and skills.”
45
40
46
41
## Open-source and decentralization
47
42
@@ -57,7 +52,6 @@ Furthermore, LLM agents have entirely different scaling characteristics than pas
57
52
58
53
The GaiaNet project provides a cross-platform and highly efficient SDK and runtime for finetuned open-source LLMs with proprietary knowledge bases, customized prompts, structured responses, and external tools for function calling. A GaiaNet node can be started in minutes on any personal, cloud, or edge device. It can then offer services through an incentivized web3 network.
59
54
60
-
61
55
## GaiaNet node
62
56
63
57
The basic operational unit in the GaiaNet network is a node. A GaiaNet node is a streamlined software stack that allows any technically competent person to run an AI agent of his own. The software stack on the GaiaNet node consists of the following 7 key components.
@@ -84,9 +78,8 @@ Furthermore, effective prompts could be highly dependent on the model in use. A
84
78
85
79
The GaiaNet node can support several different prompts that are dynamically chosen and used in applications. For example,
86
80
87
-
* The system_prompt is a general introduction to the agent task the node is supposed to perform. It often contains a persona to help the LLM respond with the right tone. For example, the system_prompt for a college teaching assistant could be: “You are a teaching assistant for UC Berkeley’s computer science 101 class. Please explain concepts and answer questions in detail. Do not answer any question that is not related to math or computer science.”
88
-
* The rag_prompt is a prefix prompt to be dynamically inserted in front of knowledge base search results in an RAG chat. It could be something like this: “Please answer the question based on facts and opinions in the context below. Do not make anything that is not in the context. ---------”
89
-
81
+
* The `system_prompt` is a general introduction to the agent task the node is supposed to perform. It often contains a persona to help the LLM respond with the right tone. For example, the `system_prompt` for a college teaching assistant could be: “You are a teaching assistant for UC Berkeley’s computer science 101 class. Please explain concepts and answer questions in detail. Do not answer any question that is not related to math or computer science.”
82
+
* The `rag_prompt` is a prefix prompt to be dynamically inserted in front of knowledge base search results in an RAG chat. It could be something like this: “Please answer the question based on facts and opinions in the context below. Do not make anything that is not in the context. ---------”
90
83
91
84
The LLM community has developed many useful prompts for different application use cases. GaiaNet node allows you to easily manage and experiment with them.
92
85
@@ -98,35 +91,34 @@ The GaiaNet node allows you to specify the output format of the generated text.
98
91
99
92
Once the LLM returns a structured JSON response, the agent typically need to pass the JSON to a tool that performs the task and comes back with an answer. For example, the user question might be.
The GaiaNet node must know what is the tool associated with get_current_weather and then invoke it. GaiaNet node owners and operators can configure any number of external tools by mapping a tool name with a web service endpoint. In the above example, the get_current_weather tool might be associated with a web service that takes this JSON data. The GaiaNet node sends the JSON to the web service endpoint via HTTPS POST and receives an answer.
108
105
109
-
110
106
```
111
107
42
112
108
```
113
109
114
-
115
110
It then optionally feeds the answer to the LLM to generate a human language answer.
116
111
117
-
118
112
```
119
113
The current weather in Singapore is 42C.
120
114
```
121
115
122
-
123
116
Through the GaiaNet node SDK, developers are not limited to using web services. They can write plugins to process LLM responses locally on the node. For example, the LLM might return Python code, which can be executed locally in a sandbox and for the GaiaNet node to perform a complex operation.
124
117
125
118
**7 The API server.** All GaiaNet nodes must have the same API for questions and answers. That allows front-end applications to work with, and potentially be load-balanced to any GaiaNet node. We choose to support the OpenAI API specification, which enables GaiaNet nodes to become drop-in replacements for OpenAI API endpoints for a large ecosystem of applications.
126
119
127
120
The API server runs securely and cross-platform on the WasmEdge runtime. It ties together all the other components in the GaiaNet node. It receives user requests, generates an embedding from the request, searches the vector database, adds search results to the prompt context, generates an LLM response, and then optionally uses the response to perform function calling. The API server also provides a web-based chatbot UI for users to chat with the RAG-enhanced finetuned LLM on the node.
128
121
129
-
130
122
## GaiaNet network
131
123
132
124
While each GaiaNet node is already a powerful AI agent capable of answering complex questions and performing actions, individual nodes are not suitable for providing public services. There are several important reasons.
@@ -135,29 +127,26 @@ While each GaiaNet node is already a powerful AI agent capable of answering comp
135
127
* For GaiaNet node owners and operators, there is no economic incentive to provide such services to the public, which could be very costly to run.
136
128
* The AI agent servers have very different scaling characteristics than traditional internet application servers. When the agent is processing a user request, it typically takes up all the computing resources on the hardware. Instead of using software to scale concurrent users on a single server, the challenge of GaiaNet is to scale to many different identical nodes for a large application.
137
129
130
+
Those challenges have given rise to the GaiaNet domain, which forms the basis of the GaiaNet web3 network. A GaiaNet domain is a collection of GaiaNet nodes available under a single Internet domain name. The domain operator decides which GaiaNet nodes can be registered under the domain and makes the node services available to the public. For example, a GaiaNet domain might be a Computer Science teaching assistant for UC Berkeley. The domain could provide services through `https://cs101.gaianet.berkeley.edu`. The domain operator needs to do the following.
138
131
139
-
Those challenges have given rise to the GaiaNet domain, which forms the basis of the GaiaNet web3 network. A GaiaNet domain is a collection of GaiaNet nodes available under a single Internet domain name. The domain operator decides which GaiaNet nodes can be registered under the domain and makes the node services available to the public. For example, a GaiaNet domain might be a Computer Science teaching assistant for UC Berkeley. The domain could provide services through [https://cs101.gaianet.berkeley.edu](https://cs101.gaianet.berkeley.edu/). The domain operator needs to do the following.
140
-
141
-
* Verify and admit individual nodes to be registered under the domain. Those nodes must all meet requirements, such as the LLM, knowledge base, and prompts, set by the domain operator to ensure service quality.
132
+
* Verify and admit individual nodes to be registered under the domain. Those nodes must all meet requirements, such as the LLM, knowledge base, and prompts, set by the domain operator to ensure service quality. The node registration on a domain could be done via a whitelist or blacklist. It is up to the domain operator.
142
133
* Monitor each node’s performance at real time and remove inactive ones.
143
134
* Promotes the “teaching assistant” chatbot apps to the target audience.
144
135
* Set the price for the API services.
145
136
* Load balance between active nodes.
146
137
* Getting paid by users.
147
138
* Pay nodes for their services.
148
139
140
+
Each GaiaNet node has an unique node ID in the form of an ETH address. The private key associated with the ETH address is stored on the node. Once a node is successfully registered with a domain, it is entitled to receive payments from both service revenue and network awards from the domain. The domain could send payments directly to the node's ETH address. Or, the domain could provide a mechanism for a node operator to register multiple nodes under a single Metamask address, such as signing a challenge phrase using the node private keys. In that case, the node operator will receive aggregated payments in his Metamask account for all associated nodes.
149
141
150
142
Each GaiaNet domain has a smart contract that is used for escrow payments. It is similar to OpenAI’s credit payment model, where users purchase credits first, and then consume them over time. When the user pays into the smart contract, an access token will be automatically issued to him. He uses this token to make API calls to the domain, which is then load-balanced to random nodes in the domain. As the user consumes those services, his fund in the contract depletes and the access token stops working if he no longer has any balance.
151
143
152
144
The pricing and payment of the API service are determined by the domain operator. It is typically denominated in USD stable coins. The domain operator pays a share of the revenue to node operators who provided the services. The GaiaNet network is a decentralized marketplace of agent services.
153
145
154
-
155
-
>The funds locked in GaiaNet domain contracts are for a single purpose of consuming API services. It is called Purpose Bound Money.
156
-
146
+
> The funds locked in GaiaNet domain contracts are for a single purpose of consuming API services. It is called Purpose Bound Money.
157
147
158
148
A key aspect of the GaiaNet protocol is that the domain operators are “trust providers” in the ecosystem of decentralized nodes. The protocol network is designed to incentivize the trust of the operators through tokenomics designs such as mining and staking. GaiaNet nodes, domains, users, and developers form a DAO to grow the network and benefit all contributors.
159
149
160
-
161
150
## GaiaNet token
162
151
163
152
The GaiaNet token is a utility token designed to facilitate transactions, support governance, and foster trust in the network. It serves three primary purposes.
@@ -166,24 +155,15 @@ The GaiaNet token is a utility token designed to facilitate transactions, suppor
166
155
* As a staking token, holders vouch for domain operators’ trustworthiness. Stakers get a cut from the domain operator’s service revenue. But they could also be slashed if the domain operator misbehave, such as spreading misinformation or providing unreliable services.
167
156
* As a payment token, the GaiaNet token could be deposited into the domain’s escrow contract and be used to pay for services over time.
168
157
169
-
170
158
The payment utility of the GaiaNet token is designed to balance the network supply and demand. The value of the GaiaNet token asset is determined at the time when it enters or leaves the escrow smart contract based on real-time exchange rates.
171
159
172
160
Service consumers could lock in savings from the potential appreciation of the token. For example, if a user deposits $100 worth of GaiaNet tokens into the contract, and when the domain and nodes get paid, the token value has gone up to $110, he would have received $110 worth of agent services.
173
161
174
-
Conversely, if the token price drops, the service providers (domains and nodes) now have an opportunity to “mine” the tokens on the cheap. If the $100 initial tokens is only worth $90 now, service providers will get more tokens for each unit of electricity and compute they provide. That incentivizes more nodes to join the network and speculate on a later rise in token value.
175
-
176
-
The payment utility is directly related to the circulation market cap of the token. The valuation formula for medium-of-exchange tokens (ie the payment token) is as follows.
162
+
Conversely, if the token price drops, the service providers (domains and nodes) now have an opportunity to “mine” the tokens on the cheap. If the $100 initial tokens is only worth $90 now, service providers will get more tokens for each unit of electricity and compute they provide. That incentivizes more nodes to join the network and speculate on a later rise in token value.
177
163
178
-
Fig: Xxx
164
+
> An exercise: OpenAI is projected to reach $5 billion in ARR in 2024. Assume that most enterprise customers pay quarterly, that is $1.25 billion of circulation market cap in addition to OpenAI’s current enterprise value if they were to issue a payment token. The overall AI services market size is projected to reach $2 trillion in a few years. That translates to $500 billion market cap for a payment utility token alone.
179
165
180
-
The larger the overall market size and the longer participants hold the token result in higher circulating market cap of the token. We believe that the tokenomics design is aligned with the long term goals of the GaiaNet DAO network.
181
-
182
-
183
-
>An exercise: OpenAI is projected to reach $5 billion in ARR in 2024. Assume that most enterprise customers pay quarterly, that is $1.25 billion of circulation market cap in addition to OpenAI’s current enterprise value if they were to issue a payment token. The overall AI services market size is projected to reach $2 trillion in a few years. That translates to $500 billion market cap for a payment utility token alone.
184
-
185
-
186
-
## Developers and component marketplace
166
+
## Component marketplace for AI assets
187
167
188
168
GaiaNet is a developer platform to create your agent services. We provide tools for you to do these.
189
169
@@ -192,18 +172,15 @@ GaiaNet is a developer platform to create your agent services. We provide tools
192
172
* Rust-based SDK to dynamically generate and manage prompts.
193
173
* Rust-based SDK to extend the agent’s capability for invoking tools and software on the node.
194
174
195
-
196
175
For developers who do not wish to operate nodes, we are building a marketplace for
197
176
198
177
* finetuned models
199
178
* knowledge bases and datasets
200
179
* function-calling plugins
201
180
202
-
203
181
All those components are blockchain-based assets represented by NFTs. A node operator could purchase NFTs for the components it wishes to use, and share service revenue with the component developers. That enables diverse and cashflow-generating assets to be issued from the GaiaNet ecosystem.
204
182
205
-
206
-
## Conclusions
183
+
## Conclusion
207
184
208
185
GaiaNet provides open-source tools for individuals and teams to create agent services using their proprietary knowledge and skills. Developers could create finetuned LLMs, knowledge collections, and plugins for the agent, and issue assets based on those components. The GaiaNet protocol makes those nodes discoverable and accessible through GaiaNet domains.
0 commit comments