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
| Layer | Technology | Version | Role |
|---|---|---|---|
| Runtime | Bun | Latest | Native HTTP, child process spawning, file I/O |
| HTTP Framework | Hono | v4.13.3 | Ultra-fast edge router — CORS, middleware, routing |
| WebSocket | Bun.serve native | Latest | Zero-library real-time streaming hub |
| MCP Protocol | @modelcontextprotocol/sdk | v1.29.0 | Stdio, SSE, and HTTP MCP transport bridges |
| Validation | Zod | v3.22.4 | Type-safe request/response schema validation |
| Language | TypeScript | v5.5.3 | 100% 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 streamsSource 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 packageInstall & 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 pointLiate Open Source vs Liate Cloud
| Feature | Liate (Open Source) | Liate Cloud (BYOC) |
|---|---|---|
| Install | npx liate | 1-Click OAuth |
| Execution | Local Bun process | Cloudflare / Vercel Edge |
| Isolation | Process-level | V8 Isolate / Edge Worker |
| Idle Cost | Server uptime cost | $0.00 / second |
| Boot Time | 0.87ms | 0ms (V8 isolates) |
| Memory | Shared host RAM | Dedicated edge RAM |
| Protocols | LAPI/v1 REST + WebSocket | LAPI/v1 + public HTTPS |
| BYOD | Local ~/.liate/ store | Cloudflare KV / Supabase |
| License | Apache 2.0 Open Source | Cloud SaaS |
