Liate Framework

Liate Runtime Overview

Liate is the open-source, Bun-native, Hono-powered sovereign AI agent framework that executes LiateSpec 5-Pillar specifications.

Liate is the open-source heart of the ecosystem. It is a Bun-native, Hono-powered AI agent framework that reads a liate.json 5-Pillar specification (or a class extends LiateAgent TypeScript class) and executes it as a fully autonomous AI agent with:

  • Multi-turn ReAct agent loop (Reason → Act → Observe cycles)
  • Native Model Context Protocol (MCP) bridge for any tool server
  • Real-time WebSocket event streaming to your UI
  • Built-in token optimizer that reduces LLM costs by 70–85%
  • Flat-file sovereign store at ~/.liate/ (no database required)
  • Class-as-an-Agent OOP with 51 typed agent classes
  • Agent-is-an-API via liate serve — instant BaaA endpoints

Technology Stack

LayerTechnologyVersionRole
RuntimeBunLatestNative HTTP, child process spawning, file I/O
HTTP FrameworkHonov4.13.3Ultra-fast edge router — CORS, middleware, routing
WebSocketBun.serve nativeLatestZero-library real-time streaming hub
MCP Protocol@modelcontextprotocol/sdkv1.29.0Stdio, SSE, and HTTP MCP transport bridges
ValidationZodv3.22.4Type-safe request/response schema validation
LanguageTypeScriptv5.5.3100% type-safe — zero transpile step at runtime

The 5-Pillar Execution Pipeline

Every agent invocation flows through exactly 5 stages, one per pillar of the LiateSpec:

Class extends LiateAgent / liate.json

    ▼  [L] Model Resolution
    │  Parses "sarvam/sarvam-105b" → provider + model
    │  Resolves API key: E-pillar → ~/.liate/.env → env vars

    ▼  [A] Agent Identity & Skills
    │  Loads A.intent as system prompt
    │  Reads skills.md → injects as [PROCEDURAL SKILL] block

    ▼  [T] MCP Tool Server Boot
    │  Stdio  → uvx, npx, any binary (child process pipe)
    │  SSE    → remote event stream (https://mcp.example.com/sse)
    │  HTTP   → streamable JSON-RPC endpoint
    │  Lists tools, filters by T.tools=["*"]

    ▼  [I] Memory & Context
    │  Loads session from ~/.liate/sessions/<id>.json
    │  Injects as prior conversation turns

    ▼  ReAct Agent Loop (max 5 turns)
       Turn N: systemPrompt + messages → LLM → response
         ├── toolCalls[] → execute → append results → Turn N+1
         └── text response → RESULT event → DONE

             Cleanup: Close all MCP stdio pipes and SSE streams

Source File Map

liate/src/
├── cli/index.ts            ← CLI dispatcher for `npx liate`
├── runner/
│   ├── index.ts            ← 5-Pillar ReAct agent loop
│   └── react.ts            ← ReAct turn manager
├── server/
│   ├── index.ts            ← Hono HTTP + WebSocket LAPI/v1 server
│   └── routes.ts           ← All REST endpoints
├── window/
│   ├── server.ts           ← MCP Window stdio server (Cursor/Claude/Windsurf)
│   └── tools/              ← liate_docs, liate_classes, liate_run, liate_hub ...
├── classes/                ← 51 OOP Agent class definitions
├── hub/                    ← Built-in MCP & Agent registry
└── packages/
    ├── sdk/                ← @liate/sdk — LiateAgent, LiateModel, LiateTools
    ├── store/              ← @liate/store — sovereign key/session/skill store
    └── window/             ← @liate/window — open-source MCP package

Install & Run

# Instant zero-install run
npx liate

# Run a specific agent
npx liate run agent.ts

# Run a JSON spec with a prompt
npx liate run liate.json --prompt "What time is it in India?"

# Start the Agent-is-an-API server
npx liate serve agent.ts

# Start the MCP Window for your IDE
npx liate  # ← This IS the MCP stdio server entry point

Liate Open Source vs Liate Cloud

FeatureLiate (Open Source)Liate Cloud (BYOC)
Installnpx liate1-Click OAuth
ExecutionLocal Bun processCloudflare / Vercel Edge
IsolationProcess-levelV8 Isolate / Edge Worker
Idle CostServer uptime cost$0.00 / second
Boot Time0.87ms0ms (V8 isolates)
MemoryShared host RAMDedicated edge RAM
ProtocolsLAPI/v1 REST + WebSocketLAPI/v1 + public HTTPS
BYODLocal ~/.liate/ storeCloudflare KV / Supabase
LicenseApache 2.0 Open SourceCloud SaaS
Open Source·MIT License·Self Host