AI and Agent System

Relevant source files

Warp is an AI-native terminal that integrates large language models directly into the command-line experience. The AI system is built around a sophisticated agent architecture that allows for both interactive conversations and autonomous task execution. This system leverages the Model Context Protocol (MCP) to interact with the local file system and external tools, supported by a robust Skills System and a cloud-based execution platform known as Oz.

System Architecture Overview

The AI capabilities in Warp are distributed across several layers, from the UI conversation model to the low-level protocol integrations.

Title: AI System Component Interaction


Sources: app/src/ai/agent/mod.rs, app/src/ai/skills/mod.rs, app/src/ai/mcp/mod.rs


Agent Conversations and Task Execution

The core of Warp's AI is the Agent system located in app/src/ai/agent/. This subsystem manages the lifecycle of an AI interaction, from the initial user prompt to the final execution of terminal commands or file edits.

  • Conversation Model: Managed via AIConversationId, the system maintains a linearized history of agent steps, including thought processes, tool calls, and outputs.
  • Task Store: Tracks the state of long-running autonomous tasks and their execution progress.
  • Ambient Agents: Located in app/src/ai/ambient_agents/, these agents provide "always-on" assistance, such as proactive command suggestions or error explanations, without requiring a dedicated chat session.
  • Execution Profiles: Define the constraints and capabilities of an agent session (e.g., local vs. cloud execution).
  • Computer Use & Voice: Integrates screenshot-based automation via the computer_use crate and voice transcription in app/src/ai/voice/.

For details, see Agent Conversations and Task Execution.

Sources: app/src/ai/agent/mod.rs, app/src/ai/ambient_agents/mod.rs


MCP (Model Context Protocol) Integration

Warp implements the Model Context Protocol (MCP) to provide a standardized way for AI agents to access tools and data. The integration in app/src/ai/mcp/ allows Warp to act as an MCP host.

  • MCP Server Manager: Handles the lifecycle of MCP servers, including file-based watchers that detect new server configurations.
  • Tool Exposure: Automatically discovers tools provided by MCP servers and exposes them as executable "skills" to the AI agent.
  • Reconnecting Peer Logic: Ensures robust connections to external MCP servers.
  • Bundled Skills: Warp includes several pre-configured MCP skills in resources/bundled/mcp_skills/ for common terminal operations.
  • External Config: External MCP servers can be configured via .mcp.json at the project root .mcp.json1-12

For details, see MCP (Model Context Protocol) Integration.

Sources: app/src/ai/mcp/mod.rs, crates/warp_cli/src/mcp.rs, .mcp.json1-12


Skills System and Bundled Resources

The Skills System in app/src/ai/skills/ is the extensibility layer for Warp's AI. A "Skill" is a discrete capability that an agent can invoke to perform an action.

  • Skill Resolution: The SkillManager resolves natural language intents to specific executable logic or MCP tools.
  • Bundled Skills: Located in resources/bundled/skills/, these include built-in capabilities like add-mcp-server, modify-settings, oz-platform, and create-skill.
  • Agentic Development: Warp uses internal skills like add-telemetry to assist developers in instrumenting the codebase .agents/skills/add-telemetry/SKILL.md2-4
  • Channel Gating: Skills can be restricted to specific release channels (e.g., Dev or Preview) to allow for safe testing of new AI features.

For details, see Skills System and Bundled Resources.

Sources: app/src/ai/skills/mod.rs, .agents/skills/add-telemetry/SKILL.md1-50


Telemetry System

Warp uses a trait-based telemetry framework to monitor the performance and usage of AI features while respecting user privacy. This system ensures that instrumentation is domain-specific and follows strict data-handling rules.

Title: Telemetry Data Flow and Code Entities


Sources: .agents/skills/add-telemetry/SKILL.md10-120 .agents/skills/add-telemetry/SKILL.md127-147

For details, see Telemetry System.