Architecture
DOCS / REFERENCE

Architecture

The owned loop, the flagship agent, and the runtime that brings them together.

The main layers

LayerImplementationResponsibility
Owned looprunAgentLoop / streamModelStepIteration, steering, context pruning, halt conditions.
Core agentVibesAgentImplements AI SDK’s Agent contract and coordinates collaborators.
Flagship agentVibeAgent / createVibeAgentCore agent with the default tools, plugins, and workers.
RuntimeAgentRuntime / SessionApp-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.

text
User message
  → Session / AgentRuntime
  → VibeAgent + plugins
  → Owned agent loop
      → model step
      → tools / approvals / workers
      → next step or halt
  → streamed events + saved state

Repository map

text
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 launcher

Keep 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.

Find a guide, command, or concept.