Mistral Vibe Architecture Documentation
mistral-vibe
Mistral Vibe Architecture Documentation
This documentation provides a comprehensive technical analysis of the Mistral Vibe codebase (v2.0.2), including architecture, design patterns, and source code references.
Documentation Index
| Document | Description |
|---|---|
| 00-overview.md | High-level architecture overview, tech stack, directory structure |
| 01-entry-points.md | Application entry points, CLI arguments, execution flow |
| 02-agent-loop.md | AgentLoop orchestrator, conversation loop, event types |
| 03-tool-system.md | Tool architecture, BaseTool, ToolManager, MCP integration |
| 04-middleware.md | Middleware pipeline, turn/price limits, auto-compaction, plan enforcement |
| 05-llm-backends.md | LLM backend abstraction, Mistral and Generic backends |
| 06-configuration.md | Configuration system, TOML files, path resolution, validation |
| 07-tui-events.md | TUI architecture, event handling, user input flow |
| 08-agents-skills.md | Agent profiles system and skills system |
| 09-session-management.md | Session persistence, loading, and migration |
| 10-trusted-folders.md | Trusted folders security system |
| 11-llm-patterns.md | LLM interaction patterns, guardrails, prompt engineering techniques |
Quick Reference
Key Files
| File | Purpose |
|---|---|
vibe/cli/entrypoint.py |
Main CLI entry point |
vibe/core/agent_loop.py |
AgentLoop orchestrator |
vibe/core/config.py |
Configuration system |
vibe/core/middleware.py |
Middleware pipeline |
vibe/core/trusted_folders.py |
Trusted folders security |
vibe/core/agents/manager.py |
Agent profile management |
vibe/core/skills/manager.py |
Skills discovery |
vibe/core/tools/base.py |
Abstract tool base class |
vibe/core/tools/manager.py |
Tool discovery and management |
vibe/core/session/session_logger.py |
Session persistence |
vibe/core/paths/global_paths.py |
Global path constants |
vibe/core/paths/config_paths.py |
Trust-aware path resolution |
vibe/cli/textual_ui/app.py |
TUI application |
Architecture Diagram
┌─────────────────────────────────────────────────────────────────┐
│ User Interface │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ Interactive TUI │ │ Programmatic Mode │ │
│ └────────┬────────┘ └───────────┬─────────────┘ │
└───────────┼───────────────────────────────────┼─────────────────┘
└───────────────┬───────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ Agent Core │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ AgentLoop Orchestrator │ │
│ │ (vibe/core/agent_loop.py) │ │
│ └─────────────────────────┬───────────────────────────────┘ │
│ │ │
│ ┌──────┬──────┬────────────┼────────┬──────────┬───────────┐ │
│ │ │ │ │ │ │ │ │
│ ▼ ▼ ▼ ▼ ▼ ▼ ▼ │
│ LLM Tool Middlew. System Session Agent Skill │
│Backend Manager Pipeline Prompt Logger Manager Manager │
│ │ │
│ Prompt Assembly Pipeline │
│ cli.md + OS info + tool .md prompts + skills XML │
│ + subagents list + project context │
└─────────────────────────────────────────────────────────────────┘
Data Flow
User Message → AgentLoop.act() → Middleware → LLM Call → Tool Execution → Response
↑ │
└──────────────────────────────────────────┘
(loop until complete)
How to Read This Documentation
- Start with 00-overview.md for the big picture
- Follow 01-entry-points.md to understand how the app starts
- Deep dive into 02-agent-loop.md for the core logic
- Explore specific subsystems based on your needs
Each document includes:
- Conceptual explanations
- Source code references with file paths and line numbers
- Flow diagrams
- Code snippets from the actual implementation