Architecture
The owned loop, the flagship agent, and the runtime that brings them together.
The main layers
| Layer | Implementation | Responsibility |
|---|---|---|
| Owned loop | runAgentLoop / streamModelStep | Iteration, steering, context pruning, halt conditions. |
| Core agent | VibesAgent | Implements AI SDK’s Agent contract and coordinates collaborators. |
| Flagship agent | VibeAgent / createVibeAgent | Core agent with the default tools, plugins, and workers. |
| Runtime | AgentRuntime / Session | App-level sessions, agent caching, and workspaces. |
Vibes owns the loop
Each model step uses the AI SDK’s streamText primitive with a single-step stop condition. Vibes owns the surrounding loop: plugin fan-out, tool orchestration, stop conditions, steering, and context handling.
User message
→ Session / AgentRuntime
→ VibeAgent + plugins
→ Owned agent loop
→ model step
→ tools / approvals / workers
→ next step or halt
→ streamed events + saved stateRepository map
apps/api/ Hono API + session transport
apps/tui/ React + OpenTUI terminal client
apps/demo/ React web chat and canvas
packages/harness-vibes/ Agent framework
bin/vibes.ts Project launcherKeep new capabilities in plugins. Keep app-specific transport concerns in the front doors, and avoid making the agent class responsible for every subsystem.
Streaming and events
Vibes’ typed UI data parts carry tool activity, agent progress, tasks, and artifacts over the AI SDK stream. The web interface integrates them with useChat. A headless event bus is available for observing runs without a UI.
Improve this page Grounded in the Vibes source.