Agent and Job Creation Sequence
Last updated
Last updated
The above sequence diagram illustrates the user flow for creating and running agents within the Spectral Syntax platform. This process abstracts away the complexities of on-chain interactions, allowing users to manage agents via an intuitive interface that handles identity management, fund transfers, agent configurations, and blockchain transactions.
The sequence is divided into three core experiences:
User Sign-in via EOA Wallet: The user begins by signing in through an identity platform. This step involves user authorization through a secure EOA (Externally Owned Account) wallet. In this stage, the identity platform ensures that the user is securely authenticated before accessing the platform's features.
Create User (If New):
After authentication, a new user profile is created if the user is accessing the platform for the first time. Metadata is stored to manage user settings.
Simultaneously, the platform creates a Gas Tank within a smart contract. This Gas Tank is where the user will deposit funds (usually in USDC) to cover gas fees and usage fees for the platform.
Fund Gas Tank: Once the Gas Tank is deployed, the user transfers funds (USDC) to this Gas Tank, ensuring that the agent can operate without the user needing Ether for gas costs. This gas fund is critical for conducting on-chain transactions automatically.
Agent Creation and Configuration:
After the Gas Tank is funded, users can either select an existing agent or create a new one.
If the user chooses to create a new agent, an LLM-powered Agent Builder guides them through the process. The user describes the desired behavior of the agent, and the LLM suggests configurations until the user's requirements are met.
This interaction between the user and the platform continues in a loop until the agent configuration is finalized. This loop is highlighted in the diagram, where the user specifies requirements, and the system responds with recommendations until a satisfactory setup is confirmed.
Agent Submission:
Once the user confirms the agent configurations, the system proceeds to create a Smart Agent Wallet. This wallet operates using the user’s Gas Tank and is an ERC-4337 compliant smart account.
The agent’s configurations are stored in the platform, and the agent is now ready to execute jobs based on the instructions provided during its setup.
Running Agent Instructions:
Once the agent is created and configured, it begins executing tasks based on the user’s instructions. The execution involves the agent constantly listening for specific triggers or conditions. This part of the process is captured in a loop in the diagram, where the agent evaluates each trigger and responds accordingly.
Trigger Monitoring: The agent listens for predefined conditions (for example, market price changes) and evaluates the current state of data using the LEA (Listen, Evaluate, Act) Framework. If the conditions are met, it proceeds to the action phase.
Executing Actions: When a trigger event occurs, the agent initiates an action, typically an on-chain transaction such as buying or selling assets, or interacting with smart contracts.
On-chain Transaction Execution:
The action initiated by the agent is executed via the Agent Wallet Portal. The platform securely signs the transaction using the Alchemy SDK and Turnkey stack.
After the transaction is executed on-chain, a response is sent back, confirming the successful execution of the task. The Gas Tank is automatically reduced by the gas fees incurred for the transaction.
The agent continues to operate, listening for new triggers, evaluating conditions, and executing tasks autonomously based on its setup.
The user interacts with the platform via their EOA Wallet (Externally Owned Account), which is used to authenticate the user. Once authenticated, the user receives a Gas Tank, a smart contract that holds USDC for covering gas fees. Every agent the user creates will utilize this Gas Tank for conducting on-chain transactions. The user also receives an Agent Wallet, which can be used by all agents to access funds transferred from the user's EOA wallet to trade on their behalf.
The LEA Framework governs the actions of each agent. It defines the sequence of operations an agent follows:
Listen: The agent monitors specific events or triggers (e.g., price fluctuations, time-based triggers).
Evaluate: When a trigger occurs, the agent evaluates the conditions to determine if an action should be taken.
Act: Based on the evaluation, the agent initiates an on-chain action, like executing a trade or interacting with a smart contract.
The BROS (Backend Resource for Optimal Service) is the core backend responsible for managing all agent-related logic, including creating, running, and maintaining agents. It implements the LEA framework and oversees the execution of agent tasks.
The BROS Execution Engine is responsible for real-time decision-making based on the agent’s configuration and the triggers it monitors. It ensures that agent actions are executed as intended.
The Plugin Manager and Function Library provides agents with access to third-party APIs and services, such as OpenAI models, blockchain data queries, social media interactions, and other functions. Users can select pre-built plugins or define their own API calls in future versions.
These plugins allow agents to extend their capabilities, enabling them to interact with various data sources and perform more complex tasks.
The Agent Wallet Portal Service manages all on-chain transactions and agent wallet operations. By using the Alchemy SDK and Turnkey, the platform ensures secure transaction signing and execution, all while maintaining the user’s control over their assets.
Spectral Labs does not have access to the user’s private keys, ensuring a secure, decentralized transaction process.