Skip to content

Get started ​

Before you build

Read the capability catalog first. It lists every unit with a "use this when" line and its key exports, the runtime paths with the credential each needs, and the known gaps. Reuse what is there; name the gap you fill when nothing fits.

Install one package ​

Every package is published independently. Take the one you need; there is no meta-package and nothing pulls the rest of the DAG in behind your back.

sh
npm install @titan-design/store-sqlite

Requirements that apply to all of them:

  • Node 20 or newer, and ESM only. There is no CommonJS build; require() will not work.
  • zod v4 is a peer dependency of registry, daemon, agent, agent-protocol, authority, hitl, memory, workflow, chat-protocol, messaging, code-read, session-analytics, and the three style-* packages. Install it yourself so one copy is shared: npm install zod.
  • web-tree-sitter is a peer of code-parser and style-analyzer.
  • React 18 or 19 is a peer of react-app, with Vite optional for its ./vite entry.
  • @huggingface/transformers is an optional peer of embed and retrieval. Without it, embed's local backend and retrieval's cross-encoder reranker are unavailable and every other path still works.
  • Packages that store anything depend on better-sqlite3, which builds a native addon on install.

A first example ​

This opens a database, installs two kit tables, indexes a piece of text for full-text search, and links two entities with an edge. It is the shape most things here start from.

ts
import {
  EdgeTable,
  SpanFtsTables,
  kitMigration,
  openDatabase,
  ref,
  runMigrations,
} from "@titan-design/store-sqlite";

const db = openDatabase(":memory:"); // WAL and foreign keys on; a path works the same
runMigrations(db, [kitMigration(1, { edge: true, spanFts: "search" })]);

const spans = new SpanFtsTables(db, { name: "search" });
const text = "the daemon returns 503 until the pid file exists";
spans.index(
  { ownerRef: ref("session", "abc"), field: "prompt", sourceId: 1, byteOffset: 0, byteLength: text.length },
  text,
);

console.log(spans.search("daemon OR 503", 5).map((hit) => hit.ownerRef));
// [ 'session:abc' ]

const edges = new EdgeTable(db);
edges.assert({ sourceRef: ref("session", "abc"), relation: "touched", targetRef: ref("file", "repo/a.ts") });
console.log(edges.from("session:abc").map((edge) => edge.targetRef));
// [ 'file:repo/a.ts' ]

Two things in there are load-bearing everywhere else on this site.

Refs. ref("session", "abc") is just the string session:abc. Every domain mints refs for its own entities and the edge table links them, which is how a session graph and a code graph end up in one queryable space without either knowing about the other.

The FTS index stores no text. spans.index records a byte range and feeds a contentless FTS5 table. Searching gives you back a locator, and locator reads the original bytes out of the source file. Nothing duplicates the corpus.

Try the whole DAG at once ​

The session miner is a working product built from ten of these packages. It is private, so run it from a checkout rather than npm:

sh
git clone https://github.com/HJewkes/titan-platform
cd titan-platform
pnpm install && pnpm build
node products/session-miner/dist/bin.js refresh   # index your Claude Code transcripts
node products/session-miner/dist/bin.js search "daemon 503 at startup"

refresh reads ~/.claude/projects and writes to ~/.local/state/titan-session-miner. Both are overridable with --corpus and --state. Every command takes --json and returns the same envelope the HTTP and MCP surfaces return.

The case study walks through which package does what in that pipeline.

Run the products ​

Five units in this repo run as programs. All are private, so each runs from a checkout after pnpm install && pnpm build. Each has a usage guide with every command, where its state lives, and how it fails.

UnitWhat it doesGuide
products/factorytitan-factory lands pull requests with durable runs and human gatesFactory, Shepherd
products/session-minertitan-miner indexes and searches agent transcriptsSession miner
products/retrieval-evalretrieval-eval scores retrievers against mined labelsRetrieval eval
apps/codewatcha browser report over a code-graph snapshotCode report
apps/consolea read-only console over active-work, the agent-chat broker and the session graph (skeleton)README
deploy/hubthe Matrix homeserver the human queue usesMatrix hub

Where each package fits ​

Pick by problem:

ProblemPackage
I need SQLite tables for a graph, a search index, or an ingest watermarkstore-sqlite
I need to point at a byte range in a file instead of copying its textlocator
I need to group thousands of error blobs into a handful of templatescluster
I need embeddings, but not a mandatory model downloadembed
I need search that keeps working when a retriever is downretrieval
I need to run a headless Claude Code or Codex session with a hard budgetagent
I need one command definition to serve a CLI, MCP, and HTTPregistry
I need to host that on a loopback port with health, SSE, and a pid filedaemon
I need to pause work on a human and resume it from another processhitl
I need to read Claude Code or Codex transcriptssession-read
I need those transcripts as a queryable, incrementally maintained graphsession-graph
I need the import and call graph of a TypeScript or Python tree, with metrics and checkscode-graph
I need a rule playbook whose confidence decays with evidencememory
I need a long-running process that survives a restart mid-flightworkflow
I need to run many agent steps under a concurrency and budget capworkflow (mapItems)
I need a durable record of which process owns a running agentagent-lifecycle
I need identity and usage types that do not care which harness ranagent-protocol
I need a cost report, roles, or episodes over mined sessionssession-analytics
I need to parse TypeScript or Python with tree-sittercode-parser
I need a read API over a code graph that a browser can callcode-read
I need to learn a repo's code style and enforce itstyle-analyzer, style-profile, style-checker
I need to check that a model's cited lines really say what it claimsevidence
I need to decide whether an actor may merge, release, or read a secretauthority
I need to read and change GitHub through gh, with writes that are safe to repeatgithub
I need to prove a fix PR's new tests fail on the base and pass at headfix-proof
I need to stop home paths and private terms from reaching a public repoegress-scan
I need to start or resume an agent-chat agent from codeagent-dispatch
I need the envelope, routes, and SSE vocabulary a daemon and its clients sharerpc-protocol
I need a typed daemon client in a browser, live or from a snapshot filerpc-client
I need React hooks and a Vite preset for a daemon-backed appreact-app
I need one chat message shape across every agent-chat surfacechat-protocol
I need to send and receive over iMessage or Telegrammessaging
I need to talk to a Matrix homeserver without an SDKmatrix-bus
I need human approvals and questions to show up in a Matrix roomqueue-mirror

The package families guide groups these by the job they share.

MIT licensed