VIBE Engine Framework

Core agent runtime and tools

VIBE Engine Framework

Overview

The VIBE Engine is a modular agent runtime that powers all VIBE AI agents. It ingests context, goals, personality, and available tools to generate intelligent autonomous actions.

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                        VIBE ENGINE                                   │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│  INPUT LAYER                                                        │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐               │
│  │  User    │ │  Cron    │ │ Webhook  │ │   A2A    │               │
│  │  Chat    │ │ Trigger  │ │ Trigger  │ │ Request  │               │
│  └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘               │
│       │            │            │            │                      │
│       └────────────┴─────┬──────┴────────────┘                      │
│                          ▼                                          │
│  PROCESSING LAYER                                                   │
│  ┌──────────────────────────────────────────────────────────────┐  │
│  │                                                               │  │
│  │  ┌─────────┐  ┌─────────┐  ┌─────────┐  ┌─────────┐         │  │
│  │  │ Context │  │ Planner │  │Executor │  │ Memory  │         │  │
│  │  │ Builder │─▶│  (LLM)  │─▶│ (Tools) │─▶│ Store   │         │  │
│  │  └─────────┘  └─────────┘  └─────────┘  └─────────┘         │  │
│  │                                                               │  │
│  └──────────────────────────────────────────────────────────────┘  │
│                          │                                          │
│  OUTPUT LAYER            ▼                                          │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐               │
│  │ Response │ │  Tool    │ │   File   │ │  A2A     │               │
│  │ Stream   │ │ Results  │ │ Outputs  │ │ Response │               │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘               │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘

Core Components

1. Context Builder

Assembles all relevant context for the LLM:

context = {
    # Agent definition
    "system_prompt": agent.system_prompt,
    "personality": agent.personality,
    "goals": agent.goals,
    
    # Available tools
    "tools": tool_manager.get_schemas(),
    
    # Memory
    "user_memory": memory.search(query),
    "conversation_history": thread.messages[-10:],
    
    # Knowledge base
    "knowledge": kb.search(query, limit=5),
}

2. Planner (LLM)

VIBE AI uses LiteLLM for multi-provider LLM orchestration, supporting leading foundation models:

ProviderModelsUse Case
OpenAIGPT-4o, GPT-4-turbo, o1Complex reasoning, coding
AnthropicClaude 3.5 Sonnet, Claude 3 OpusLong context, analysis
GoogleGemini 1.5 Pro, Gemini 2.0Multimodal, search
OpenRouter100+ modelsModel variety, fallback

Configuration:

Users can select their preferred model via agent settings. LiteLLM handles:

  • Unified API interface across providers
  • Automatic retries and fallbacks
  • Token tracking and usage monitoring
  • Caching for cost optimization
# Example: Agent using LiteLLM
from litellm import completion

response = await completion(
    model="gpt-4o",  # or "claude-3-5-sonnet-20241022"
    messages=[{"role": "user", "content": query}],
    tools=tool_schemas
)

🔮 Future: Hybrid Inference (Cortensor)

Planned integration with decentralized inference networks for cost-optimized, censorship-resistant LLM access. Not yet implemented.

3. Executor (Tools)

Runs selected tools in isolated sandbox:

Tool Execution
     │
     ▼
┌──────────────────────────────────────┐
│          DAYTONA SANDBOX             │
│                                      │
│  ┌──────────┐  ┌──────────┐         │
│  │  Docker  │  │ Browser  │         │
│  │Container │  │(Playwright)│         │
│  └──────────┘  └──────────┘         │
│                                      │
│  • Isolated execution                │
│  • No host access                    │
│  • Resource limits                   │
│  • Auto-cleanup                      │
│                                      │
└──────────────────────────────────────┘

4. Memory Store

Self-improving memory system (Mem0-style):

# Automatic fact extraction
conversation = "User prefers BTC over ETH"
     │
     ▼
