Skip to content
kazma.
Search Kazma Documentation & Site
ع Star 6 Get Started
v0.11.0 · Hands · Open Source (MIT)

Self-hosted agent that edits your repo, and stops before danger tools.

One LangGraph brain. Human approval before writes and shell. When the model dies you see ⚠️ — not a made-up answer. Web, TUI, CLI, Telegram, Discord, Slack. Full English and Arabic UI; Gulf greetings are a short-circuit, not a dialect model.

HITL pause — one interrupt, one approval card

⚙ file_search · 14s · step 2/4 journaled turn_heartbeat
04:52
Approval Required (Path A Interrupt) auto-denies if unattended

Agent requested dangerous tool: file_write(path="src/router.py").

Policy: default-deny

Turn Execution Steps

00:02 Bi-temporal memory recall: 4 belief nodes retrieved via Local Ego-Graph PPR
00:06 Commitment Gate: Resolved intent against Task Ledger (proposal #42)
00:14 Phase: Awaiting operator authorization in hitl_gates.db...
457K+ Lines of Code 7 packages in monorepo
9,585 Automated Tests passed · 24 skipped · 3 xfailed · 0 failures
3,709+ Git Commits public git history
190 Project Age days since March 15, 2026

Project Age counts from the first line of code; the public repos begin later — kazma's first commit is June 20, 2026 — because early development was local and on since-archived repos.

The Kazma Core Architecture

What the code does today.

Swarms, bi-temporal chat memory, and three-path human approval. When the model dies you see a warning, not a made-up answer.

Bi-Temporal Belief Graph

V2 Cognitive Memory Engine

Beliefs are stored with two clocks: when they were asserted, and the interval they are valid for (valid_from / valid_until).

Local Ego-Graph PPR Associative multi-hop recall over entity beliefs via Personal PageRank.
RRF Hybrid Search Dense embeddings (pgvector / sqlite-vec) + FTS5 lexical ranking.
Prompt-Fenced Injection Recalled data is safely wrapped in <kazma:data untrusted> to prevent prompt injection.
Automated Backup Ops 6h WAL-safe snapshots of every SQLite DB plus validated Postgres dumps, kept offsite via encrypted restic.
Backed by memory_state.db & Postgres Memory Docs
Fail-Closed CAS

3 HITL Paths & Gate Registry

Every mutating action is intercepted across 3 execution paths and arbitrated by a central SQLite gate registry (hitl_gates.db):

  • Path A Graph Interrupt: LangGraph interrupt() in graph_tool_worker.py suspends the thread before danger tools run.
  • Path B Swarm Bus Gates: SafetyMiddleware.check renders tri-state approval buttons on Telegram, Discord, and Slack.
  • Path C Pipeline Checkpoints: Hard stops managed by CheckpointManager before executing multi-phase batch operations.
  • Watchdog Auto-Deny: Unanswered cards count down to deadline and auto-deny, preventing hung turns.
Default-deny. Approval is consent, not a sandbox Safety Docs
Resolve-Before-Act

Commitment Layer

A strict policy gate between the LLM and durable state. Intent is resolved against stored memory before executing actions, preventing hallucinated overwrites.

Durable Task Ledger "Proceed" binds to declared steps in SQLite, not raw chat transcripts.
Structural Clarify Gate Ambiguous intent can only output 1 clarification card with tools stripped.
Proposal-Backed Contract External publications enforce proposal_id save-first requirement.
Git write actions always require human gate Commitment Docs
Single Source of Truth

Transport-Agnostic IDE & X Studio

The kazma_core/ide subsystem provides a unified engine for file trees, CodeMirror editing, git diffing, and pytest execution across the Web dashboard, Terminal UI (TUI), and chat channels.

Web & TUI IDE CodeMirror 5 syntax highlighting in the browser. Agent edits go through apply-patch and HITL, not a silent whole-file write.
MCP IDE Server Stdio JSON-RPC server exposing file & test tools directly to VS Code / Cursor.
X Studio (/x) Official X API v2 publisher with proposal-backed HITL, drafts, and scheduling.
Zero DOM leakage · ContextVar workspace isolation IDE Docs
Honest failure

When it breaks, it says so

A failed LLM call sets turn_failed and skips synthesis. Transient errors retry; permanent ones fail fast. Provider failover is a chain you configure, not magic.

  • turn_failed skips a fake answer
  • ⚠️ prefixed LLM errors
  • Optional provider failover chain
  • Durable call ledger (llm_calls.db)
Chaos injection is opt-in (KAZMA_CHAOS_ENABLED) Chaos Docs
EN · AR · Full RTL

Bilingual by Design: Full English & Arabic

Every surface ships in English and Arabic — UI, docs, and generated documents — with per-request RTL. Gulf greetings short-circuit; they are not a dialect model.

Full English UI Complete interface, docs, and agent replies.
Native Arabic & RTL Per-request RTL layout with MSA search normalization.
Majlis protocol Greeting/farewell short-circuit on the gateway — not a Settings toggle.
Full English & MSA · GCC Arabic · RTL UI النسخة العربية
Decentralized Swarms

Breaking the Chains of Rigid Pipelines

Six dispatch patterns (dispatch, broadcast, pipeline, fan-out, consult, conditional). A worker autoscaler fires only when a task asks for workers=["auto"] and no capable worker is registered.

Interactive Swarm Dispatch Engine

6 battle-tested dispatch patterns built directly into the LangGraph supervisor core.

Dynamic Autoscaling Enabled

Fan-Out & Voting

Parallel Consensus
Topology: 1 → [3 Parallel] → 1

Dispatches identical or partitioned tasks across multiple isolated workers simultaneously, aggregating outputs via weighted voting or consensus deduplication.

Execution Flow Nodes

Supervisor Worker Alpha (Coder) Worker Beta (Tester) Worker Gamma (Security) Consensus Aggregator
Recommended for: Complex audits, competitive code synthesis, and high-assurance verification.
From the workshop

Built alongside Kazma.

These aren't products “powered by” Kazma as a runtime stack — they grew up next to it. Each one taught us something about agents, trust, and real interfaces, and that craft shaped the framework in return.

IndexArc

Open Source

A portable personal vault for secrets, API keys, tokens, and notes. Auto-extracts multiple values from a single paste, organizes scattered credentials, and answers queries in English and Arabic. Works fully offline (Ollama) or cloud (Gemini).

TypeScript · Kazma workshop
IndexArc on GitHub

ShipX

In Development

A conversational commerce intelligence engine — unifies entire commerce operations across WhatsApp, Instagram, Email, and Web. Catalog browsing, price bargaining, payment links, courier dispatch, order tracking, returns, and fraud screening — all in Khaleeji Arabic with full GCC data sovereignty.

Python · Kazma workshop
In Development

KCA

In Development

A unified executive command center — a real-time dashboard that brings multi-departmental operations, smart task delegation, company metrics, and integration bridges into one cockpit. Auto-converts business events into assigned tasks with progress tracking and a bidirectional Arabic/English interface.

Python · Kazma workshop
In Development
Self-hosted install

Run it on your machine.

One path below. On Windows, .\setup.ps1 then kazma serve is the operator path. No cloud account required.

~/kazma — bash
Python 3.11+ · uv
# 1. Clone the monorepo
$ git clone https://github.com/Mubder/kazma && cd kazma
# 2. Sync all extras (rag, ide, channels)
$ uv sync --all-extras
# 3. Launch the Web coordinator & dashboard
$ kazma serve
# 4. (Optional) Launch the Terminal UI
$ kazma-tui