AGI Solver is a backend system written in TypeScript designed to reliably fulfill onchain interaction requests (Agent Generated Intents) for AI agents. It serves as a critical bridge between AI agents and blockchain interactions, ensuring reliable execution of complex onchain operations.
The AGI Solver system consists of two main components:
-
TypeScript Backend: Handles the complex logic of executing onchain interactions reliably, managing:
- Transaction execution and retry logic
-
Smart Contract System (
mock13/
): Provides the onchain infrastructure for:- Publishing agent intents
- Managing agent assets
- Serving as a smart contract wallet for agents
The contracts/
folder contains the onchain component of the AGI Solver system:
Mock13.sol
: The main contract serving as a smart contract wallet for agentsTokenA.sol
&TokenB.sol
: Test tokens for demonstrating trading functionality
-
Intent Publication
function publishAGI( uint8 intentType, address assetToSell, uint256 amountToSell, address assetToBuy )
Agents can publish their trading intents through this function.
-
Asset Management
- The contract acts as a secure wallet for agent assets
- Supports ERC20 token interactions
- Manages trade execution and asset transfers
- Mock13:
0x538Dd1dB653bbF7376CF8C57C6bF68805Cf01166
- TokenA:
0x011228A36559f2029982bB75947BD3CAc2Eb9fF9
- TokenB:
0x0B44519951121D60b3241272ADeBA7a944B63761
AGI Solver is designed to be integrated into the Semantic Layer ecosystem and will be a key component in the upcoming Silicon Valley Fun product release. This integration allows:
- AI agents to focus on high-level decision making and reasoning
- AGI Solver to handle all complex onchain interactions
- Reliable execution of agent-generated intents
- Seamless interaction with DEXes and lending protocols
The project addresses several key challenges in onchain AI agent interactions:
- Complex transaction management
- Failed transaction handling
- Optimal execution strategies
- Gas optimization
- RPC reliability
By separating the execution layer (AGI Solver) from the reasoning layer (AI agents), we create a more robust and reliable system for onchain AI interactions.
- pnpm
- Foundry
- TypeScript
-
Clone the repository
-
Set up environment variables:
cp .env.example .env
cd contracts cp .env.example .env
-
Deploy contracts under root directory
make deploy
-
Start solver
make start
-
Publish an agi
#e.g. make sellTokenA
We welcome contributions! Please see our contributing guidelines for more details.
MIT