Skip to content

Repository files navigation

Mitii AI Agent

Mitii AI Agent logo

A local-first AI coding agent for VS Code with repository-aware context, controlled execution, and flexible model providers.

License: AGPL v3 VS Code 1.85+ Node 20+ Version 2.8.5 Documentation

AI coding agent · VS Code · local-first · MCP · Ollama · TypeScript

Mitii understands a repository before it changes it. It combines local indexing, Ask/Plan/Agent workflows, approval-aware tools, checkpoints, memory, and session logs in one VS Code experience. Use a local OpenAI-compatible model for privacy, or any OpenAI-compatible cloud endpoint when more capability is required.

Mitii chat interface in VS Code

What Mitii provides

  • Repository-aware context — SQLite FTS5, symbols, vectors, repo maps, diagnostics, Git state, and explicitly attached files.
  • Clear operating modes — Ask for read-only analysis, Plan complex work, Agent applies changes, and Review inspects results.
  • Controlled execution — configurable approvals, dangerous-command blocking, workspace trust checks, and pre-write checkpoints.
  • Model flexibilityecho (local stub) and OpenAI-compatible endpoints (Ollama, LM Studio, OpenRouter, OpenAI, Azure OpenAI, DeepSeek, and similar /v1 APIs). Native Anthropic, Gemini, and Bedrock adapters are not shipped yet.
  • Extensible workflows — built-in tools, MCP servers (VS Code), project rules, and reusable skills.
  • Local evidence — session logs and a basic audit-pack export from the VS Code host (settings redacted). Org SSO/RBAC, SIEM webhooks, and managed enterprise policy packs are not implemented yet.

How it works

flowchart LR
  User[Developer] --> UI[VS Code webview]
  UI --> Controller[Runtime controller]
  Controller --> Context[Hybrid context engine]
  Context --> Index[(SQLite FTS5 + symbols)]
  Context --> Vectors[(LanceDB or SQLite vectors)]
  Controller --> Pipeline[Classify → route → depth → skills]
  Pipeline --> Loop[Ask / Plan / Agent loop]
  Loop --> Policy[Tool policy + approvals]
  Policy --> Tools[Files, shell, Git, MCP]
  Loop --> State[(Plans, memory, logs, checkpoints)]
  Loop --> Provider[Local or cloud model]
Loading

The extension and CLI talk to the agent through @mitii/sdk@mitii/v8. See packages/v8/ARCHITECTURE.md for component boundaries, request flows, storage, security, and an end-to-end example.

Quick start

Requirements

  • VS Code 1.85 or newer
  • Node.js 20 or newer
  • pnpm 10.13 or newer for source development

Install from source

git clone https://github.com/Mitii-dev/Mitii.git
cd Mitii
pnpm run setup

Press F5 in VS Code to open an Extension Development Host. Open a project, select the Mitii icon, wait for indexing to complete, and choose a provider in Settings.

For Cursor development on macOS:

pnpm run setup:cursor

Connect a local model

Run an OpenAI-compatible endpoint such as Ollama, then configure:

{
  "mitii.provider.type": "openai-compatible",
  "mitii.provider.baseUrl": "http://localhost:11434/v1",
  "mitii.provider.model": "qwen3-coder:30b",
  "mitii.safety.autonomyPreset": "guided",
  "mitii.safety.approvalMode": "review_all"
}

API keys for hosted providers are stored in VS Code SecretStorage rather than workspace settings.

Example workflow

Ask Mitii:

Plan a safe migration of the user cache to Redis. Identify affected files,
tests, rollback steps, and configuration changes. Do not edit files yet.

Review the generated plan, switch to Agent mode, and send:

Implement the approved plan and run the relevant tests.

Mitii retrieves relevant context, selects the required capabilities, requests approval for protected actions, checkpoints affected files, applies scoped edits, and runs configured or discovered verification commands.

CLI and SDK

CLI

pnpm run build:cli
node apps/cli/bin/mitii.js ask "Summarize the authentication flow" --echo
node apps/cli/bin/mitii.js index --cwd /path/to/project
node apps/cli/bin/mitii.js status --json

See apps/cli/README.md for ask, session, index, status, and export-session. Daemon / mitii serve is deferred.

SDK

@mitii/v8, @mitii/sdk, @mitii/host, and @mitii/cli publish to npm on v* release tags (see docs/RELEASE.md). For local development, consume them from this monorepo workspace.

import { createMitiiClient, EchoLlmPort } from '@mitii/sdk';

const client = createMitiiClient({
  understandingLlm: /* host LlmPort */,
  runLlm: new EchoLlmPort(),
  workspaceRoot: process.cwd(),
  defaultMode: 'ask',
});

const run = client.start({
  prompt: 'Summarize the authentication flow',
  mode: 'ask',
});

for await (const event of run.events) {
  if (event.type === 'model_delta' && event.preview) {
    process.stdout.write(event.preview);
  }
}

await run.result;

The live surface is createMitiiClient / start / resume — not a legacy query() helper or DaemonClient. More detail: packages/sdk/README.md.

Local safety controls

Mitii keeps indexes, plans, memory, logs, and checkpoints local by default. Only context sent to the configured model provider crosses that provider boundary.

What exists today:

  • approval presets and workspace trust enforcement
  • SecretStorage for API keys (VS Code)
  • session logs and a basic audit-pack export (redacted settings + run events)
  • OpenAI-compatible local endpoints (Ollama / LM Studio) for privacy-sensitive work

Not yet product features: mitii.enterprise.localProvidersOnly, signed SIEM/webhook delivery, SSO/OIDC, RBAC, or a dedicated docs/enterprise/ pack.

Repository layout

mitii-ai-agent/
├── packages/
│   ├── v8/                   # @mitii/v8 — host-neutral agent runtime
│   └── sdk/                  # @mitii/sdk — public API over V8
├── apps/
│   ├── vscode/               # VS Code extension (F5 target)
│   └── cli/                  # headless CLI
├── tests/                    # architecture + consumer suites + solid benchmark
├── docs/                     # developer and release guides
└── scripts/                  # build, release, and audit automation

See docs/REPO_LAYOUT.md. Canonical architecture: packages/v8/ARCHITECTURE.md.

Development

pnpm run build:all          # build all packages + Electron SQLite for F5 / indexes
pnpm run build              # packages only (v8 + sdk + cli + vscode)
pnpm run typecheck          # typecheck v8 + sdk + cli + vscode
pnpm test                   # architecture + selected Vitest suites
pnpm run package            # build the target-specific VSIX (apps/vscode)
pnpm run package:preflight  # release checks, tests, and package

Native modules target different runtimes. rebuild:native stages the Electron binding for F5 and restores the Node ABI in node_modules, so tests keep working:

pnpm run rebuild:native     # Electron → dist/native, then restore Node ABI
pnpm run rebuild:node       # Node-only (tests/CLI)
pnpm run rebuild:all        # alias of rebuild:native (both targets ready)

Vitest scripts auto-heal ABI mismatches via scripts/ensure-node-native.mjs.

See CONTRIBUTING.md for coding conventions and pull request guidance.

Documentation

Contributing and support

Contributions are welcome. Keep changes focused and run pnpm run typecheck and pnpm test before opening a pull request.

License

Mitii AI Agent is licensed under AGPL-3.0-or-later. Contact the maintainer for commercial licensing outside the AGPL terms.

About

Your workspace-driven AI assistant for complex development. Mitti combines hybrid SQLite memory with seamless Model Context Protocol (MCP) tool integration to read files, write code, and run commands, all while keeping your data 100% self-hosted and protecting your token budget.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages