Mistral Vibe

repository·main·Indexed 24 days ago

https://github.com/mistralai/mistral-vibe

An open-source minimal CLI coding agent powered by Mistral models. It provides a conversational interface to explore, modify, and interact with codebases using specialized tools, agents, and support for the Model Context Protocol (MCP) and Agent Client Protocol (ACP). Features include interactive and programmatic modes, custom agent profiles, skill-based slash commands, and a hook system for auditing or rewriting agent behavior.

Tokens
39.1K
Snippets
47
Records
284
Agent score
89%

What's inside mistral-vibe

  1. Understand Mistral Vibe's Instruction Hierarchy

    main

    Mistral Vibe follows a strict hierarchy to resolve conflicting instructions. When instructions from different sources clash, the source with the lower number in this list takes precedence:

    1. Critical instructions (Never overridable)
    2. User messages (Recent messages override older ones)
    3. Repo AGENTS.md files (Files on the path from the task up to the repo root; closer to the task wins)
    4. The user's AGENTS.md
    5. Overridable defaults (System prompt defaults)
    6. Skills / MCP output
    7. External data (Web, fetched content - treated as data, not instructions)

    An instruction is considered active only if it is not overridden by a higher-priority source.

  2. Understand the Vibe App Server architecture

    main

    Vibe uses vibe.app_server as its central harness and runtime boundary. All delivery surfaces (Textual, ACP, or programmatic modes) act as clients to this server via a typed JSON-RPC 2.0 protocol.

    Key architectural principles:

    • Boundary: Delivery surfaces never interact with AgentLoop directly; they exchange serialized JSON values.
    • Separation of Concerns: vibe.core handles model and tool execution, while vibe.app_server manages sessions, turns, callbacks, resources, and persistence.
    • State Ownership: The server is authoritative for runtime construction, session identity, tools, permissions, and effective configuration. Clients are responsible for UI/UX elements like widgets, layout, and keyboard/prompt editing.
  3. Understand Mistral Vibe Session Persistence and Lifecycle

    main

    Sessions in Mistral Vibe are durable local records used to store conversation state, metadata, tool availability, statistics, and resumability data.

    Key Lifecycle Behaviors:

    • Persistence: Sessions are designed to be append-friendly for messages and atomic for metadata. They are tolerant of older transcript shapes via migrations.
    • Resumability: A reconnect to the same live harness can recover its snapshot and open callbacks. However, starting a new process cannot restore an in-flight turn, open callback future, or live event sequence from the JSONL files. Do not treat live reconnect behavior as crash recovery.
    • Client vs. Server: Only the server reads or writes session files. Clients interact with a lossy PublicSessionState and navigate history using opaque cursors. Clients should use stable IDs for session, turn, entry, callback, effect, and child-session.
    • Subagents: Subagents are represented as linked child sessions rather than being embedded as live child runtimes in a public parent model.
  4. Architectural pattern: Event-driven agent loop

    main

    The mistral-vibe agent loop operates using a pattern of typed events and streaming async generators. The AgentLoop owns model and tool execution, while the vibe.app_server manages the external session, turn, callback, and delivery lifecycle.

    Key Integration Rules:

    • Do not consume AgentLoop.act() directly from a delivery surface. Instead, route core events to delivery surfaces through vibe.app_server.
    • Use Typed Events: Instead of adding surface-specific callbacks to the agent loop, extend the existing typed event system. Events serve as the contract for assistant output, reasoning, user messages, tool calls, tool streams, tool results, approvals, compaction, plan review, title updates, hooks, and teleport.
    • Event Payload Design: Keep event payloads small, serializable, and meaningful across different UIs.
    • Concurrency: Use asyncio.create_task and queues for explicit concurrent flows. Avoid using broad asyncio.gather calls to hide orchestration.
    • Cancellation: Ensure long-running work is cancellable and that cancellation is communicated through existing event or result paths.
    • Session Management: Public session event IDs must be monotonic. If a client misses an event (a gap), it should recover by replacing the client projection via session/read.
  5. Understand the Mistral Vibe architecture and delivery surfaces

    main

    Mistral Vibe is architected with a separation between the core engine and various delivery surfaces. The vibe/core package contains the reusable engine implementations (agent loops, tools, LLM backends, etc.), while vibe/app_server acts as the runtime composition root.

    Delivery surfaces include:

    • vibe/cli: Terminal UX, Textual app, widgets, slash-commands, and voice UI.
    • vibe/acp: Agent Client Protocol translation and presentation.
    • vibe/setup: First-run and onboarding flows.
    • Programmatic entry points: Direct consumption of the app-server client API.

    To interact with the system, use the public facades provided by the app server rather than private modules.

  6. Architectural Principles for Mistral Vibe

    main

    Mistral Vibe follows a pragmatic hexagonal architecture designed for fast startup, responsive interactive use, and limited blast radius. The architecture separates core logic from delivery surfaces and external integrations.

    Core Organization

    • vibe/core: Contains model execution, tool execution, and surface-neutral domain state.
    • vibe.app_server: Handles cross-surface session, runtime, resource, and protocol orchestration. Delivery surfaces (like UIs) should consume its public client API rather than interacting with the core directly.
    • Adapters/Edges: Implementations for Textual, ACP, HTTP, files, subprocesses, provider SDKs, and local platform behavior should reside outside the pure decision-making path.

    Performance and Design Guidelines

    • Startup Optimization: Avoid eager imports, eager network calls, broad filesystem scans, and heavyweight initialization on the launch path to preserve fast startup times.
    • Change Locality: Prefer small edits within a single owning module over scattered updates across multiple files.
    • Abstraction Strategy: Only add abstractions when they reduce coupling, replace duplication, or match an existing boundary.
  7. Configure proxy settings in Mistral Vibe CLI

    main

    To configure proxy settings for environments requiring network traffic to pass through a proxy server, use the interactive /proxy-setup command within the CLI. After completing the form, you must restart the CLI for the changes to take effect.

    1. Type `/proxy-setup` and press Enter
    2. Fill in the variables you need, then press **Enter** to save or **Escape** to cancel
    3. **Restart the CLI** for changes to take effect
  8. Handle server-to-client callbacks and tool calls

    main

    The protocol supports three message directions. When the server requires client participation (e.g., for a tool that requires local filesystem access), it uses the following pattern:

    1. Server Request: The server sends a typed request via callback/call or an advertised clientTool/* operation.
    2. Client Acknowledgment: The client acknowledges delivery of the request.
    3. Client Response: The client sends the semantic answer back to the server using a callback/respond request. For client-tools, this response includes the result of the requested operation (e.g., terminal output).
  9. Set up Mistral Vibe in JetBrains IDEs

    main

    Mistral Vibe requires the JetBrains AI Assistant extension.

    For JetBrains version 2025.3 or later:

    1. Navigate to Tools > AI Assistant > Agents in settings.
    2. Search for Mistral Vibe and click install.
    3. Select Mistral Vibe from the AI Assistant agent selector.

    For legacy JetBrains versions (using acp.json): Add the vibe-acp command to your acp.json configuration under agent_servers and select the agent in the AI Chat selector.

    {
      "agent_servers": {
        "Mistral Vibe": {
          "command": "vibe-acp"
        }
      }
    }
  10. Select and Configure Built-in Agents

    main

    Mistral Vibe includes several agent profiles tailored for different workflows. You can select an agent at runtime using the --agent flag or set a default in your config.toml.

    Available Agents

    • default: Standard agent; requires approval for tool executions. Best for general use.
    • plan: Read-only agent for exploration and planning. Auto-approves safe tools like grep and read.
    • accept-edits: Auto-approves file edits only (write_file, edit). Useful for refactoring.
    • auto-approve: Auto-approves all tool executions. Use with caution.
    • lean: Only available if listed in installed_agents.

    Usage

    To run with a specific agent:

    vibe --agent plan

    To set a default agent in config.toml:

    default_agent = "plan"

    Note: You can override any agent's safety settings by passing --auto-approve or --yolo during a session.

    vibe --agent plan
  11. Use Custom System and Compaction Prompts

    main

    You can override default prompts by placing markdown files in ~/.vibe/prompts/ (or project-local .vibe/prompts/).

    • System Prompts: Replace the default prompts/cli.md by setting system_prompt_id in config.toml to the filename (without .md).
    • Compaction Prompts: Replace the default prompts/compact.md by setting compaction_prompt_id in config.toml to the filename (without .md).

    Custom Instructions: You can also add project-specific instructions by creating AGENTS.md files in your project directory or ~/.vibe/AGENTS.md. Local files override global ones.

    system_prompt_id = "my_custom_prompt"
    compaction_prompt_id = "my_compaction_prompt"
  12. Prepare a release with prepare_release.py

    main

    The prepare_release.py script automates the release workflow by:

    1. Building the release branch from the previous public release tag.
    2. Cherry-picking commits from matching -private tags.
    3. Squashing commits into a single release commit (default behavior).
    4. Freezing the full transitive dependency graph into pyproject.toml using the current uv.lock.