Smart Agent Yellow Paper

A Protocol for Connecting AI Agents to Smart Contracts

David A. Johnston
5 min readAug 21, 2023
Diagram of the process flow for a Smart Agent taking an action for a user

Pre-Beta | August 2023

Overview

=> Smart Contract is to Blockchain, as Smart Agent is to Generative AI.

What’s an Agent?

An agent is a specialized chatbot that acts on behalf of a person.

What’s a Smart Agent?

A Smart Agent is a standard agent that has been trained on the Prompt Rank algorithm, making it a tool to chat intelligently with all things web3.

What’s the Prompt Rank algorithm?

At Google’s core, you’ll find the PageRank algorithm. At the Smart Agent core, you’ll find the Prompt Rank algorithm. Where PageRank determines the most relevant webpages, Prompt Rank provides the Smart Agent the best Smart Contracts to display to the user based on metrics such as number of transactions, which blockchain they execute on and level of decentralization. Full details here.

Who is the end user?

Smart Agents let people talk to Smart Contracts with confidence because Prompt Rank to showing them the most used and decentralized options. So, a new adopter of crypto will use their Smart Agent as a guide. As they gain experience and become more comfortable, their Smart Agent will grow to be a daily assistant.

We see this project as the way to onboard the first billion crypto users because it removes all barriers for the user. The Smart Agent can talk using natural language and works for users on all relevant web3 topics and importantly can transact on their behalf.

  1. It will be installable so important data is stored locally.
  2. It will transact securely via a wallet integrated into Chromium.

Smart Agent Footprint

Github: https://github.com/SmartAgentProtocol/SmartAgents
General Website: https://www.smartagent.org/
Working Example of a Smart Agent: https://www.chatweb3.org/
Details on Prompt Rank: https://www.promptrank.org/
Website for Developers: https://www.smartagency.ai/
Ethereum Focused Site: https://app.ens.domains/smartagents.eth
X Profile For The Community: https://twitter.com/SmartAgentsOrg
Discord: https://discord.gg/fZ8zvFSRSb
Telegram: https://t.me/SmartAIAgents

Technology

LangchainJS will be the structure used to create the Smart Agent template. It allows us to combine six global functions necessary for all Smart Agents.

  1. Large Language Models (communication)
  2. Native knowledge base using Prompt Rank (intelligence)
  3. Persistent memory of conversations, tasks, results, and updates (recall)
  4. Chains of tasks (actions)
  5. Data ingest, embedding and vector mapping (learning)
  6. Guidelines for agent logic and behavior (logic and rules)

Desktop install

An install using ElectronJS gives us access to a local version of Chromium and Node running on a User’s machine. This is being developed at https://github.com/betterbrand/SmartAgent-Install.

Wallets

The smart agent desktop app will include a Smart Agent wallet alongside Chromium or as part of the Node backend. The app will be packaged initially for Mac/PC/Linux. React native or Flutter soon to follow for mo.

A Smart Agent chat plug-in to wallets will be a means to further the reach of Prompt Rank.

EVM Compatible

Using Solidity, this allows the Smart Agent Protocol to remain chain agnostic, anchoring agents in a familiar environment to all EVMs.

Repositories

Main:   https://github.com/SmartAgentProtocol/SmartAgents
Other: https://github.com/hwchase17/langchainjs
https://github.com/betterbrand/SmartAgent-Install
https://github.com/vercel-labs/ai
https://github.com/electron/electron

Beta Delivery

Local Install
API
Chromium
Memory
Node
EmbeddingWallet
LLMRPC
HTTPVercel

Vercel AI SDK

In order to focus on the local install’s wallet functionality, the AI will be served during Beta through Vercel’s AI SDK, which provides granular access to a number of services:

  • KV Storage and Bandwidth
  • Cache Revalidation, Reads, and Writes
  • KV Databases & Commands
  • Postgres Written Data, Transfer, and Compute Time
  • Source Images
  • Edge Function Execution Units and Middleware Invocations
  • Serverless Function Execution Time
  • Bandwidth
  • Edge Config Reads and Writes
  • Edge Config Reads
  • Web Analytics Events
  • Vercel Remote Caching

Post Beta we will start moving these services to the local install in order to remove Internet based vulnerabilities.

Workflow

  1. User consults their Smart Agent, the Smart Agent prompts the user
  2. A conversation takes place, then actions are taken by the Smart Agent using credentials provided by the User.
  3. The Smart Agent reports back to the User and remembers the context and content of each conversation.

Smart Agent Donations

For Dapps outside the Prompt Rank algorithm, all financial transactions will add a 10% fee to the user.

Gasless Transactions

There will be a point in which we want to analyze our Smart Agents’ actions and performance in addition to collecting the SmartAgent.org donation. To do this in a way that is beneficial to whomever manages a Smart Agent, we can cover the gas fees as a value-add to the transaction.

When a web3 transaction is conducted with a Smart Agent, it first goes through a Smart Agent contract that verifies identity and intent. A third party covering gas fees or internal Paymaster will be implemented to obfuscate the installation address and onboard users into new networks in the future.

Languages & Protocol

Version 0.1 is going to be developed using the JS version of LangChain with a number of components:

Function: Beta APILLMLLAMA
Memory: PineconeIngest & Embedding Huggingface
Agent: Architecture Langchain
Document: Training & Testing Botpress

Conclusion

The Smart Agent tech stack is built on the latest AI Agent tools with an eye for extending them to the world of EVMs, Smart Contracts, and Web3 tools. Opening up this work of wallets, Dapps, DAOs and more to the average person with no technical ability required and in a way that will guide them toward the safest, best used, and most decentralized options available.

--

--

David A. Johnston

Technologist, Voluntarist, Future Martian Settler, & Evangelist for Decentralization.