memory.add({
    "content": "User prefers BTC over ETH",
    "type": "preference",
    "tags": ["crypto", "trading"],
    "embedding": embed(content)
})
     │
     ▼
# Future queries retrieve relevant memories
memories = memory.search("crypto recommendation")
# Returns: "User prefers BTC over ETH"

Tool System

Native Tools (30+)

CategoryTools
Web SearchTavily search
BrowserPlaywright automation (via Daytona)
Computer UseVNC-based desktop interaction
CodePython, Node.js, Shell execution (via Daytona sandbox)
FilesRead, write, edit, sheets (Excel), presentations (PowerPoint)
VisionImage analysis
MemoryMem0-style storage and retrieval
Data Providers14 integrated providers (Nansen, DataAPI, etc.)
WalletCoinbase Payments MCP (multi-chain)
A2ATask handoff between agents (within account)
MessagingTelegram, Twitter via Composio

Tool Schema Format

@openapi_schema({
    "type": "function",
    "function": {
        "name": "web_search",
        "description": "Search the web for information",
        "parameters": {
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    "description": "Search query"
                },
                "max_results": {
                    "type": "integer",
                    "default": 10
                }
            },
            "required": ["query"]
        }
    }
})
async def web_search(self, query: str, max_results: int = 10):
    # Implementation
    pass

MCP Protocol Support

Extend agents with any MCP-compatible server:

# Agent MCP configuration
mcp_servers:
  - name: "filesystem"
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-filesystem"]
    
  - name: "github"
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-github"]
    env:
      GITHUB_TOKEN: "${GITHUB_TOKEN}"

Composio Integration

200+ pre-built integrations via Composio:

CategoryIntegrations
SocialTelegram, Twitter, Discord
ProductivityGoogle Drive, Notion, Slack
Dev ToolsGitHub, Linear, Jira
FinanceStripe, QuickBooks

Trigger System

Trigger Types

TypeDescriptionExample
CronTime-based"Every day at 9am"
WebhookHTTP callbackExternal service notification
EventPlatform events"New message in channel"
A2AAgent requestAnother agent needs help

Trigger Configuration

triggers:
  - name: "daily_report"
    type: "cron"
    schedule: "0 9 * * *"  # Daily at 9am UTC
    action:
      type: "run_agent"
      input: "Generate daily portfolio report"
      
  - name: "twitter_monitor"
    type: "webhook"
    source: "twitter"
    filter:
      mentions: ["@VIBEaiRforce"]
    action:
      type: "run_agent"
      input: "Respond to Twitter mention: {tweet}"

Agent Configuration

System Prompt

Define agent behavior and personality:

system_prompt: |
  You are a DeFi research analyst specializing in:
  - Token analysis and fundamentals
  - On-chain data interpretation
  - Market trend identification
  
  Always cite sources and provide confidence levels.
  Be concise but thorough.

personality:
  tone: "professional"
  style: "analytical"
  risk_tolerance: "moderate"

Knowledge Base

Upload documents for RAG:

knowledge_base:
  sources:
    - type: "file"
      path: "./docs/defi-glossary.pdf"
    - type: "url"
      url: "https://docs.uniswap.org"
    - type: "text"
      content: "Custom knowledge..."
      
  settings:
    chunk_size: 1000
    chunk_overlap: 200
    embedding_model: "text-embedding-3-small"

Performance Optimization

Caching

# Tool result caching
@cached(ttl=3600)
async def get_token_price(symbol: str):
    return await fetch_price(symbol)

Parallel Execution

# Execute independent tools in parallel
results = await asyncio.gather(
    web_search("BTC news"),
    get_token_price("BTC"),
    fetch_on_chain_data("BTC")
)

Rate Limiting

rate_limits:
  llm_calls_per_minute: 60
  tool_calls_per_minute: 100
  max_concurrent_tools: 5

Resources


Next: Agent Identity (ERC-8004) →