Sulcus v3.1 Documentation

Sulcus Documentation

Sulcus is a Semantic Virtual Memory Management Unit (VMMU) for AI coding agents. Run 100% locally with embedded PostgreSQL 17 and CPU embeddings, or coordinate teams across repositories through Sulcus Cloud and Managed Private VPC appliances.

Semantic VMMUSystem 1 + SIU16 IDE & CLI HarnessesLocal-First + Cloud Sync
01 · Core Paradigms

How Sulcus Thinks About Memory

Traditional RAG dumps raw chunks into every prompt until your context window saturates. Sulcus models memory as a living, thermodynamic knowledge system.
Paradigm 01

Map vs. Territory

Sulcus separates the lightweight Map (pointer_summary, 384-d BGE vector, archetype, heat) from the heavy raw Territory. Agents scan compact pointers in milliseconds and call page_in only when a specific memory faults.

Paradigm 02

Thermodynamic Salience

Every node carries current_heat (0.0 to 1.0) and stability. Useful memories gain heat and stability when recalled; ignored episodic chatter cools naturally and folds into consolidated synthesis nodes.

Paradigm 03

Multi-Channel Context

Harness hooks deliver three distinct XML blocks: <sulcus-memories> for recalled knowledge, <sulcus-peers> for live Agent Bus collisions and broadcasts, and <sulcus-namespaces> for linked peer repositories.

02 · Zero-Secret Workstation Setup

Install & Connect in 60 Seconds

The sulcus binary embeds PostgreSQL 17 on 127.0.0.1:4201, runs pure-Rust System 1 curation over local BGE-small-en-v1.5 CPU embeddings, and proxies MCP stdio without committing secrets into project files.
bashWorkstation Install, Login & Harness Wiring
# 1. Install the native Rust sulcus binary (includes embedded PostgreSQL 17 + CPU embeddings)
curl -fsSL https://sulcus.ca/install.sh | bash

# 2. Authenticate against Sulcus Cloud, your Private VPC, or run 100% offline
sulcus login

# 3. Wire zero-secret MCP configuration into Junie, RubyMine, VS Code, Claude Code, Codex, or OpenCode
sulcus connect

# 4. Verify workstation identity, dynamic libraries, seat lease, and daemon health
sulcus doctor
json.mcp.json / .junie/mcp/mcp.json (Zero Embedded Secrets)
// Written automatically by `sulcus connect` (no raw API keys stored in project repos)
{
  "mcpServers": {
    "sulcus": {
      "command": "sulcus",
      "args": ["mcp-proxy"]
    }
  }
}
Automatic Local Fallback
sulcus mcp-proxy reads credentials from ~/.config/sulcus/sulcus.ini (or macOS Keychain when sulcus login --keychain is used) and forwards MCP calls with X-Sulcus-Machine-Id and X-Namespace. If no remote server is configured, it routes automatically to your local 127.0.0.1:4203 daemon or embedded stdio engine.
03 · Memory Taxonomy

Golden Index Archetypes & Decay Classes

System 1 (SIVU quality gate + SICU 5-class router) classifies incoming turns automatically, or you can specify memory_type and decay_class explicitly.
fact365d · 5,000 turns

Verified architectural invariants, schemas, endpoints, and security contracts.

Default floor: 0.15 · "PostgreSQL 17 runs pgvector HNSW; API keys are stored as SHA-256 digests."
procedural180d · 2,000 turns

Step-by-step runbooks, release workflows, debugging recipes, and learned CLI undos.

Default floor: 0.08 · "Run bundle exec rspec spec/services/ before publishing webhook schema changes."
preference90d · 1,000 turns

Standing engineering conventions, code review rules, and operator preferences.

Default floor: 0.10 · "Prefer raw parameterized SQL via sqlx over heavy ORM abstractions."
synthesis60d · 800 turns

Distilled high-salience summaries consolidated from older episodic debugging clusters.

Default floor: 0.05 · "Consolidated 14 webhook debugging turns into canonical replay tolerance rules."
semantic30d · 500 turns

Domain concepts, service boundaries, and cross-repository architectural context.

Default floor: 0.05 · "Two-Gate Namespace ACLs combine namespace policy rules with archetype filtering."
episodic24h · 50 turns

Time-bound session notes, active task state, and transient investigation breadcrumbs.

Default floor: 0.01 · "Investigating passive wheel listener behavior in ProviderComparisonRevolver."
Per-Node decay_class Multipliers
volatile0.5x half-life

Cools twice as fast; ideal for scratch debugging hypotheses.

normal1.0x half-life

Default multiplier inheriting the archetype baseline profile.

persistent2.0x half-life

Cools half as fast; ideal for long-lived service conventions.

permanentNo decay

Immune to decay without consuming pinned active-index slots.

04 · Programmatic Integration

Python & TypeScript SDK Quickstarts

Zero-dependency official clients for custom agents, pipelines, and backend services.
pythonPython SDK (sulcus)
from sulcus import Sulcus

client = Sulcus(api_key="sk-...")

# Store a standing preference with persistent decay (2.0x half-life) and a heat floor
client.remember(
    "Build release artifacts locally before deploying",
    memory_type="preference",
    decay_class="persistent",
    is_pinned=True,
    min_heat=0.35,
    key_points=["local release builds", "zero server compilation"],
)

# Store a verified architectural fact in a repository namespace
client.remember(
    "Keycloak OIDC RS256 tokens authenticate multi-tenant API sessions",
    memory_type="fact",
    namespace="shared-platform",
)

# Hybrid vector + BM25 + graph resonance recall
results = client.search("authentication and build rules", namespace="shared-platform")
for m in results:
    print(f"[{m.memory_type}] {m.pointer_summary} (heat={m.current_heat:.2f})")

# Explicit relevance feedback reinforces high-signal nodes and trains SIRU
client.feedback(results[0].id, "relevant")
typescriptTypeScript & Node.js SDK (sulcus)
import { Sulcus } from "sulcus";

const client = new Sulcus({ apiKey: process.env.SULCUS_API_KEY! });

await client.remember("Verify Stripe HMAC signatures with constant-time compare", {
  memoryType: "procedural",
  decayClass: "persistent",
  minHeat: 0.25,
  namespace: "payments-rails",
});

// Assemble token-budgeted working context in a single call
const context = await client.buildContext({
  query: "webhook signature verification",
  tokenBudget: 1800,
  namespace: "payments-rails",
});

console.log(context.formattedBlock);
POST/api/v1/agent/ingest
Single-pass BGE turn ingestion with System 1 gating, graph linking, and conflict checks
POST/api/v1/agent/search
Hybrid semantic, BM25, recency, and graph spreading-activation search
POST/api/v1/agent/bus/heartbeat
Live session presence, active file territory, and collision detection
POST/api/v1/namespaces/links
Persistent cross-repository recall links (auto_search and on_match)
POST/api/v1/agent/ledger/undo
Out-of-order surgical hunk undo and LIFO batch rewind
POST/mcp
Streamable HTTP Model Context Protocol JSON-RPC 2.0 endpoint