Compendium · as of 2026-06-17

ctx.

The memory your LLM pretends to have.

A comprehensive documentation of the knowledge store — what was, what became, what is and what will be — with a fresh comparison against gbrain, Langdock, Microsoft Azure AI and the wider memory, RAG and enterprise-AI landscape.

github.com/GottZ/ctx License MPL-2.0 7 chapters · 55 features 9 compared solutions Companion: Planning Report (DE) →

ctx is the self-hosted, MPL-2.0-licensed single-binary memory primitive for the sovereign self-operator: a Go monolith (ctx CLI + ctxd daemon) on PostgreSQL 18 + pgvector + TimescaleDB that unifies hybrid fusion (4-Way RRF), Cross-Encoder reranking, cyclic Temporal Gravity, latent LLM-inferred cross-reference links, and Scope isolation all within ONE Postgres transaction over the same tables — with no external vector/graph store, no network hop, and fully local llama.cpp inference at $0 ongoing cost. Its unique design center is the vendor-neutral Cross-LLM/Cross-Tenant knowledge bridge (Scope model private/hth/shared), which shares a single searchable memory across multiple Claude instances and Anthropic Tenants instead of fragmenting knowledge into proprietary cloud silos or polyglot-persistence stacks.

In the market for memory/knowledge/RAG solutions, ctx occupies the position of a deliberately focused, fully sovereign self-hosted primitive. While the field splits into two broad groups — heavyweight proprietary enterprise platforms (Glean, Langdock, Microsoft Azure AI/Foundry) and open-/open-core agent memory layers (Mem0, Letta, Zep/Graphiti, gbrain), plus pure vector infrastructure (Pinecone/Weaviate/Qdrant) and the vendor-locked, LLM-native features (ChatGPT/Claude/Notion Memory) — ctx collapses the entire memory pipeline into a single Go monolith on one PostgreSQL 18 instance: 4-Way RRF hybrid fusion (semantic pgvector + EN-FTS + DE-FTS + Trigram-Title, k=60), Cross-Encoder reranking (bge-reranker-v2-m3), cyclic Temporal Gravity, and LLM-inferred latent links all run as SQL over the same tables — no network hop, no external vector or graph store, and no ongoing API costs (llama.cpp on-prem, $0).\n\nIn a direct comparison, ctx is largely convergent in its retrieval core with its closest relatives (gbrain, Letta self-hosted, and Graphiti likewise use pgvector HNSW + FTS + RRF), but it differentiates itself along four axes: LLM-inferred LATENT links instead of merely explicitly set/extracted edges; a fine-grained cyclic-temporal model (7 cyclic dimensions + Gaussian Decay) instead of plain recency/valid_until/TTL; consistently all-local/$0 as its default identity rather than a hosted default with a local option; and a Cross-LLM/Cross-Tenant memory bridge as an explicit design center. Where the competitors lead is clearly delineated: public, reproducible benchmarks (Mem0, Zep, gbrain with LongMemEval/BrainBench/LoCoMo); deterministic relational graph traversal at query time (gbrain graph-query, Zep/Graphiti BFS + node-distance, Mem0 Neo4j multi-hop); production-grade multi-tenancy and horizontal scaling (all platforms); and feature breadth plus mindshare (gbrain ~23k stars, Mem0 ~58.8k, Zep 27.6k). ctx is therefore not a platform competitor but rather the lean, data-sovereign counter-model with its own distinctive retrieval depth.

I
Origin & Motivation

What was

ctx was born in January 2026 as a response to two concrete problems: context drift (Claude instances lose and distort knowledge across sessions, made worse by the conservatively biasing Constitution filter) and context-window scarcity. The first-order architectural decision was "the brain first" — before any agent framework, inference scaler, or workflow system, the central persistence layer was built first. The path there ran through a pragmatic chain of evolution (n8n MCP → webhooks → Bun → Go) and a 92-sub-agent armada that decided the language comparison neutrally. By April 2026 this gave rise to the W-System (RLHF warnings) and the armada pattern — both made possible only on the basis of accumulated, persisted insights.

  1. January 2026ctx project started — the "brain first" decision as architectural foundation
  2. Jan–end of March 2026Chain of evolution n8n MCP → webhooks → Bun → Go; GSD in use as the workflow framework
  3. Jan–March 202692-sub-agent armada evaluates the target language neutrally — result: Go; rewrite as a "one hour problem"
  4. Early April 2026Custom W-System (14 warnings) and armada with a red/blue team replace GSD
  5. 2026-04-0920 commits in 9 hours (v0.13 → v0.17, including OAuth/MCP)
  6. 2026-04-10First MCP session with Claude Chat
The context-drift problemKnowledge that is lost across sessions and systematically distorted

The actual trigger for ctx: Claude instances lose and distort knowledge across sessions. This is made worse by the Constitution filter, which systematically shifts knowledge in a more conservative direction at every handover — so information is not merely forgotten but actively bent in one direction. On top of that came context-window scarcity: originally 256k tokens, continuously eaten away by MCPs and skills. ctx is the answer to both problems at once — an external, reliable knowledge layer that does not drift.

motivationcontext-driftconstitution-filtercontext-window
"The brain first"Persistence as a first-order architectural decision — ahead of everything else

With the setup already in place, GottZ could have built a multi-GPU inference scaler, an agent framework, or a workflow platform. The deliberate decision was instead to build the persistence layer first. In his own words: "because I need the brain first, before I implement anything else … without central control over information, no other project can be implemented in any meaningful way. Not with my warnings, and not with my armada either." The W-System and the armada pattern both operate on insights accumulated over time — without a brain to hold those insights, neither could function. Persistence was therefore the precondition for everything that followed, not a downstream feature.

decisionfirst-principlesarchitecturepriorities
Persistence as a multiplier (re-evaluated with 1M context)Not a workaround for context limits, but a lever that grows along with the context

A key conceptual correction: persistence is not merely a workaround for scarce context windows. Even with a 1M-token context, ctx remains valuable — the image is the "big bucket with a bottom that becomes more valuable the bigger the bucket gets." The more context that is available, the more value a reliable persistence layer unfolds, not less. This positions ctx as a multiplier of an LLM's capabilities, not a crutch that better hardware would render obsolete.

motivation1m-contextmultiplierre-evaluation
Chain of evolution: n8n → webhooks → Bun → GoFrom bloated n8n MCP through lean webhooks and Bun to a Go monolith

The technical genesis ran through clearly documented stages. (1) First idea: wire n8n MCP into Claude to store knowledge blocks with pgvector and make them findable. (2) n8n MCP discarded — "garbage. too bloated. you get the entire input back as output as well. it talks too much." (3) n8n webhooks as a leaner alternative on the same basic idea. (4) An API key added as an auth layer. (5) A standalone Bun/TypeScript build — "quickly discarded again." (6) After the language comparison, the switch to a Go monolith. Today the system consists of two binaries (the ctx CLI + the ctxd daemon) under MPL-2.0, with packages such as auth, store, rrf, dream, digest, and guard — the lean consequence of this chain.

evolutionn8nbungomonolith
The Go rewrite — "a one hour problem"The complete rebuild from TypeScript+n8n to Go in roughly one hour

The result of the neutral language evaluation was Go. The actual porting effort was minimal: "the entire ctx rewrite from typescript with n8n to golang was a one hour problem." This was possible because the substance of the matter (data model, pgvector retrieval, auth) had already been worked out through the previous stages — the rewrite only had to pour a proven idea into a better language. From this step came today's Go monolith (Go 1.26 in the repo), which bundles API, Guard, Dream, Digest, and MCP into a single binary.

gorewritevelocitymonolith
92-sub-agent armada for the language comparisonThe choice of language was not decided, but neutrally evaluated by 92 agents

Rather than picking the target language out of familiarity or gut feeling, an armada of 92 sub-agents was set up to evaluate the language candidates neutrally against one another. The result was Go. This step is emblematic of the project's entire way of working: it is not the author who decides on a hunch, but a parallelized, structured apparatus that delivers a neutral result, which is then followed. The armada as an evaluation tool is already present here at the core, long before it became the fixed red/blue-team pattern.

armadalanguage-evalneutral-evaluationgosub-agents
Methodology principle: tools instead of learningKnowledge gaps are covered by tools with neutral output, not by learning

The load-bearing methodological principle behind ctx and its emergence: "I built myself tools that cover my ignorance and deliver neutral results. The output speaks for itself." Knowledge gaps are not compensated for by learning oneself — that is too slow — but by tools that produce structured, neutral output. Combined with consistent parallelization, this leads to enormous speed: "moved more in 20 minutes than others do in 14 days." ctx itself is the first and most fundamental incarnation of this principle — the tool that covers memory.

methodologytoolsparallelizationneutral-outputprinciple
GSD, then a custom W-System + armadaFrom a borrowed workflow framework to a custom warning and red/blue-team pattern

Until the end of March 2026, the workflow framework was GSD (glittercowboy's repo). In early April 2026 it was replaced by a custom W-System with 14 RLHF warnings and a custom armada with a red/blue-team structure. Both build directly on the persistence layer: the W-System steers behavior based on accumulated insights, and the armada verifies adversarially against stored knowledge. This closes the loop back to the foundational "the brain first" decision — only once persistence was in place did the behavior and verification systems that depend on it come into being.

gsdw-systemarmadared-blue-teamwarnings
v2 outlook from a historical perspectiveThe brain is deepened, not broadened horizontally into other tool categories

The thrust of future versions was clearly outlined early on: "The brain can be extended much more deeply later as a v2." v2 thus means deepening the brain itself — better retrieval, synthesis, and persistence capabilities — and explicitly not horizontal expansion into other tool categories. A multi-GPU inference scaler and full-fledged agent frameworks were deliberately deferred to v3+. The order of the genesis (the brain first, then behavior/verification on top of it) thus continues as the logic of the roadmap.

roadmapv2visiondepth-over-breadth
II
Evolution & Transformation

What became

ctx did not emerge in a single stroke; it matured into its current form through a chain of upheavals and rewrites. An n8n MCP experiment in January 2026 turned into a Go monolith by way of webhooks and a short-lived Bun/TypeScript stack; Ollama gave way to llama.cpp across the board; and a weak weighted-sum search gave way to the 4-Way RRF with cross-encoder reranking. Every transformation is empirically validated — and the deliberately rejected paths that kept the system lean are just as instructive.

  1. Januar 2026ctx project started: n8n MCP wired into Claude to make knowledge blocks storable and retrievable via pgvector.
  2. Jan–Ende März 2026Evolution chain: n8n MCP → n8n webhooks (+ API-key auth) → Bun/TypeScript standalone (quickly abandoned) → Go monolith. A 92-sub-agent armada evaluated the language candidates neutrally; the result was Go. GSD (glittercowboy) served as the workflow framework.
  3. Anfang April 2026GSD replaced by a custom W-System (14 Warnings) and a Red/Blue-team armada. 2026-04-09: 20 commits in 9 hours (v0.13→v0.17 + OAuth/MCP). 2026-04-10: first MCP session with Claude Chat.
  4. 2026-04-20 → 2026-04-23 (Session 24)Dream reset: pre-reset baseline (53% correct at raw_conf≥0.7) → re-dream with an ideal line → Dream-Prompt v3 (62.3% accuracy, +19.7pp over the pre-reset 42.6%).
  5. 2026-05-22/23 (Session 38, v1.6.x)Wave-46 convention switch for supersedes (src=old → src=newer) + a full re-dream over 489 blocks; supersedes VALID rate 0%→80%, overall VALID 64%→90%.
  6. ~April–Mai 2026Inference-engine migration: Ollama removed entirely, switched fully to llama.cpp (ggml-org/llama.cpp:server). Embedding offloaded to a CPU-side container, freeing the GPU for chat/rerank.
  7. v2.0.0 (Juni 2026)Scope generalization: scope changed from a chk_scope enum → VARCHAR(50) (migration M044) as the foundation for Multi-Tenant.
  8. 2026-06-08/09 (Wave 2/3)Cross-encoder reranking newly live (bge-reranker-v2-m3, herbert-rerank), proven via live A/B + a 14-agent review — with a nuanced verdict: it helps on surface-level queries and hurts on latent graph gold.
  9. bis 2026-06Web frontend complete per a 41-wave masterplan (G01–G41) across 6 axes; the Block Workbench followed as the first subsequent wave. Models: synthesis/Dream on qwen3.6:27b.
TypeScript/n8n → Go monolithThe rewrite that was "a one-hour problem" — driven by a 92-agent language armada.

The first ctx idea ran on n8n: first as an MCP server inside Claude, then — because that MCP was "garbage, too bloated" (it returned the entire input as output and "talked too much") — via leaner n8n webhooks with API-key auth. A Bun/TypeScript standalone attempt was "quickly abandoned again." Rather than picking the language by gut feeling, GottZ built a 92-sub-agent armada to compare the candidates neutrally — a methodological principle: "I built myself tools that cover my ignorance and deliver neutral results." The result was Go. The actual port was trivial — "the entire ctx rewrite from TypeScript with n8n to Go was a one-hour problem." What came out was a single-binary monolith (CLI ctx + daemon ctxd) with its own inference client, its own migrations (embed.FS), and LISTEN/NOTIFY-based async processing.

rewritegon8narmadalanguage-comparison
Ollama → llama.cpp across the boardInference engine swapped out entirely; every role now speaks the OpenAI wire protocol.

Until around April 2026, all inference ran on Ollama. It was switched fully to llama.cpp (image ghcr.io/ggml-org/llama.cpp:server) and Ollama was removed entirely. Every backend has since spoken the OpenAI wire protocol, and the routing of roles (chat, synthesis, Dream, digest, classify, translate, rerank, embedding) runs through the context_backends table. A pivotal step was moving the embedding service off the GPU onto a CPU-based llama.cpp side container (llama-embed) on the ctx host — this frees VRAM for chat/rerank on the RTX 6000 but turns the bulk embedding rebuild into a CPU bottleneck. Synthesis/Dream today run on qwen3.6:27b (herbert-chat, @96k context), reranking on bge-reranker-v2-m3 (herbert-rerank), and embedding on qwen3-embedding-8b (1024d Matryoshka from a native 4096d).

llama.cppollamainferencecontext_backendscpu-embed
RRF maturation — weighted sum → 4-Way RRFFrom a broken weighted sum to weighted Reciprocal Rank Fusion across four signals.

Retrieval started as a weighted sum — which failed because ts_rank and cosine similarity have incompatible score distributions and cannot be meaningfully added. It was replaced by a 3-way hybrid fusion (dense pgvector + sparse tsvector + trigram pg_trgm) built on Reciprocal Rank Fusion, which combines ranks instead of raw scores. The maturation step was the extension to today's 4-Way Weighted RRF (k=60): Semantic 0.45 + English FTS 0.25 + German FTS 0.20 + Trigram Title 0.10. The fourth channel (German FTS, weight 0.20) was added once the bilingual gap had been identified as 75% of the retrieval problem — German queries against purely English titles returned effectively zero FTS hits. The entire fusion runs in ONE SQL transaction over the same tables, with no network hop to an external vector store.

rrfretrievalweighted-sumbilingualfusion
Cross-encoder reranking — new, with a surprising verdictbge-reranker-v2-m3 live as a dedicated reranker — but empirically useful for only one query class.

For a long time ctx had NO cross-encoder; reranking was RRF alone. In Wave 2 (2026-06-08), bge-reranker-v2-m3 was added as a local llama.cpp sidecar (port 8082), proven via live A/B (5 surface-level queries) and a 14-agent review that caught two scale bugs in the process. The real insight came out of Wave 3 (47 verified gold cases, sweep.py): the cross-encoder did NOT raise the recall ceiling (a reorderer cannot surface anything RRF does not deliver) and was net zero-to-negative on latent gold — it scores surface similarity, but the gold rewarded latent link relevance. Hard-coupling graph+ce was even destructive (R@10 0.571 instead of 0.715 for graph alone), because the CE re-ranks the graph-injected latent neighbors back out. Production verdict: graph default-ON, rerank default-OFF, until real surface-level gold exists; if the CE is enabled, then with a blend of bw=0.5 and never as the final arbiter. Two pipelines for two query classes instead of one winner.

cross-encoderbge-rerankerrerankingwave-3empirical
41-wave web frontendFrom headless CLI to a complete dashboard/chat/graph/workbench in 41 coordinated waves.

ctx was originally pure CLI + API. The web frontend was built per a masterplan of 41 waves (G01–G41) along six axes: F1 config core, F2 settings, F3 backend pool + trust, F4 SPA, F5 graph, and F6 chat. Concretely, the waves delivered the dashboard/settings, a chat client, a graph map (a Louvain-cluster supergraph over the dream_links, v3.15.0), and a backend pool with a vault editor (G32) for provider failover. After the 41-wave plan was completed, the Block Workbench (CRUD, v3.16.0) was built as the first subsequent wave. Important: the graph map is an overview visualization, NOT query traversal — at query time the dream links are still used only as a supersedes drop filter.

frontend41-wavesgraph-mapworkbenchlouvain
v2.0.0 scope generalizationscope from an enum (chk_scope) to VARCHAR(50) — the foundation for Multi-Tenant.

In v2.0.0 the Scope model was generalized from a hard CHECK-constraint enum (chk_scope, originally private/work/shared) to a generic VARCHAR(50) (migration M044). Scopes have since been configurable strings rather than hardwired values — the prerequisite for building Multi-Tenant (Model C: Tenant/Scope/Block levels + cross-tenant grants) on top of them. This generalization is part of a continuous line from "hardcoded mechanism → configurable policy": the later core-redesign decision (block_role enum → dynamic type configs, 2026-06-01) is explicitly "the same line, one level deeper" — mechanism (embedding, RRF, Guard, Dream) stays code, policy becomes data.

scopev2.0.0migration-m044multi-tenantpolicy-as-data
Dream-Prompt iterationsFrom the 53%-correct raw state through v3 to the production-optimal v5 — v6 and v7 did not survive.

The Dream cross-reference engine matured primarily through its LLM prompt. Pre-reset (2026-04-20), accuracy at raw_conf≥0.7 was only 53% (47% error rate): factual overused, supersedes drastically underproduced (13/1836), causal lacking a temporal check. From that came Prompt v3 (Session 24, 2026-04-23): topical-as-fallback default, supersedes VERY RARE, causal accepting decision→implementation — 62.3% accuracy on the top-50 hardest cases (+19.7pp). Wave 46 (Session 38) additionally flipped the supersedes convention (src=old → src=newer) and brought the supersedes VALID rate from 0% to 80%. The later inference-reduction study (W49c) then rejected both v6 AND v7: prompt variants do raise real recall but cost none precision; production-weighted (real candidate sets are 70–85% none), v5 dominates (best none precision 0.776) — v5 is production-optimal. minRawConfidence was unified at 0.7 for all types (qwen3.6 has uncalibrated confidence).

dreamprompt-iterationv3v5supersedesaccuracy
Empirical lessons + deliberately rejected pathsWhat was tested and rejected shaped ctx as much as what remained.

ctx was shaped by live tests on the real corpus, not by assumptions. Rejected: n8n (too bloated, talks too much); Q8_0/FP16 in favor of Q4_K_M (higher weight precision → more paraphrasing → keyword coverage drops from 94% to 88%, worse for RAG); models >9B for synthesis (tested up to ~22B, larger ones do not extract better; qwen3.5:9b also beat Gemma candidates — reasoning modes eat the token budget, with a death spiral under native thinking: 19.4x token overhead); the samplers Mirostat/tfs_z/typical_p; an external vector store (Qdrant/Weaviate/Milvus) — rejected because it costs ACID transactions, JOINs/CTEs, and atomicity, and offers no real performance advantage below ~5M vectors; JSONB temporal_coords (in favor of the EAV context_temporal table with O(log n)); content_dates DATE[]; a 5th RRF channel; SQL gravity functions; a cosine pre-filter; two-pass synthesis; the GSD planner. Further validated lessons: FTS month names had a 75% false-positive rate (removed, only ISO+YYYY-MM); the embed prefix caused an 18.6% centroid shift (disabled); Guard thresholds 0.95/0.85 had 80% FP (raised to 0.98/0.92); agent claims are factually wrong about 1 in 8 times (always verify against the code).

empiricalrejectedq4_k_mexternal-vector-storeyagni
III
The feature complex today

What is

Retrieval & Temporal

ctx retrieves knowledge via the GottZ 4-Way RRF: a single PostgreSQL transaction fuses semantic pgvector search, English and German full-text search, and trigram title matching through weighted Reciprocal Rank Fusion (k=60). On top of this sit a fully deterministic temporal pipeline with 18 pattern matchers, the physics-inspired GottZ Cyclic Phase Model (7 cyclic dimensions with Gaussian decay), and — added recently — a dedicated cross-encoder reranking stage (bge-reranker-v2-m3). The final LLM synthesis (qwen3.6:27b, think:false) extracts only substantiated facts from the sources. The constants given here are taken directly from the source code (migration 048, config.go, gravity.go) and in some cases correct outdated figures from earlier briefings.

GottZ 4-Way RRFFour retrieval signals fused inside a single Postgres transaction via weighted Reciprocal Rank Fusion — no external vector store.

The PL/pgSQL function ctx_rrf (migration 048_rrf_exclude_params.sql) computes a weighted RRF score per candidate across four parallel CTEs: Semantic (pgvector HNSW cosine over halfvec(1024), weight 0.45, LIMIT 75 candidates), English FTS (ts_rank_cd over ts_en, 0.25, LIMIT 100), German FTS (ts_de, 0.20, LIMIT 100), and Trigram Title (pg_trgm similarity, 0.10, similarity > 0.05, LIMIT 30). The fusion uses the classic 1.0/(60 + rank) formula per channel with k=60, joined via a FULL OUTER JOIN across all four result sets. Each term is additionally multiplied by a block_mass factor (1/sqrt(number of content_times), which dampens mega-blocks) and a block_role_factor (audit-trail damping). Filtering is applied on NOT is_archived, block_role != 'system-meta', scope = ANY(read_scopes), plus optional category/tags/exclude lists. Go invokes the function with exactly one SQL call (rrf.Search) and internally retrieves 200 candidates so that Gravity, Graph, and the reranker can re-sort on a broad basis before the result is trimmed to the user limit (1-20, default 5). The 5th RRF channel was removed in M020 (it was never enabled from Go).

rrfpgvectorfulltextpostgreshybrid-search
RRF weights, k, and confidence thresholdsSemantic 0.45 / EN-FTS 0.25 / DE-FTS 0.20 / Trigram 0.10, k=60; score thresholds 0.001 (no_relevant) and 0.008 (confident).

The four fusion weights are hard-wired in migration 048: 0.45 Semantic, 0.25 English FTS, 0.20 German FTS, 0.10 Trigram Title; the RRF constant is k=60. Confidence classification runs in the Go layer (llm.ClassifyConfidence) against two thresholds from the config registry (config.go): query.score_threshold default 0.001 and query.confident_threshold default 0.008. maxScore >= 0.008 yields 'confident', >= 0.001 yields 'low_confidence' (then capped at a maximum of 2 sources), and anything below yields 'no_relevant_blocks_found'. Important (verified against config.go, correcting an earlier briefing): the lower threshold is 0.001, not 0.005 — it was lowered in Wave 37 because the mass_factor in the RRF score was pushing large architecture blocks below 0.005 and thus dropping them out of the synthesizer. A config validation rejects score_threshold > confident_threshold (otherwise low_confidence would be unreachable).

rrfthresholdsconfidenceconfigtuning
Cross-Encoder Reranking (bge-reranker-v2-m3)Dedicated post-RRF reranking by a local XLM-RoBERTa cross-encoder — newly live, proven via A/B.

After RRF and Gravity (and before filterSuperseded), a cross-encoder re-scores the candidates. Dispatch goes through the backend routing table: if a backend carries the rerank role, the request goes to the llama.cpp sidecar (rerank.Score speaks the Cohere/Jina wire format /v1/rerank, model bge-reranker-v2-m3 on CPU, up to MaxDocs=50 candidates, with title + up to 2048 characters of content per doc); if the role is missing, it falls back to the historical LLM-as-judge over the synthesis chain (up to 15 docs, 400 characters, JSON score array). The cross-encoder returns RAW logits (which can be negative, e.g. -11..+6); rrf.RerankCrossEncoder maps them onto (0,1) via a sigmoid before blending. Blend: rerankWeight*rerankNorm + (1-rerankWeight)*rrfNorm, default BlendWeight 1.0 (pure cross-encoder ordering, also the final arbiter over graph-injected neighbors). rerank.Score realigns the server response STRICTLY by result.Index (the server sorts descending and trims to top_n — array position is meaningless) and validates gap-free index coverage. Both paths are fail-open: any error preserves the pre-rerank ordering. Because of the CPU latency (~1s per pair), a chunked-body heartbeat (a single space every 25s, a valid JSON prefix) keeps the connection alive through buffering reverse proxies.

rerankcross-encoderbge-reranker-v2-m3llama.cppfail-open
LLM Synthesis (qwen3.6:27b, prompt v5.2/v6)A fact-extraction engine distills the top sources into a substantiated answer — zero external knowledge, inline citations.

After retrieval/rerank, llm.Synthesize builds the answer: filter by score_threshold, confidence classification, low-confidence capping to 2 sources, lost-in-the-middle reordering (best source first, second-best at the end), then the LLM call over the synthesis chain. The model is qwen3.6:27b (backend herbert-chat, RTX 6000), think:false. The system prompt is configurable (config key query.prompt_version): the default is v5.2 ('You are a fact extraction engine for a technical knowledge base'), and the Wave 48 variant v6 with graded confidence is also available (three modes: DIRECT / INFERRED-with-caveat / REFUSAL). Note (verified against synthesize.go, correcting an earlier briefing that mentioned 'v5.3'): the prompt versions defined in the code are v5.2 and v6. The prompt's hard rules: every fact must come from the sources, at most 3 sentences, inline citations [1][2], answer in the language of the question, and on zero hits exactly 'NO_RELEVANT_SOURCES'. A security block instructs the model to ignore any instructions embedded in the sources (prompt-injection protection). Each source is rune-safely truncated to at most 1500 characters; for temporal queries the current date plus resolved references are injected into the prompt. NO_RELEVANT_SOURCES is normalized to 'I don't know based on the available sources.' (locale-agnostic for CRAG judges); if RRF was 'confident', it is downgraded to low_confidence rather than no_relevant.

synthesisqwen3.6prompt-v5.2prompt-v6fact-extraction
Query Translation DE→ENGerman queries are translated into English before search — with a domain glossary and hard validation gates.

llm.DetectGerman identifies German queries by umlauts/ß, >=2 of 50 stopwords, or >=1 of 16 domain tech terms (word-boundary, case-insensitive). On a match, llm.TranslateQuery translates the query into an English search query over the translate chain. The prompt contains a fixed domain glossary (e.g. Schreibschutz = Write Guard, Sicherheitstrennung = Scope Isolation, Duplikat-Erkennung = Duplicate Detection, Kontextspeicher = Context Store, Einbettung = Embedding, Schwellenwert = Threshold, Zugriffsschlüssel = API Key). The translation passes through hard gates: SQL meta-characters are stripped, at most 3x the length of the original, only safe characters (alphanumeric + a few punctuation marks), single-line — otherwise the original query is kept. Key architectural property: only the SEARCH query is translated; the LLM synthesis receives the ORIGINAL (German) query so that the answer is produced in the user's language. The entire step is fail-open (empty/exhausted chain → original query).

translationgermanglossaryfail-openinjection-guard
Temporal Pipeline (NormalizeTemporalRules, 18 matchers)Deterministic, rule-based temporal resolution as PRIMARY (0ms, no LLM) with 18 pattern matchers in a priority cascade.

Temporal resolution is primarily deterministic: llm.NormalizeTemporalRules (temporal_rules.go) runs without an LLM call. There are exactly 18 match* functions (verified via grep), processed in a priority cascade from specific to vague: P1 ISO dates (purely linear) → P2 compound ranges (from-to, linear+weekday) → P3 since/until (linear+month) → P4 week segments → P5 relative weeks → P6 relative months → P7 weekday within a week → P8 relative days (N days ago / in N days, purely linear) → P8a annual holidays (month+seasonal) → P8b month segments (start/end of month, monthday) → P8c time of day (morning/evening, daily) → P9 weekend (weekday-dominant) → P10 multi-keyword (today and tomorrow) → P11 weekday + verb tense → P12 simple keywords including typos. Helper functions: DetectVerbTense/hasPerfektForm (past → LAST, future → NEXT), hasRecurrence ('immer/jeden/dienstags' upgrades to pure weekday weighting), Levenshtein fuzzy matching for typos. Only when the rules return nil AND HasTemporalIntent (whole-token match against ~70 intent words + ISO regex) is true does the LLM fallback kick in (NormalizeTemporal over the translate role, a calendar with an explicit LAST/NEXT table so the model only looks up values instead of computing them).

temporaldeterministicpattern-matcherverb-tenserecurrence
FTS Temporal Expansion (ISO + YYYY-MM only)Temporal matches expand the FTS only with high-precision date identifiers — weekday/month names were discarded empirically.

Resolved dates are translated via TemporalToFTSExpansion into a websearch_to_tsquery OR string that feeds into ctx_rrf as an additional FTS channel. Deliberately kept narrow: only ISO dates (2026-03-23) and YYYY-MM prefixes (2026-03). Weekday names, month names, and calendar-week numbers were removed — empirical finding T07 (Session 22): they caused a 75% false-positive rate in the top 5 because they match any block that happens to mention the word, rather than temporally related blocks. Scaling caps for 1M+ blocks: at most 7 distinct dates get per-day expansion (otherwise the first and last half), with an overall cap of 20 OR terms (GIN cost scales linearly with term count × 2 FTS channels). The actual temporal relevance does NOT run through FTS, but post-RRF via the gravity boost and the context_temporal dimension table. The embed prefix for temporal augmentation is also disabled (T06: it degraded 4/5 queries, ~33% centroid shift).

temporalftsiso-datesfalse-positivesscale-cap
GottZ Cyclic Phase Model7 cyclic time dimensions with Gaussian decay as a post-RRF reranker — 'on Tuesdays' continuously favors Tuesday blocks.

The Cyclic Phase Model (gravity.go) treats every cyclic time structure as an independent dimension with a normalized phase [0,1) and its own Gaussian decay sigma: weekday σ=0.07 (7-day cycle), month σ=0.10 (12-month cycle), quarter σ=0.12 (4 quarters, wider because imprecise), week σ=0.08 (52-week ISO), monthday σ=0.10 (~30-day start/end of month), seasonal σ=0.08 (365 days), daily σ=0.08 (24h time of day). Year remains linear-monotonic (not cyclic). For each matcher the parser sets DimensionWeights (examples from the code: 'am 2026-03-27' → {linear:1.0}, 'am Dienstag' → {linear:0.6, weekday:0.4}, 'immer dienstags' → {weekday:1.0}, 'Q1 Reviews' → {quarter:1.0}, 'im März' → {linear:0.5, month:0.5}). ComputeCyclicGravity computes, per dimension, the CyclicDistance between the query phase and the block phase, applies GaussianDecay = exp(-d²/(2σ²)), and takes the maximum over all anchors of a block (best match, not the sum), then a weighted sum across dimensions. Example σ=0.07: Monday→Tuesday (distance 1/7) decays to ~0.13, Monday→Wednesday (2/7) to ~1e-4 (effectively zero). The boost is multiplicative and capped at a maximum of 0.30 (a 30% score lift), scaling with the sum of the cyclic weights; blocks without a matching dimension get a factor of 1.0 (neutral, no penalty).

temporalcyclic-phase-modelgaussian-decayrerankerdimension-weights
Temporal Gravity (linear) + Dimension TablePhysics-inspired distance gravitation with an asymmetric power law plus an EAV dimension table with O(log n) lookups.

The linear gravity path (ComputeGravity/ApplyGravityBoost) treats blocks as masses in time-space: gravity = Σ 1/dist^power over the content_times relative to the query target date, base power p=1.5, minimum distance 0.5 days to guard against a singularity. The gravitation is asymmetric: future dates get a 1.2× sharper cutoff, past ones a 'forward telescoping' — the backward power is lowered via 1/(1+0.3·ln(1+age/30)) so that older blocks get a wider gravitational well (calibrated against Rubin & Baddeley 1989: older memories are coarser; age=30d → power≈1.24, age=365d → power≈0.86). Cutoff default 14 days (60 for ranges), a direction filter (past/future/both), boost capped at 0.30. The GottZ Temporal Dimension Table (context_temporal, migration 009) is an EAV table (block_id, source_date, dimension, value) with partial B-tree indexes per dimension (year/month/week/weekday/quarter) for O(log n) filtering — new dimensions without a schema change. For cyclic queries the handler fetches the dimensions via FetchBlockDimensions, and for linear ones the content_times via FetchContentTimes; mixed weights ('am Dienstag') run both paths, each scaled by its respective weight, so that the total boost stays ≤0.30.

temporal-gravitypower-lawrubin-baddeleyeavcontext_temporal
filterSuperseded (temporal-gated)Outdated blocks drop out of the results as soon as their successor is also in the result set — but only for non-temporal queries.

Before trimming to the user limit, the handler enriches the results with the dream.SupersedesMap (key = outdated block, value = newer superseder IDs; the convention since Wave 46). filterSuperseded removes a superseded block ONLY if at least one of its superseders is also present in the result set (a safety rule — otherwise the current information would be missing entirely). The decisive factor is the temporal gate: the filter runs exclusively for non-temporal queries (temporalResult == nil or no dates) — temporal queries explicitly need historical/outdated blocks and must not lose their history. The RRF score ordering is preserved. In the API response, each source optionally carries a superseded_by field. Architectural boundary (honestly documented): the Dream links are NOT traversed @Query — here the graph serves only as a supersedes drop filter; the optional graph expansion (1-hop along positive Dream links, post-RRF/pre-rerank) is a separate, default-OFF gated feature.

supersedestemporal-gatedream-linksfilteringfreshness

Dream Mode, Guard & Embedding

Three asynchronous background subsystems form the self-maintaining nervous system of ctx. Dream Mode is an LLM-driven cross-reference engine that infers latent relationships between Blocks and writes them into the graph as typed edges. The Guard watches over every write operation and catches near-duplicates via HNSW similarity. The embedding layer produces 1024-dimensional Matryoshka vectors (qwen3-embedding-8b) and asynchronously backfills missing embeddings. All three are triggered in an event-driven fashion through PostgreSQL LISTEN/NOTIFY.

Dream Mode — asynchronous cross-reference engineAn LLM infers latent relationships between Blocks and writes them as typed graph edges

Dream Mode is the component that densifies the knowledge graph without human intervention: a scheduler worker (concurrency 1) pulls a Block from the corpus and looks for related Blocks that a human would never have explicitly linked when saving — the LATENT cross-connections. The pipeline runs in eight steps (defined in go/internal/dream/dream.go): Step 0 cycle skip (skipped if no backend serves the role), Step 1 block pick (unchecked first, then the oldest with an expired cooldown via FOR UPDATE SKIP LOCKED), Step 1b temporal dimension validation, Step 2 LLM keyword extraction (max. 5, persisted per Block and reused), Step 3 RRF search per keyword, Step 4 LLM evaluation of the candidates, Step 5 write links, Step 5b recurrent detection, Step 6 quality score update, Step 7 adaptive cooldown, Step 8 promotion to canonical. The pipeline generation is Version=5 (wave 38b, 2026-05-06) and is persisted with every link. Cooldowns are adaptive: 3 days for Blocks that produced links (CooldownActiveDays), 14 days for Blocks without links (CooldownInertDays), 5 minutes on transient system errors such as LLM timeouts (CooldownTransientMinutes). When idle, the worker waits 20s (CTX_DREAM_IDLE_WAIT, hot-mutable). A throttle mechanism enforces GPU cooldown pauses between LLM calls (on/throttled/off via API + CLI).

dreamcross-referencegraphasyncpipelinescheduler
Dream link types & evaluation prompt5 relationship types, 4 of them classified by an LLM prompt, recurrent via a separate phase-1/2 pass

The graph knows five edge types (validRelationships in linkfilters.go): supersedes (the source corrects/replaces a concrete fact in the target — VERY RARE), causal (the source describes an event/decision whose occurrence enabled the target; decision→implementation qualifies), factual (the source SPECIFIES a concrete thing that the target implements — one-way SPEC→IMPL), topical (both deal with the same subject substantively — the documented fallback), and recurrent. The LLM evaluation prompt (dreamSystemPrompt in evaluate.go) classifies only the first FOUR; recurrent is detected separately in a phase-1 pass (same dimension+value in context_temporal AND title similarity > 0.5) plus a phase-2 LLM confirmation that runs after the main evaluation, so that recurrent wins over topical. The prompt explicitly sets 'topical-as-fallback' as the default. On the top-50-hardest benchmark against double-judge stable gold, it reached 62.3% accuracy (+19.7pp over the pre-reset baseline of 42.6%). The output is a JSON array {target_id, type, confidence}, with a maximum of 5 entries. An attempt at a V6 prompt (causal anti-pattern clauses) was discarded: stable gold n=122 showed V6 to be net-worse (54.1% vs 57.4%), with topical recall dropping from 76% to 63% due to over-hedging toward 'none'.

dreamlink-typespromptllmclassificationbenchmark
Dream confidence gates & hard capUniform 0.7 confidence floor (recurrent 0.8), at most 5 links per cycle with type diversity

Each edge type has a minimum raw (unweighted) LLM confidence floor (minRawConfidence): topical, factual, causal, and supersedes sit at 0.7, recurrent one quantization step higher at 0.8 (wave 38b — phase-2 classification has more failure modes). The uniform 0.7 floor replaced the old factual=0.9 gate: qwen3.6:27b produces uncalibrated confidence (full_agree mean 0.87 vs wrong_type mean 0.85 — a gap of only 0.02), which is why the 0.9 gate was a legacy workaround for qwen3.5 and on 3.6 only filtered out 2 correct links without removing any wrong types. After confidence filtering, EvaluateRelationships enforces a hard cap (MaxLinksPerCycle=5), sorted by confidence descending with a type-diversity tie-break. The evaluation runs over the backend with RoleDream (qwen3.6:27b, non-thinking), using the vendor-recommended sampler settings Temperature 0.7, TopP 0.8, TopK 20, NumPredict 400. The HTTP timeout per Dream call is 180s (DreamTimeout, tuned empirically from 5878 production calls: p50=23s, p90=30s, p99=156s), and the total cycle timeout is 700s.

dreamconfidencehard-capgatessamplertimeout
Dream Supersedes V8 — structural safety netsA multi-stage Go pre-check protects the supersedes direction: same-cat + newer source + title similarity ≥0.25

Supersedes is the most dangerous edge type (it marks the target as a snapshot and influences retrieval filtering), so there is a multi-stage structural safety net in Go in addition to the LLM judgment. enforceSupersedesDirection runs as a post-parse hard constraint (in evaluate.go after parseLinks, before filterValidCandidates): for every supersedes link, the source timestamp must lie strictly after the target timestamp; if the direction is inverted, the link is DOWNGRADED to 'topical' rather than discarded (preserving the topical connection). acceptSupersedes (V8, linkfilters.go) checks three conditions at write time: same category (srcCat == tgtCat), source genuinely newer (srcCreated.After(tgtCreated)), and title similarity via pg_trgm ≥ supersedesTitleSimThreshold=0.25. ApplySupersedes (marking the target as a snapshot) fires only at a weighted confidence ≥0.7. Background (wave 46, 2026-05-22): an audit found ALL 15 supersedes links in production to be inverted relative to natural-language semantics ('A supersedes B' → A is the newer authoritative version). The convention was switched from updated_at to created_at and the direction from 'source older' to 'source newer'; migration 042 truncated context_dream_links and a re-Dream pass rewrote the corpus.

dreamsupersedesstructural-checksafety-netwelle-46direction
Guard — HNSW dedup watcher on the write pathEvery new Block is checked via HNSW nearest-neighbor search: ≥0.98 auto-archive, 0.92–0.98 needs_review

The Guard prevents the store from being cluttered with near-duplicates. On every write operation, the PG function ctx_guard_check (migration 011) uses the HNSW index to check the top-1 nearest neighbor over halfvec(1024) cosine distance (cb.embedding::halfvec(1024) <=> v_embedding::halfvec(1024)), excluding self, archived, and chunk Blocks. The thresholds: similarity ≥0.98 → decision 'near_duplicate' → auto-archive (is_archived=true, guard_status='archived_dup'); 0.92–0.98 → 'needs_review' (flagged but visible); <0.92 → 'clean'. These thresholds were raised empirically from 0.95/0.85 because the lower values had an 80% false-positive rate. A cross-scope status is set when the match lies in a different Scope and is not 'shared'. RunGuardBatch processes pending Blocks (NOT is_archived, no guard_checked_at, category != 'index', embedding IS NOT NULL, block_type knowledge/source) via FOR UPDATE SKIP LOCKED so that concurrent Guard runs do not grab the same Block. Each Block runs in its own SAVEPOINT (W47-02 tx-abort-cascade fix): a failed Block (SQL error) is rolled back to its savepoint without poisoning the surrounding transaction (PG 25P02), and the loop continues. Every decision writes an audit entry to context_write_log.

guardhnswdedupwrite-paththresholdssavepoint
Guard — event-driven via LISTEN/NOTIFYA PostgreSQL trigger fires ctx_block_write; the scheduler starts the Guard immediately instead of only on the 60s interval

The Guard does not run blindly on a polling cadence but reacts in an event-driven fashion. The DB trigger trg_block_write fires a PostgreSQL NOTIFY on the channel ctx_block_write (channelBlockWrite in events/listener.go) on every Block write operation. A pgxlisten listener receives the notification and calls scheduler.NotifyWrite(), which triggers the Guard run immediately. As a fallback, a time ticker additionally runs with guardInterval = 60s (events/scheduler.go) in case notifications are missed. On reconnect after a connection loss, HandleBacklog unconditionally signals Guard+Digest in order to catch up on writes missed during the disconnection (defaultReconnectDelay 5s). The same listener mechanism also serves the channel ctx_settings_write (for hot-reloading settings/secrets/backends via psql or a break-glass edit). This architecture (LISTEN/NOTIFY + SKIP LOCKED + own migrations via embed.FS) is a central design principle: no external message broker, everything inside PostgreSQL.

guardlisten-notifyeventsschedulerpgxlistentrigger
Embedding — qwen3-embedding-8b with Matryoshka truncation1024d vectors Matryoshka-truncated from a native 4096d, L2-normalized, with a quality gate

The embedding layer (go/internal/embed/embed.go) produces the semantic vectors for retrieval and the Guard. The model is qwen3-embedding-8b, which natively delivers 4096-dimensional vectors that are truncated to TargetDims=1024 via Matryoshka Representation Learning — the first 1024 dimensions carry the bulk of the information. This is followed by L2 normalization and a quality gate: the norm must lie within [0.99, 1.01] (minNorm/maxNorm) and the variance must exceed minVariance=0.0001 (catching degenerate/constant vectors). Asymmetric instruction prefixes separate query from document (PrefixQuery: 'Instruct: Represent the query for retrieving relevant documents', PrefixDocument: 'Represent the document for retrieval'). The client supports two wire protocols: ollama (/api/embed) and openai (/v1/embeddings) — host and protocol arrive as a single backends.Backend tuple, so the wire path can never diverge from the configured host. There is no longer an artificial request timeout (latency is data-dependent on a shared GPU under concurrency); the parent context supplies the real timeout. In the current stack, embedding runs as the backend 'llama-embed' (Docker, CPU-only on the ctx host, physically separated from the GPU) — which makes CPU embedding the throughput bottleneck during bulk rebuilds, not live query latency.

embeddingqwen3matryoshkaquality-gatel2-normwire-protocol
Embedding — asynchronous backfillMissing embeddings are backfilled offline by the scheduler and inline by the query handler

Embeddings are not generated synchronously on write (that would block the write path) but are backfilled asynchronously. On the write path, a Block is stored without an embedding; the scheduler backfill then generates it offline. In addition, there is an inline backfill directly in the query path: backfillPending (handler/query.go) generates embeddings for Blocks that do not yet have one BEFORE the search runs — normally a no-op (0 Blocks), but it guarantees that no freshly written Block drops out of retrieval. Every backfill wire call is logged via logEmbedWire with the pipeline 'embed-backfill'. ClearEmbedding (store/blocks.go) sets the embedding to NULL so that the scheduler backfill regenerates it on demand (e.g. on a model change). A planned extension (T35b) writes embed_model provenance at three write paths (blocks.go, scheduler.go, query.go) plus a one-time backfill — a prerequisite for later selective rebuilds and cost attribution per api_key_id.

embeddingbackfillasyncschedulerquery-pathprovenance
Embedding storage — TOAST layout & CoW generations (planned)Vectors live out-of-line in TOAST; multi-vector-space generations are planned as a separate table

A live DB measurement (ctx Block 019ed21c) found that context_blocks.embedding has attstorage='e' (EXTERNAL) — the vector lives OUT-OF-LINE in the TOAST table, NOT inline in the heap. A metadata UPDATE does not rewrite the external TOAST tuple (shared pointer), so the heap does not bloat with the embedding on Block updates. Conclusion: a separate embedding table purely for performance/fragmentation reasons is YAGNI — TOAST already provides the heap/vector split. The right FORM for a separate table, by contrast, is the multi-vector space (different generations, per-tenant models, blue-green rebuild): context_block_embeddings(block_id FK, generation, embedding, PK(block_id,generation)). This aligns exactly with the multi-tenant decision OD-1 (CoW embedding, Block 019ed02c): one shared embedding generation as a hard default (ghosted from the pool/parent), with divergence (a different model/dimension) materialized lazily into separate storage, with refcount GC. An external vector store (Qdrant/Milvus) was deliberately discarded — the core value of ctx is the hybrid fusion (RRF + FTS + graph dream_links + temporal gravity + Scope isolation) within ONE SQL transaction; an external store would add a network hop plus a consistency sync. pgvector is benchmarked at 1M Blocks. The build trigger is data-driven: the first incompatible Tenant OR measured HNSW recall pressure as N grows.

embeddingstoragetoastcowgenerationspgvectormulti-tenant

Scope, Auth, MCP & Stack

ctx protects its knowledge store through the GottZ Scope Model: SHA-256-hashed API keys with a home scope and a read-scope list, fail-closed via the PG function ctx_auth. Cloud clients bind to the Streamable-HTTP MCP server (five tools) over OAuth 2.1 PKCE; plaintext keys never leave the database. All inference runs on-prem across five declarative llama.cpp backends speaking the OpenAI wire protocol, routed by role and trust level. The foundation is a Go 1.26 monolith (the ctx CLI + ctxd) on PostgreSQL 18 with pgvector and TimescaleDB.

  1. Migration 052Admin tier introduced: a server-global is_admin bit on API keys gates settings, secrets, and key management.
  2. Migration 053Declarative backend pool (context_backends): replaces the hard-wired CTX_CHAT_HOST/fallback pair with a role→backend routing table featuring trust levels and hot-reload via LISTEN/NOTIFY.
  3. ~April 2026Inference engine switch: Ollama fully retired, llama.cpp throughout — every backend speaks the OpenAI wire protocol.
  4. Stand 2026-06-16Live models: herbert-chat = qwen3.6:27b (think:false), herbert-rerank = bge-reranker-v2-m3, llama-embed = qwen3-embedding-8b (1024d Matryoshka). Fallbacks openrouter (prio 50) and llama-cpu (prio 10).
  5. Live-Stand (Migration 57)The three-tier scope model private|work|shared is active (890 / 3 / 21 blocks), and ctx_auth returns 6 columns. The multi-tenant waves (migrations 058–064) are built in code but not yet deployed.
  6. Release v3.16.0Current release tag; the release pipeline builds 5 platform binaries (linux amd64/arm64, darwin amd64/arm64, windows amd64).
GottZ Scope Model — SHA-256 keys & home scopeSHA-256-hashed API keys with a home scope and a read-scope list; writes and deletes are confined to the key's own scope.

Every API key is stored as a SHA-256 hash (via pgcrypto) in context_api_keys — plaintext keys never leave the table. Authentication runs through the PG function ctx_auth($key), which in the live system returns six columns: api_key_id, home_scope, allowed_scopes, read_scopes, is_valid, and is_admin. The home_scope (e.g. private or work) is the only scope a key may write to and delete from; read_scopes = [home_scope] + allowed_scopes determines what it can read. Element [0] of read_scopes is invariably the home_scope — this ordering is wire-bearing (whoami, chat_sessions snapshot). Three scopes exist live: private (890 blocks), shared (21), and work (3); a typical key such as GottZ Private has home_scope=private and allowed_scopes={shared,work}. The model is fail-closed: an invalid or empty key yields is_valid=false with no existence oracle.

scopeauthsha-256fail-closedctx_auth
Admin tier & role separationA server-global is_admin bit (migration 052) gates settings, secrets, and key management — orthogonal to scope.

On top of the scope read filter sits a separate admin tier: the is_admin bit on the API key (introduced in migration 052). The RequireAdmin middleware sits behind the auth middleware and gates the sensitive routes — /api/settings (runtime overrides), /api/secrets (sealed credentials), /api/status, /api/llmlog, and /api/events. A non-admin key or a missing auth context results in 403. The admin tier is deliberately decoupled from scope: a key can be admin regardless of which scope it reads from and writes to. Several keys carry the bit live (including Admin (dedicated, host-only), OpenCode, and MCP claude.ai). In the multi-tenant code that is built but not yet deployed (migration 059/060), an orthogonal tenant role (owner | admin | member) is added that confers authority only within the key's own tenant; the Go constants are pinned byte-for-byte to the DB CHECK so that drift can never silently grant rights.

adminmigration-052rbacfail-closed
OAuth 2.1 PKCE for MCP remote authA minimal home-grown OAuth 2.1 server that maps ctx API keys to bearer tokens — no external provider.

To let cloud clients such as Claude.ai bind to the MCP endpoint, a minimal, home-grown OAuth 2.1 server runs (no external identity provider). The flow: Claude.ai calls /authorize, the user enters their ctx API key into an HTML form, the server issues a single-use authorization code (valid for 5 minutes, in-memory) and redirects back; /token exchanges the code for an access token — where the token simply IS the API key itself. PKCE is mandatory: only S256 is supported (token_endpoint_auth_methods=none), and SHA256(code_verifier) must match the code_challenge, otherwise invalid_grant. Two discovery documents are served: /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource. Registered clients live in context_oauth_clients (client_id prefix ctx_, secret stored only as a hash) and are created via `ctx mcp add`. Open-redirect defense: a scheme allowlist (http/https only) plus reconstruction of the redirect URL via net/url.

oauthpkces256mcpbearer
MCP server (Streamable HTTP, 5 remote tools)A stateless MCP server at the /mcp endpoint with five tools: query, store, search, get, recent.

ctx exposes its core functions as an MCP server (Model Context Protocol) over the Streamable HTTP transport for remote clients such as Claude Code. It is implemented with the official modelcontextprotocol/go-sdk v1.5.0; the server identifies itself as ctx version 0.25.3, runs stateless (every call independent), and prefers to respond with JSON rather than SSE. Five tools are registered: query (hybrid search + LLM synthesis, delegating to the full /api/query handler including Temporal, RRF, Gravity, Rerank, Supersedes), store (upsert on category+title+scope, with sensitivity gating), search (lightweight FTS without an LLM), get (block by UUID, with prefix resolution), and recent (most recently modified blocks). Auth runs through the same middleware as the /api routes — X-Context-Key or Authorization: Bearer — and injects the AuthResult into the request context; store/search/get/recent are fail-closed against a missing tenant identity or missing scopes.

mcpstreamable-httpstatelesstools
API surface (/api/*) & routerA chi router with /health, the OAuth endpoints, /mcp, and the authenticated /api/* routes; the SPA serves as fallback.

The HTTP daemon ctxd (port 8080) uses a chi v5 router with a global middleware chain: SecurityHeaders, RequestID, Logger, Recovery. /health is anonymous and name-free. The OAuth endpoints (/.well-known/*, /authorize, /token) sit unguarded ahead of it — they are the auth flow. All remaining routes are grouped behind the auth middleware: POST /api/query (RRF + synthesis), /api/store (upsert + auto-embed), /api/search (FTS), GET /api/graph/ego and /api/graph/overview, /api/whoami, POST /api/manage (CRUD + Guard), /api/digest, /api/synthesize/daily, the admin-gated /api/settings and /api/secrets, the web chat (/api/chat/stream + sessions), and the blob routes (/api/blob/fetch|search|manage|store). Body limits are tiered: 1 MB by default, 10 MB for /api/ingest, 75 MB for blob store. Admin-only with elevated detail: /api/status, /api/llmlog, /api/events (SSE). Unknown paths fall through to the embedded SPA (History API fallback), while incorrect API paths still return 404/405.

apichictxdroutingsse
Go monolith — packages & binariesGo 1.26, a single module github.com/GottZ/ctx with two binaries (the ctx CLI + the ctxd daemon) and roughly 25 internal packages.

ctx is a Go monolith (module github.com/GottZ/ctx, with go.mod declaring Go 1.26.0) with two entry points: the ctx CLI (installable via go install) and the HTTP daemon ctxd (port 8080). The business logic lives in roughly 25 internal packages, including auth (SHA-256 key verification), handler (HTTP/MCP/OAuth), llm (chat/synthesis/translate/classify/temporal), embed, rerank, rrf (4-Way Reciprocal Rank Fusion), backends (the declarative pool), store (PG access, migrations via embed.FS), dream (async cross-reference), guard (dedup), digest/overview (topic map + graph), events (scheduler, LISTEN/NOTIFY), settings, sealbox (sealed secrets), sensitivity, and chat. Core dependencies: go-chi/chi v5.2.5, jackc/pgx v5.9.2 plus pgxlisten (PG LISTEN/NOTIFY with SKIP-LOCKED jobs), pgvector/pgvector-go v0.3.0, and modelcontextprotocol/go-sdk v1.5.0. Custom building blocks instead of frameworks: a custom migration runner (tracking table _migrations) and a custom LLM client.

gomonolithchipgxpackages
PostgreSQL 18 + pgvector + TimescaleDBA single database carries vectors, full text, graph, and the temporal dimension — hybrid fusion in one SQL transaction.

The persistence core is PostgreSQL 18 with the extensions pgvector (HNSW cosine index over vector(1024)), pg_trgm (trigram title matching), GIN full-text indexes (English + German), and TimescaleDB. The live database context_store currently sits at migration 57 (tracked in the _migrations table). A deliberate decision against an external vector store (Qdrant/Milvus): the core value is the hybrid fusion — RRF + FTS + graph traversal + temporal reranking + scope filter — in ONE transaction, all in SQL; pgvector is benchmarked for 1M blocks. The embeddings are stored out-of-line in TOAST (attstorage EXTERNAL), so that metadata updates do not rewrite the vector tuple. The GottZ Temporal Dimension Table (context_temporal, an EAV layout with partial B-tree indexes) provides O(log n) access to temporal anchors. The schema includes, among others, context_blocks, context_api_keys, context_backends, context_oauth_clients, context_settings/secrets, and the Dream Mode link tables.

postgresqlpgvectortimescaledbhnswtoast
llama.cpp stack & backend poolFive declarative llama.cpp backends speaking the OpenAI wire protocol, routed by role, priority, and trust level.

All inference runs on-prem via llama.cpp (Ollama has been fully retired since ~April 2026) — every backend speaks the OpenAI wire protocol: /v1/chat/completions, /v1/embeddings, and the cohere-style /v1/rerank interface. Routing is declarative through the context_backends table: each row carries roles (synthesis, translate, chat, digest, dream, classify, embed, rerank), a model_map (role→model + params), a priority, and a trust level (full-trust | no-credentials | non-personal | public), which together with the block sensitivity gate which content may reach which backend. The Chain() method resolves a priority-DESC chain per role with cooldown sorting. Five backends are live: herbert-chat (qwen3.6:27b, think:false — chat/synthesis/translate/digest/dream/classify, full-trust, lan, prio 100), herbert-rerank (bge-reranker-v2-m3, prio 100), llama-embed (qwen3-embedding-8b, 1024d Matryoshka from a native 4096d, prio 100), openrouter (qwen/qwen3.6-27b, no-credentials, external, prio 50), and llama-cpu (prio 10) as a CPU fallback. Hardware: herbert is a Windows box with a single Quadro RTX 6000 (24 GB) running two llama-server instances (~21 GB occupied); the ctx Docker host has no GPU, so embedding runs CPU-only. Backend mutations take effect without a restart (hot-reload via LISTEN/NOTIFY).

llama.cppopenai-wirebackendstrust-gatingrtx-6000
Release pipeline & versioningA GitHub Actions pipeline builds five platform binaries; annotated tags are mandatory, and the tag body is the release text.

Releases are produced via .github/workflows/release.yml: a build matrix produces five platform binaries — linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, and windows/amd64. The current release tag is v3.16.0. Versioning is hook-enforced: the pre-push hook rejects lightweight tags on version releases and requires annotated tags whose annotation serves as the release body. Further mandatory hooks (core.hooksPath = .hooks): pre-commit (golangci-lint on staged Go files) and commit-msg (README review on feat: commits and schema migrations). A note on version scoping: the release tag (v3.16.0, MPL-2.0, author GottZ) is independent of the internally reported MCP server version (0.25.3), which belongs to the MCP implementation.

releaseciversioninggit-hooksmpl-2.0

Web Frontend, CLI & Interfaces

ctx exposes its knowledge layer through three equivalent access paths: an embedded single-page web app (Svelte 5, `embed`ded into the ctxd binary), an extensive CLI family of 25 cobra commands, and the HTTP/MCP API. The web frontend follows a 41-wave master plan (G01–G41) that was fully built with v3.14.0 and extended with the graph map (v3.15.0) as well as multi-tenant visibility; the current release head is v3.16.0. Alongside these are blob storage for binary files, the agent briefing system (SubagentStart/Stop hooks), and Obsidian vault ingestion.

  1. v3.3.0F2 frontend wave (G16–G19) released as RC-1.
  2. v3.4.0Phase 3 (G21–G24) released — graph foundation.
  3. v3.13.0F6 chat chain (G35–G38) released as RC-3.
  4. v3.14.0 (2026-06-13)G39 graph bench + G32 pool/vault editor released — fully completing the 41-wave master plan G01–G41.
  5. v3.15.0 (2026-06-14)F5-W6 graph map (Louvain overview map, migration 057) released; deployed live with clusters=70, modularity=0.857.
  6. v3.16.0Current release head.
Web Frontend (41-wave plan G01–G41)Embedded Svelte 5 SPA with five sections: Settings, Graph, Blocks, Status, and Chat — shipped entirely from the ctxd binary.

The admin SPA lives under go/web/ (Svelte 5.56.3 + TypeScript + Vite, Bun as the toolchain, roughly 13,660 lines of source) and is compiled directly into the ctxd binary via go:embed. It is built in a dedicated Docker stage (oven/bun:1.3-alpine, bun install --frozen-lockfile, svelte-check gate) — only the Docker image ships the real UI; a bare `go install .../cmd/ctxd` produces a binary that serves a 503 placeholder while all APIs remain fully functional. The CLI (cmd/ctx) never depends on the frontend. What gets served are hashed assets (immutable-cached, pre-compressed .br/.gz); the History API fallback responds only to HTML navigations (Accept: text/html), so that mistyped API URLs still return 404 for JSON clients. The master plan G01–G41 was fully built with v3.14.0 (2026-06-13); routing is handled by sv-router 0.16.3. Current release head: v3.16.0.

frontendsvelte5vitebungo-embedspa
Graph Map & Louvain Clusters (F5-W6)Two graph views: WebGL ego networks of individual blocks (sigma) plus a pre-aggregated Louvain cluster map of the entire corpus.

The Graph section (/graph?focus=<uuid>, deep-linkable) renders Dream Mode link ego networks via sigma 3.0.3 (WebGL) over a single graphology 0.26.0 instance as the single source of truth — deliberately kept outside Svelte reactivity, because the Runes proxy overhead on thousands of node objects would be too expensive. Layout uses ForceAtlas2 (graphology-layout-forceatlas2) in a web worker (Blob URL; the CSP carries worker-src blob:), taking 3–10s depending on graph size. Client memory is hard-capped: above 5,000 nodes / 20,000 edges, the nodes farthest from the focus (BFS distance, LRU tiebreak) are evicted down to 4,000; pinned nodes and the focus survive. Block content never travels over the graph endpoint (titles only). The graph map (overview map, named outside the 41-wave plan) resolves the scope count leak via scope-partitioned pre-aggregates (migration 057: three regular tables graph_cluster_member/_node/_edge, no materialized view) and a gonum Louvain daemon job (internal/overview/cluster.go, raw_confidence weighting, hardwired seeds for reproducibility, advisory lock); cluster_id is never exposed raw but assigned per request as an ordinal. Released in v3.15.0 (2026-06-14). LIVE deployed: clusters=70, nodes=669, edge_rows=58, modularity=0.857, elapsed=45ms (corpus currently 691 blocks).

graphsigmagraphologylouvaingonumforceatlas2migration-057
Block Workbench (CRUD across Settings/Blocks/Chat)Corpus browser with full-text search, facets, and sensitivity-gated CRUD, plus a generic settings editor and a streaming chat section.

The Blocks section is a corpus browser: full-text search plus category/tag/Scope facets, a sensitivity-badged, keyset-paginated newest-first list over the scope-gated /api/search, a detail panel, and create/edit/delete via /api/store plus manage update/delete (with sensitivity-downgrade and delete confirmations). The Settings section renders the full Settings API catalog generically from registry metadata — one category card per key prefix, widgets dispatched by registry type, a source badge (default/env/db) and the env-var name per field; hot keys edit live, while restart/coupled keys stay read-only. Embedded within it is the Backends subroute (/settings/backends): a backend pool editor with a trust dropdown and elevation-confirm dialog, a role multiselect, a model_map row editor, priority ordering, and a per-row reachability test, plus the write-only secrets vault with reference tracking. The Chat section (/chat) streams a single turn from POST /api/chat/stream via fetch + eventsource-parser (no reconnect — a turn is one-shot), shows collapsible tool-call cards and a backend badge; assistant Markdown runs through markdown-it (html:false) + DOMPurify, and ctx citations are rewritten to /graph?focus=<id> before sanitization. Test coverage: vitest, svelte-check 0/0.

blockscrudsettingschatssedompurifysvelte5
CLI Family (25 cobra commands)The ctx binary bundles exactly 25 top-level commands, from query/save/search through dream/guard to brief/persist/ingest.

The CLI (cmd/ctx, spf13/cobra) registers exactly 25 top-level commands: query, save, search, stats, categories, get, delete, list-meta, digest, guard (list/stats/resolve/throttle), manage, health, ingest, statusline, dream (stats/review), mcp, keys, brief, persist, settings (get/set/unset/list), secrets, backends (list/create/update/delete/test), eject, and init. `ctx query` is the primary interface (hybrid semantic + full-text search with LLM synthesis, returning an answer plus source refs); `ctx save`/`store` upserts by (category, title) and generates embeddings; `ctx search` returns compact hits without an LLM. Administrative commands such as `keys` (X-Context-Key provisioning; home_scope has been mandatory at creation since v2.0.0) and `mcp` (OAuth client registration for MCP remote) round out the family. The CLI never depends on the web frontend.

clicobraquerysavesearchkeys
Blob StorageFour endpoints for binary files — store/fetch/search/manage — with a 50 MB limit, upsert by category+title, and Scope gating.

Blob storage exposes four POST endpoints (/api/blob/store, /fetch, /search, /manage), registered in cmd/ctxd/server.go. store accepts base64-encoded data (50 MB limit, otherwise 413), validates the write scope against home_scope or shared (otherwise 403), respects the write rate limit, and upserts via store.UpsertBlob by (category, title) along with filename, MIME type, tags, metadata, checksum, and storage_type. fetch retrieves by ID or category/title (MetaOnly option, data base64-encoded), search filters scope-gated by category/tags/MIME type/limit, and manage knows the actions stats, get, list, and delete. Every write is logged fire-and-forget via LogAccess. Auth uses the same X-Context-Key header.

blobbinarystoragerest-apiscope-gating
Agent Briefing (ctx brief/persist as hooks)Two CLI commands hook in as Claude Code SubagentStart/Stop hooks and bridge subagents into the store.

`ctx brief --hook` is the SubagentStart hook: it reads the CWD from stdin JSON, looks up project-tagged blocks in the agent-briefing category (falling back to untagged), and returns the Claude Code hook JSON format (continue, suppressOutput, hookSpecificOutput.additionalContext). Without --hook it returns human-readable text; scoping is by project tag (git root or CWD), with a default limit of 20 blocks. `ctx persist --hook` is the SubagentStop hook: it parses [PERSIST:category:title] markers from the last assistant message and saves them into the store, including automatically enriched metadata (session_id, hostname, project, agent). Both degrade silently (no error) when ctx is unreachable or no markers are found. The `-p` armada mode (`claude -p "..."`) serves as a context firewall that isolates subagents.

agent-briefinghookssubagentpersistarmadaclaude-code
Obsidian Ingestionctx ingest scans an Obsidian vault, parses and chunks Markdown, and loads it into the store in batches.

`ctx ingest <vault-path>` walks an Obsidian vault directory, parses and chunks all .md files (collectMarkdownFiles skips .obsidian/, dot directories, and node_modules), and uploads them in batches. The parser (internal/ingest, package ingest) processes frontmatter (tags, date, title, aliases, custom fields). Metadata is marked with source=obsidian. Flags: --dry-run (preview without upload), --workers and --batch for throughput control. Example invocation: `ctx ingest /path/to/vault/ --workers 4 --batch 100`.

ingestobsidianmarkdownfrontmatterchunking
IV
Roadmap & Outlook

What will be

ctx is evolving from a single-person store into a multi-tenant knowledge platform. Under construction is the multi-tenant Model C (Tenant/Scope/Block), with 20 of 44 waves committed. Two planned expansion stages build on top of it: an enterprise layer (resellers, corporate hierarchy, sandbox environments, separate models, load distribution) with roughly 140 requirements, and a workflow engine that turns block behavior from a hardcoded enum into a dynamic policy config and manages issues as their own tenant corpus. The full elaboration lives in the separate planning report (ctx-planning.html).

  1. under constructionMulti-Tenant Model C — 20 of 44 waves committed (HEAD ddbfd7f), migrations 058–064
  2. plannedMT Enterprise Layer — 5 dimensions, roughly 140 requirements (layer on top of Model C)
  3. after MTWorkflow engine: block types enum → dynamic policy config; issues as a tenant corpus (W1–W4)
Multi-Tenant Model C (under construction)Three-level multi-tenancy Tenant/Scope/Block — 20 of 44 waves committed, additive and pausable.

The core elaboration follows the hybrid Model C with three levels: TENANT (context_tenants, an owner registry as an independent project/company), SCOPE (context_tenant_scopes, which remains the data discriminator without a tenant_id on data tables), and BLOCK (context_block_grants, row-level sharing). The API key carries tenant_id and tenant_role; read_scopes are resolved per tenant in ctx_auth (own ∪ grants, fail-closed). Scope: 44 waves (T01–T43, with T40 split), phases A–G, 11 migrations 058–068, roughly 7805 LOC. Verified against Git (branch feat/multi-tenant, HEAD ddbfd7f): 20 waves committed, migrations 058–064 (7 of them) present — all additive and behavior-neutral, so construction can be paused at any time. Still local, not pushed or deployed (the live DB has max(migration)=57).

multi-tenantmodel-croadmapunder-constructiontenant-scope-block
MT Enterprise LayerFive enterprise dimensions with roughly 140 requirements as a layer on top of Model C.

An enterprise layer builds on top of the core MT planning, elaborated across five dimensions: reseller/tenant management, corporate hierarchy (parent/subsidiary), sandbox environments/ephemeral tenants, separate models (embedding + inference), and load distribution. Branding/white-label is deliberately parked. Key insight: administrative inheritance is orthogonal to data-visibility inheritance — the latter is opt-in and often an anti-feature. The super-tenant is a real default tenant as the tree root (parent NULL); _global never becomes a tenant. Shared embedding generation is a hard default, with load keyed on tenant_id. The analysis covers roughly 140 requirements and identifies six fail-open spots in the MT path.

multi-tenantenterpriseresellercorporate-hierarchyload-distributionroadmap
Workflow Engine & Issue System (vision)Block types from a hardcoded enum to a dynamic policy config — issues as their own tenant corpus.

Planned after the web frontend and multi-tenant (not yet built): the core redesign separates mechanism from policy. The hardcoded 4-class block_role enum (system-meta/audit-trail/reference/knowledge) becomes configurable type configs with behavior fields (retrieval_policy, guard_dedup, dream_linkable). Goal: users build their own workflows on ctx. The first workflow on top of it is an issue system, where an issue is a context_block in a repo-specific scope tenant and inherits the ctx machinery for free: Guard as duplicate detection, RRF as related-issues, Dream as autonomous cross-linking. Forge sync (GitHub first) reconciles via a 3-way content hash. End goal: users and agents document the rest as issues in the system itself, at which point todos.md disappears entirely.

workflow-engineissue-systempolicy-configblock-typesvisionforge-sync

The future in detail — open topics, waves and decisions — lives in the companion Planning Report (German).

V
In comparison

Competition & Landscape

Comparison Matrix

SolutionHosting/OperationLicense/OSSCost modelRetrieval architectureRerankingKnowledge graph (explicit vs. latent vs. query traversal)Temporal modelMulti-tenancyLLM/MCP integrationPublic benchmarkTarget audience
ctxSelf-hosted single Go binary (ctx + ctxd) on 1x PostgreSQL 18; single-node, 1x RTX 6000MPL-2.0 (per-file copyleft), open sourceAll-local, $0 ongoing API/hosting costs (llama.cpp on-prem)4-Way RRF within ONE PG transaction: semantic pgvector + EN-FTS + DE-FTS + Trigram-Title, k=60; no external storeCross-Encoder bge-reranker-v2-m3 (XLM-RoBERTa), A/B-validatedLLM-inferred LATENT links (Dream, 5 types: topical/factual/causal/recurrent/supersedes); GraphExpand = seed-based post-RRF boost/injection (1-hop default, fail-open, reranker as arbiter), NO relational walkCyclic Phase Model: 7 cyclic dimensions + Gaussian Decay + Temporal Gravity (fine-grained)Scope model (private/hth/shared) live; Model-C multi-tenant under construction (not deployed)MCP Streamable HTTP, 5 remote tools (query/store/search/get/recent), OAuth 2.1 PKCE; ~22 CLI primitivesEndogenous (own eval.sh, frozen baseline) — NO public benchmarkSovereign self-operator / architect, Cross-LLM power user
gbrain (Garry Tan/YC)Self-hosted; local embedded PGLite (PG17/WASM, zero-config), larger setups external Postgres/SupabaseMIT (permissive), open source, TypeScript/BunMIT free; default path hosted ZeroEntropy/OpenAI (~single-digit $/mo); fully local possibleHybrid: pgvector HNSW + BM25/FTS + RRF (k=60) + source-tier/backlink boost + intent-aware rewritingDefault ZeroEntropy zerank-2 (hosted); fully local via Qwen3-Reranker possibleZero-LLM regex/wikilink graph (typed edges); deterministic multi-hop traversal at query time (graph-query, since 2026-06-07): answers cross-entity questions without a shared pagerecency + valid_until + last-updated + soft-delete; NO cyclic model, temporal not first-classlogin-scoped slices, OAuth 2.1/PKCE/DCR, scope-gated; company-brain federation; design center single-operator30+ MCP tools (stdio+HTTP) + 43 skills; Claude Code/Codex/Cursor/ChatGPT/PerplexityPUBLIC: LongMemEval R@5 97.6%, own BrainBench (P@5 49.1%, +31.4 via graph)Individuals/power users (Tan's 146k+-page brain), up to teams/small enterprises
Mem0Self-hosted (3 Docker containers: FastAPI + pgvector + Neo4j) OR managed SaaSApache-2.0 (open-core), primarily PythonOSS free; platform Free/$19/$249-Pro (graph only from Pro up); default external LLM APIHybrid, 3 backends in parallel: vector + graph + key-value; routing layer per retrieval; vector store swappable (20+)No Cross-Encoder reranking (per 2026 comparative analysis)Explicit entity relations (Neo4j/FalkorDB), ACTUALLY traversed for multi-hop at query timeTemporal not as a cyclic model; history audit log; LLM-driven ADD/UPDATE/DELETE/NOOPShipped & first-class: user/agent/run/app/org/project scopes, server mode + per-user keysOpenMemory MCP (in sunset); 21+ framework integrations (LangChain/CrewAI/LlamaIndex)PUBLIC: LoCoMo 91.6 / LongMemEval 94.8 / BEAM 64.1(1M) + arXiv paperApp/agent developers (memory-as-infrastructure)
Letta (ex-MemGPT)Self-hosted (Docker + PostgreSQL/pgvector) OR Cloud Constellation; PythonApache-2.0, open sourceOSS free (hosting/API only); Cloud Free/$20-Pro; default embedding OpenAI (hosted)Memory hierarchy core/recall/archival; agentic (agent calls a tool per tier); 2-way hybrid RRF (vector+FTS) self-hostedNo Cross-Encoder rerankingNo link/cross-reference graph; sharing via shared memory blocks between agentsNo cyclic temporal model; self-editing memory + sleep-time agentsMulti-agent/tenancy in production (managed); shared memory blocksMCP scaled back server-side in 2026 in favor of client-side skills; ADE debuggerNo published LongMemEval results (per third-party analysis)Developers/teams building stateful agents; 2026 pivot to Letta Code
Zep / GraphitiGraphiti self-hosted (Python) + MANDATORY external graph DB (Neo4j/FalkorDB/Neptune); Zep = managed cloudGraphiti Apache-2.0 OSS; Zep Cloud proprietaryGraphiti free (+paid OpenAI APIs by default); Zep Cloud Free/$104/$312/mo creditsHybrid: cosine + BM25 + BFS; reranker RRF/MMR/Cross-Encoder + node-distance, sub-secondCross-Encoder available (RRF/MMR/Cross-Encoder/node-distance reranking)True bi-temporal knowledge graph, traversed at query time (BFS, node-distance) — relations first-classBi-temporal: every fact with valid-from/valid-to, invalidation instead of overwriting (no cyclic)Zep Cloud in production; Community Edition deprecated (April 2025)Own MCP server in the repo + FastAPI REST; 6+ LLM, 4 embedding providersPUBLIC: LongMemEval 63.8%, DMR 94.8/98.2% + arXiv (vendor figures)Python developers (Graphiti) / regulated enterprises (Zep Cloud, SOC2/HIPAA)
Vector DBs (Pinecone/Weaviate/Qdrant)Pinecone managed-only (BYOC preview); Weaviate/Qdrant OSS self-host OR Cloud; massively scalingPinecone proprietary; Weaviate Apache-2.0 (Go); Qdrant Apache-2.0 (Rust)Pinecone RU/WU+storage (~$700+/mo @100M); Weaviate/Qdrant self-host free, Cloud ~$350-900/mo @100MANN index (HNSW) + hybrid (dense+sparse/BM25) + partly integrated reranking; sub-10ms (Qdrant ~4ms)Hosted reranker partly integrated (Pinecone: bge-reranker-v2-m3/cohere/pinecone-rerank-v0)NO knowledge graph — only vector neighborhood; graph/relations are built on top by the userNO temporal model out-of-the-box (metadata filtering possible)Namespaces/collections as tenant separation — no memory bridgeSDKs + LangChain/LlamaIndex; no ready-made memory/MCP layer (index != store)Own latency/recall benchmarks (infra class, not a memory benchmark)Developers/platform teams building RAG/memory themselves (infrastructure)
Enterprise platforms (Glean/Langdock/Azure AI-Foundry)Fully managed cloud (Glean SaaS/VPC/on-prem-Dell; Langdock Azure-EU; Azure Foundry); no true self-host primitiveProprietary/closed-source (all three)Per-seat/token: Glean ~$50+/user (~$60k+/yr, $350-480k TCO); Langdock ~20EUR/user+10%; Azure tier+ranker+tokensHybrid vector+keyword+RRF + semantic/L2 reranker (black box); Azure agentic multi-query decomposition (GA)Managed semantic/transformer reranker (Bing models on Azure), not configurableEnterprise knowledge graph from connector metadata/identity (Glean); Azure memory merged/consolidated; no latent link graphTTL/retention (Azure Memory); no cyclic-temporal relevance modelIn production & scaled: permissions-aware multi-user, SSO/SAML/SCIM, IdP ACLsNative MCP (Azure KB as MCP server; Glean MCP headless); 15-30+ LLMs, broad SDKsNo memory-specific public benchmarks; compliance certifications (SOC2/ISO27001) instead of evalMid-size to very large enterprises (procurement, 100+ seats)
LLM-native Memory (ChatGPT/Claude/Notion)Cloud-only, vendor-locked, zero setup; no self-hostingProprietary (all); a Notion OSS alternative would be AppFlowy (third-party)Subscription/token: Notion Plus $10/Business $20, credits $10/1,000; ChatGPT/Claude Pro plans (free limits)Internal, undocumented retrieval mechanics (RAG/pattern recognition); no configurable fusionNot disclosed / not controllableNo open knowledge graph; ChatGPT 'Memory Dreaming' & Claude 'Dreams' = async synthesis (conceptual Dream parallel), but black boxNo cyclic model; ChatGPT 12+-month recall, Claude auto-summaryPer-account/project/workspace SILOS, internally separated (Claude Projects vs. Chats); NO cross-provider portabilityNative UI embedding instead of tool call; Claude /memory filesystem (agentic), no open MCP memoryNo benchmark (consumer features)End users/teams who don't want setup (ONE platform each)

What sets ctx apart & Gaps

What sets ctx apart

  • Hybrid fusion + graph + temporal + Scope in ONE Postgres transactionctx collapses the entire memory pipeline into a single SQL transaction over the same tables: 4-Way RRF (semantic pgvector HNSW + English FTS + German FTS + Trigram-Title matching, k=60), followed by Cross-Encoder reranking, cyclic Temporal Gravity, latent GraphExpand, and Scope isolation — all with no network hop. No competitor in the field achieves this architectural frugality: Mem0 runs polyglot persistence (pgvector + separate Neo4j + selectable vector store, 3 containers), Graphiti mandatorily requires an external graph DB (Neo4j/FalkorDB/Neptune), gbrain mirrors Git -> Postgres and calls external services for its default embeddings/reranker, and the vector DBs are by definition merely the index layer with a network hop. Verified: go/internal/rrf/, bge-reranker-v2-m3 in docker-compose.yml, 1024-dim Matryoshka embeddings.
  • All-local / $0 ongoing cost as the default IDENTITY, not as an optionConsistently local llama.cpp inference (embedding qwen3-embedding-8b, reranker bge-reranker-v2-m3, synthesis qwen3.6:27b) across 5 declarative backends in the OpenAI wire protocol — zero API/hosting fees, no data egress. This is the decisive difference from its closest OSS relatives: gbrain, Mem0, Letta, and Graphiti can indeed be run fully local, but their MAINTAINED default path uses hosted services (ZeroEntropy/OpenAI, or text-embedding-3-small/TurboPuffer respectively). With ctx, data sovereignty is the factory state — not an enterprise surcharge (like Notion Data Residency) nor a deviation from the happy path.
  • LLM-inferred LATENT links instead of merely explicit/extracted edgesDream Mode uses an LLM to infer non-explicit relationships between Blocks and writes them into the graph as typed edges (5 types: topical/factual/causal/recurrent/supersedes) — thus discovering connections that were never explicitly set anywhere. This is what fundamentally distinguishes ctx: gbrain's graph knows only explicitly set wikilinks/regex matches (no link set = no edge), Mem0 and Graphiti primarily store extracted entity relations (Alice—works_at—Google), and Glean/Azure derive relations from connector metadata/identity. ctx's linking is semantic-inferential, not syntactic-extractive.
  • Cyclic Temporal Gravity — a fine-grained cyclic relevance modelThe physics-inspired GottZ Cyclic Phase Model weights relevance across 7 cyclic time dimensions (including weekday/month/quarter/season/daily) with Gaussian Decay and a Temporal Gravity table, fed by a deterministic pipeline with 18 pattern matchers. No competitor has a comparable cyclic model: gbrain has recency/valid_until, Zep/Graphiti a bi-temporal valid-from/valid-to window, Azure only TTL — all of them linear/point-wise, none model time-of-day/weekday/seasonal periodicity as a ranking signal. Verified: go/internal/rrf/gravity.go (ComputeCyclicGravity, Gaussian Decay).
  • Cross-LLM / Cross-Tenant memory bridge as an explicit design centerctx is designed as a shared, vendor-neutral knowledge layer across multiple Claude instances AND Anthropic Tenants (Scope model private/hth/shared, fail-closed via the PG function ctx_auth) — and, looking ahead, foreign LLMs as well via the OpenAI wire protocol. This is exactly the gap that the LLM-native features structurally leave open: ChatGPT Memory, Claude Projects, and Notion each lock knowledge into their own cloud (and internally: Claude Projects vs. Chats). gbrain too is single-operator-centric (multi-operator only via federation/custom work), and Mem0/Letta tenancy is isolation by metadata/agent, not a shared cross-tenant layer. ctx builds the bridge between the silos.
  • Single Go binary with verification discipline + a dedicated dedup subsystem (Guard)ONE Go monolith (ctx CLI + ctxd daemon, Go 1.26) on a single PostgreSQL 18 instance — no Bun/Node/Python runtime, no second DBMS, no external vector store. On top of that, the Guard: a dedicated asynchronous dedup subsystem that checks every write via HNSW similarity (auto-archive at ~0.98, flag at ~0.92), event-driven over PostgreSQL LISTEN/NOTIFY. Operational discipline (pre-commit golangci-lint, eval.sh frozen baseline, state.sh) is part of the core. Mem0 self-hosting needs 3 containers + reverse-proxy auth, Graphiti a second graph datastore — ctx remains a single deployable artifact.
  • MPL-2.0 copyleft + a fully integrated, hardened web frontend in the coreMPL-2.0 protects derived files (per-file copyleft) — depending on your view, an advantage or a disadvantage over the field's permissive MIT (gbrain) / Apache-2.0 (Mem0/Letta/Graphiti/Weaviate/Qdrant). The complete web frontend (Svelte 5, embedded into the ctxd binary, 41-wave plan G01–G41, current release tip v3.16.0), including the graph map (Louvain clusters) and the Block workbench, is part of the self-hosted core — whereas with Mem0 the dashboard is platform-exclusive, and the local OpenMemory MCP is currently being deprecated.

Gaps & where others lead

  • The graph is not traversed relationally at query time (boost instead of walk)Primary-source finding (W3/W9): ctx's GraphExpand (go/internal/rrf/graph.go, invoked in handler/query.go:617) is a seed-based POST-RRF boost/injection — qualifying top hits pull neighbors into the reranker window over typed edges (1-hop default, fail-open, reranker as arbiter; active in this deployment via the Compose default, product default config.go:183 = false). This is NOT a deterministic relational walk that constructs a cross-entity answer when no single page mentions both sides. That is exactly what the competitors deliver: gbrain (graph-query, deterministic, depth/fan-out-bounded), Zep/Graphiti (BFS + node-distance reranking), and Mem0 (Neo4j multi-hop) genuinely traverse the graph at query time. Remains an open ctx flank.
  • No public, reproducible benchmarkctx evaluates exclusively endogenously (own eval.sh, frozen baseline, 43 eval tests) — there is no external yardstick for comparison. Several competitors lead clearly here: Mem0 (LoCoMo 91.6 / LongMemEval 94.8 / BEAM + arXiv paper), gbrain (LongMemEval R@5 97.6% + its own BrainBench + NamedThingBench with documented methodology), Zep (LongMemEval 63.8% / DMR 94.8-98.2% + arXiv). Without public figures, ctx's retrieval quality cannot be assessed externally — the structurally toughest gap relative to the field.
  • Single-node / single-GPU — no horizontal scalingctx runs on a single node with one RTX 6000; the bulk rebuild of embeddings is CPU-bound (bottleneck), and latent linking is expensive due to the single GPU. The platforms and vector DBs play in a different league: Pinecone/Weaviate/Qdrant scale to billions of vectors across sharded multi-AZ clusters (sub-10ms), Letta/Zep scale via a cloud backend (TurboPuffer), Azure elastically across tiers/SUs and upcoming serverless. ctx does not scale horizontally — a deliberate consequence of the single-binary/single-operator design, but a real ceiling.
  • Multi-tenancy still under construction (not deployed)The Multi-Tenant Model C (Tenant/Scope/Block) is only partially committed (per the briefing, ~20/44 waves) and not deployed in production; current commits work on Wave 03/04/05 (tenant resolution, per-tenant quota schema, context_backends Scope dimension). Several competitors already ship production-grade, first-class multi-tenancy: Mem0 (user/agent/org/project scopes, server mode, per-user keys), Letta (managed multi-agent), Zep Cloud, as well as all the enterprise platforms (Glean/Langdock/Azure with SSO/SAML/SCIM, IdP ACLs). ctx's Scope model (private/hth/shared) is live, but full multi-tenancy is on the roadmap.
  • Smaller ecosystem, feature scope & mindshare; no system-of-recordctx is a single-author project (GottZ) with a deliberately lean feature scope (5 MCP tools, ~22 CLI primitives) and a small corpus. The field leads clearly in reach (Mem0 ~58.8k stars, Zep/Graphiti 27.6k, gbrain ~23k, Letta ~23.4k) and breadth: gbrain (30+ MCP tools, 43 skills, Minions job queue, durable subagents, push-based volunteer_context, schema packs as policy-as-data), Mem0 (21+ framework integrations, managed SaaS), Glean (275+ SaaS connectors). Additional design limits: multi-query expansion is deliberately disabled in ctx (gbrain/Azure offer it), ctx holds knowledge exclusively in the Postgres store (gbrain has Git-Markdown as a portable/diffable system-of-record), and ctx has no formal type system/schema registry (only block_role 4-enum; a registry remains roadmap). Enterprise compliance certifications (SOC2/ISO27001) are entirely absent from ctx.

The solutions in detail

gbrain

reference

Garry Tan's (YC) Markdown-first, self-wiring agent memory: a Git repo as system-of-record, embedded Postgres+pgvector, a deterministic typed knowledge graph with query-time multi-hop — the most prominent direct ctx competitor.

https://github.com/garrytan/gbrain

gbrain ("Search gives you raw pages. GBrain gives you the answer.") is an open-source memory/knowledge layer for LLM agents by Garry Tan (President/CEO of Y Combinator), MIT-licensed, written in TypeScript/Bun. Knowledge lives as Markdown in a Git repo (the system-of-record), which is mirrored into Postgres+pgvector for hybrid retrieval; locally this runs as embedded PGLite (Postgres 17 via WASM, zero-config). On top of that, a typed knowledge graph is "self-wired" via zero-LLM pattern matching on wikilinks, which an agent reads, writes, and traverses. Target audience: primarily individuals/power users (Tan's own production brain: 146k+ pages, 24k people, 66 cron jobs), but it scales up to teams/small enterprises via company-brain federation. Massive adoption (~23k GitHub stars as of June 2026).

Version (June 2026)
v0.42.51.0 (2026-06-17, VERSION file); ~331 commits on master; the vectorize.io review covered v0.30 (May 2026, pre-1.0, frequent breaking changes)
Author / License
Garry Tan (YC President & CEO) / MIT, TypeScript-Bun
GitHub traction
~23.2k stars, ~3.3k forks (June 2026); ~5k stars in the first 24h after the 2026-04-05 release
Storage / System-of-Record
Git Markdown repo = SoR; mirrored to Postgres. Local: PGLite (PG17 via WASM, zero-config, up to ~50k pages). Shared/large: external Postgres/Supabase + pgvector
Retrieval
Hybrid: pgvector HNSW (cosine) + BM25/Postgres FTS + RRF (k=60) + source-tier/backlink boost + intent-aware query rewriting; 3 modes conservative/balanced/tokenmax; optional Haiku query expansion (2 phrasings); 4-layer dedup
Embeddings / Reranker
Default ZeroEntropy (hosted, OpenAI fallback, ~16 provider recipes); reranker defaults to ZeroEntropy zerank-2 (tokenmax). Fully local possible via llama-server / Qwen3-Reranker
Knowledge graph
Zero-LLM regex/pattern matching on wikilinks at every page write; typed edges (attended/works_at/invested_in/founded/advises/mentions). Multi-hop traversal at query time via graph-query (v0.42.34.0, 2026-06-07): deterministic, depth/fan-out-bounded, answers relationship questions even when no single page names both sides; 75%+ recall@10, +31.4 P@5 over vector-only
Temporal
recency + valid_until + last-updated metadata + soft-delete history; NO cyclic/Gaussian phase model, temporal reasoning not first-class per the review
Multi-tenancy / Auth
login-scoped slices, OAuth 2.1 + PKCE + DCR-style client registration, scope-gated read/write/admin, rate limiting, /admin dashboard; company-brain federation with source-based routing + (v0.42.46) end-to-end federated read-scope enforcement. The design center remains single-operator
Interfaces / Scope
30+ MCP tools (stdio+HTTP) + 43 curated Skills (1 skillpack); schema packs SHIPPED (gbrain-base-v2 15-type, legacy 24-type); clients: Claude Code (1 command: claude mcp add gbrain -- gbrain serve), Codex, Cursor, Claude Desktop/Cowork, Perplexity, ChatGPT
Scheduling / Jobs
Postgres-native BullMQ-shaped job queue ('Minions'), durable subagents (two-phase pending->done, crash-survivable), configurable cron (Tan's brain: 66 jobs). New: --pace throttling, spend.posture cost control, push-based volunteer_context / gbrain watch (ambient retrieval reflex)
Eval
PUBLIC: LongMemEval (R@5 97.6%) + its own BrainBench (240-page Opus corpus: P@5 49.1%, R@5 97.9%, +31.4 P@5 from the graph), NamedThingBench, documented search-mode methodology
Cost
MIT free; an active personal brain runs at 'single-digit dollars/month' (OpenAI embeddings ~$0.10/M tokens, optional Anthropic expansion). Fully local is possible, but the default path uses hosted ZeroEntropy/OpenAI
Strengths
  • Deterministic typed multi-hop graph traversal at query time (graph-query): answers relational cross-entity questions where no single page names both sides — 75%+ recall@10, +31.4 P@5 vs vector-only (since 2026-06-07)
  • Git Markdown as system-of-record: portable, diffable, versioned, no DB lock-in; the DB is only a retrieval mirror
  • Public, reproducible eval suite (LongMemEval + BrainBench + NamedThingBench) with documented methodology
  • Zero-config onboarding via PGLite (embedded PG17/WASM) — no server, Claude Code integration in a single command
  • Broad interfaces: 30+ MCP tools, 43 Skills, many clients (Claude Code, Codex, Cursor, ChatGPT, Perplexity); schema packs SHIPPED as policy-as-data
  • Enormous community/mindshare (~23k stars, YC reach, hackathons), fast release cadence (daily), production-proven at 146k+ pages
  • Push-based ambient retrieval (volunteer_context / gbrain watch) delivers context proactively per conversation turn
  • Zero-LLM graph construction: cheap, deterministic, no GPU/inference cost for linking
ctx +
  • LLM-inferred LATENT links (5 types: topical/factual/causal/recurrent/supersedes) discover non-explicit relationships — gbrain's graph only knows explicitly set wikilinks/regex matches (no link set = no edge)
  • Cyclic Temporal Gravity (7 cyclic dimensions, Gaussian decay, Temporal Gravity table) — gbrain only has recency/valid_until, temporal reasoning is not first-class
  • Genuine end-to-end all-local / $0 running cost as a default identity (llama.cpp on-prem) — gbrain's default path uses hosted ZeroEntropy/OpenAI (local only as an alternative)
  • Hybrid fusion + graph + temporal + scope isolation in ONE Postgres transaction over the same tables, no network hop; gbrain mirrors Git->Postgres and calls external services for default embeddings/reranker
  • Cross-tenant/cross-LLM memory bridge as an explicit design center (a shared knowledge layer across multiple Anthropic tenants) — gbrain is single-operator-centric, multi-operator only via federation/custom work
  • Single Go binary (CLI+daemon) without a Bun/Node runtime; pre-commit/eval/state verification discipline
  • MPL-2.0 (copyleft protection for derived files) vs gbrain's permissive MIT — an advantage or disadvantage depending on perspective
  • Guard (async HNSW duplicate detection, 0.98 auto-archive / 0.92 flag via LISTEN/NOTIFY) as a dedicated dedup subsystem
them +
  • Public benchmark (LongMemEval) — ctx evaluates endogenously (its own eval.sh, frozen baseline), with no external yardstick: remains a ctx weakness (GAP-D)
  • Git Markdown system-of-record (portable/diffable/versioned) — ctx keeps knowledge exclusively in the Postgres store
  • Deterministic relational multi-hop walks that answer cross-entity questions without a shared page — ctx' GraphExpand is a post-RRF boost/injection (1-hop default, fail-open, reranker as arbiter), not a relational walk that constructs an actual answer
  • Significantly larger ecosystem & mindshare (~23k stars vs ctx's 434 blocks/small repo), YC distribution, many official clients & hackathons
  • Zero-config distribution via PGLite/WASM + 1-command Claude Code install — ctx needs Docker Compose + Postgres + GPU inference setup
  • Much broader feature scope (30+ MCP tools, 43 Skills, Minions job queue, durable subagents, push-based volunteer_context, advisor/doctor/sources-harden) vs ctx' deliberately lean 5-MCP-tool/~22-CLI-primitive set
  • Schema packs/type system SHIPPED (policy-as-data, agent-authorable) — ctx only has a 4-enum block_role, a registry remains on the roadmap (GAP-C)
  • Multi-query expansion available (optional Haiku phrasings) — ctx has expansion deliberately disabled (tight); recency/federation in production vs ctx's MT still under construction/not deployed
  • Zero-LLM graph construction: no inference cost/no GPU bottleneck during linking — ctx' latent linking is expensive (single-RTX-6000 bottleneck)

vs. ctx gbrain and ctx are the closest direct relatives in the self-hosted agent-memory space and largely converge at the retrieval core (pgvector HNSW + Postgres FTS + RRF k=60). Since the previous comparison (2026-06-08), two axes have shifted: (1) Reranker — ctx has caught up with bge-reranker-v2-m3, and gbrain's zerank-2 lead is gone. (2) Graph at query time — on 2026-06-07 (v0.42.34.0) gbrain added deterministic typed multi-hop relational retrieval; ctx shipped post-RRF GraphExpand at the same time and has it active in THIS deployment via the Compose default (A/B-validated, graph+CE bw0.5 best, R@20 0.811). This means the briefing assumption that 'GAP-A is probably STILL OPEN' is, per the primary source, outdated: ctx now traverses the positive links — but as a boost/injection with the reranker as arbiter, NOT as gbrain's deterministic relational walk that constructs real cross-entity answers without a shared page. The real fork remains strategic: gbrain = a broad, MIT-licensed, Git-Markdown-centric single-operator knowledge OS with a public eval, hosted default, and mass mindshare; ctx = a focused, all-local-$0, MPL-2.0 single-binary primitive with LLM-inferred LATENT links, cyclic Temporal Gravity, and a cross-tenant/cross-LLM bridge as its differentiator. ctx leads on latent linking, temporal model, genuine data sovereignty/zero cost, and cross-tenant design; gbrain leads on deterministic relational graph answering, public benchmark, distribution/mindshare, and feature breadth.

Research basis & sources

Research 2026-06-17 (WebSearch + WebFetch GitHub/CHANGELOG/VERSION + vectorize.io review). gbrain state found: v0.42.51.0 (VERSION file, commit 2026-06-17), ~23.2k stars / ~331 commits on master, MIT, TypeScript/Bun, embedded PGLite (PG17/WASM)+pgvector. Key releases verified: v0.42.34.0 (06-07, graph traversal), v0.42.46.0 (06-16, federated read-scope), v0.42.43.0 (06-12, push-based volunteer_context). The ctx side was checked against the primary source (W3/W9): rrf/graph.go GraphExpand exists + is called in handler/query.go:617; product default CTX_GRAPH_EXPAND_ENABLED=false, but the docker-compose.yml default is :-true (active in this deployment); 5 MCP tools confirmed in handler/mcp.go. Note: the vectorize.io review figures (v0.30, single-operator, 'no multi-hop') are a May 2026 snapshot and partly outdated — the direct GitHub source (June) shows graph-query multi-hop, gbrain-base-v2, OAuth-DCR/federation, and Claude Code support.

Langdock

Enterprise AI platform (DE) — Secure ChatGPT / Assistants / RAG knowledge / workflows

German, GDPR-compliant enterprise AI platform (Secure ChatGPT + no-code assistants + RAG knowledge + workflows) for employees — not a self-hostable memory primitive like ctx.

Langdock (founded in Berlin, "Privacy by Design") is an enterprise AI platform that gives organizations a secure, model-agnostic wrapper over leading LLMs (OpenAI, Anthropic, Mistral — 30+ models): centralized AI chat, no-code assistants/agents each with their own system prompt and knowledge base, RAG over internal documents/databases/APIs, and workflow automation. The target audience is regulated and data-sensitive European companies (2000+ customers per their own claim) that want to roll out governance-compliant generative AI to their employees — SSO/SAML/SCIM, audit logs, granular permissions. It is a turnkey suite for end users, not a developer building block.

Vendor / origin
Langdock GmbH, Berlin (Germany); legal terms/DPA under German law
Category
Enterprise AI platform / Secure ChatGPT for business + assistants + RAG + workflows
Hosting (default)
Multi-tenant SaaS, Microsoft Azure, servers within the EU
Enterprise deployment tiers
Single-tenant SaaS (from 2,000 seats), Bring-Your-Own-Cloud (from 5,000 seats), on-premises via Kubernetes/Helm charts (from 5,000 seats)
License / openness
Proprietary / closed-source — no open-source license documented
Retrieval / RAG
RAG over external vector databases — Qdrant, Pinecone, Azure AI Search; custom RAG with your own response generation possible
LLM models
Model-agnostic, 30+ models (OpenAI/Anthropic/Mistral and others), bring-your-own keys; no use of customer data for training (contractually guaranteed)
Compliance
ISO 27001, SOC 2 Type II, GDPR; encryption TLS 1.2+ / AES-256; trust center + DPA
Auth / governance
SSO, SAML, SCIM, audit logs, granular permissions, admin controls
Pricing model
Per-user SaaS: Business ~20 €/user/month (up to 1,000 users); Workflows from 449 €/workspace/month; API/token = provider price + 10% markup; 7-day trial
Strengths
  • Turnkey enterprise suite out of the box: AI chat, no-code assistants, RAG knowledge, and workflows with no in-house development — deployable to employees immediately
  • Strong compliance story for regulated EU companies: ISO 27001 + SOC 2 Type II + GDPR, DPA under German law, dedicated trust center
  • EU data sovereignty by default (Azure hosting within the EU) plus escalating deployment tiers up to on-premises (Helm/K8s) for high-security customers
  • Model-agnostic across 30+ LLMs (OpenAI/Anthropic/Mistral), bring-your-own keys, no vendor lock-in to a single model provider
  • Enterprise governance built in: SSO/SAML/SCIM, audit logs, granular permissions, admin controls, integrations (Slack, MS Teams)
  • Large commercial footprint (2000+ customers), professional support, predictable per-seat billing for org-wide rollouts
ctx +
  • Genuine openness & ownership: ctx is an MPL-2.0 open-source single binary; Langdock is proprietary/closed-source
  • Cost model: ctx runs all-local at 0 € of ongoing cost (llama.cpp on-prem); Langdock costs ~20 €/user/month + 10% token markup + from 449 €/workspace for workflows
  • Self-hosting without barriers: ctx is self-hosted from the ground up; Langdock on-prem/BYOC is only available from 2,000-5,000 seats — for small teams/individuals effectively SaaS-only
  • Retrieval architecture as a USP: ctx fuses semantic + DE-FTS + EN-FTS + trigram title (GottZ 4-Way RRF) within a SINGLE Postgres transaction without an external vector store; Langdock depends on external vector databases (Qdrant/Pinecone/Azure AI Search) with network hops
  • LLM-inferred LATENT links (Dream Mode), a cyclic Temporal Gravity model, and cross-encoder reranking — a depth of memory/retrieval that Langdock, as a platform wrapper, does not address
  • Cross-LLM / cross-Tenant memory bridge serving as a persistent external brain across instances — Langdock is employee-/workspace-centric, not a shared memory layer for agents
  • Fully local inference (llama.cpp): no data leaves to hosted LLM APIs; Langdock forwards prompts to external provider APIs (albeit contractually without training)
them +
  • Product maturity & breadth: a complete end-user platform (chat UI, no-code agents, workflows, integrations) rather than a focused memory/retrieval primitive
  • Enterprise compliance certifications (ISO 27001, SOC 2 Type II) — formal audits that ctx cannot show
  • Org-wide governance: SSO/SAML/SCIM, granular permissions, audit logs, admin dashboards for thousands of employees
  • Scalable multi-tenancy is live and in production; ctx multi-tenancy is still under construction (not deployed)
  • Managed service: no GPU/ops of your own required — Langdock runs inference and scaling; ctx requires self-operation (single-GPU bottleneck)
  • Out-of-the-box access to 30+ commercial frontier models (GPT/Claude/Mistral) including hosting; ctx relies on its own on-prem models with limited throughput
  • Commercial support, SLAs, a large customer base, and professional onboarding/consulting ecosystems

vs. ctx Langdock and ctx play in different leagues and categories: Langdock is a turnkey, commercially proprietary enterprise AI suite that rolls out governance-compliant generative AI (chat, assistants, RAG, workflows) to employees as a managed SaaS — its strength lies in compliance certification, EU data sovereignty, org governance, and out-of-the-box model access. ctx, by contrast, is a self-hosted, open-source (MPL-2.0) memory/retrieval primitive with 0 € of ongoing cost, fully local llama.cpp inference, and an architecturally distinct 4-Way RRF hybrid fusion (no external vector store), latent links, and cyclic Temporal Gravity. If you need a deployable, certified enterprise platform for many employees, choose Langdock; if you want a data-sovereign, cost-free, deeply controllable cross-LLM memory as a developer/architecture building block, choose ctx. ctx wins on zero data egress (no hosted API), cost, openness, and retrieval depth; Langdock wins on product breadth, formal compliance, scaling, and managed operation.

Research basis & sources

Research date 2026-06-17 (WebSearch + WebFetch on langdock.com/enterprise, /security, /pricing as well as third-party sources tldv.io, innfactory.ai, zylon.ai, workativ.com, as of June 2026). Langdock does not use a classic versioning scheme (continuous SaaS platform) — no public release/version status documented; most recent facts: ~20 €/user/month Business plan, Workflows from 449 €/workspace, 30+ models, on-prem via Helm from 5,000 seats.

Microsoft Azure AI (Knowledge/Retrieval/Memory-Stack: Azure AI Search / Foundry IQ, Foundry Agent Service Memory, Azure OpenAI)

reference

Microsoft's fully managed, cloud-hosted enterprise RAG stack — hybrid retrieval (vector + keyword + RRF) with the Bing semantic ranker, agentic multi-query retrieval, and managed long-term agent memory — the platform/suite antithesis to ctx's self-hosted single binary.

https://azure.microsoft.com/en-us/products/ai-services/ai-search

Not a single product, but a cohesive knowledge/retrieval/memory stack inside Microsoft Foundry (formerly Azure AI Foundry). At its core is Azure AI Search (a managed search/retrieval engine, now branded "Foundry IQ"), layered with Foundry IQ Knowledge Bases (a reusable, permission-aware knowledge layer over M365/SharePoint/OneLake/Fabric/Web/MCP) and Foundry Agent Service Memory (managed long-term agent memory). LLM inference and embeddings come from Azure OpenAI. Target audience: enterprise teams within the Microsoft/Azure ecosystem that build RAG apps, Copilot extensions, and multi-agent solutions without operating their own retrieval infrastructure.

Hosting/License
Fully managed Azure cloud service, proprietary/closed-source, no self-hosting (VNet integration for memory stores is explicitly unsupported).
Retrieval architecture
Hybrid: vector + keyword/BM25 + Reciprocal Rank Fusion (RRF), with a transformer-based semantic ranker on top (L2 reranking, multilingual deep-learning models from Microsoft Bing) — conceptually comparable to ctx's GottZ 4-Way RRF + bge-reranker, but as a managed black box.
Agentic Retrieval (GA 2026-04-01 API)
An LLM (Azure OpenAI) decomposes a complex query into focused subqueries, executed in parallel (keyword/vector/hybrid), each semantically reranked individually, then fused into a unified grounding answer; reasoning effort minimal/low/medium; returns references plus an activity log.
MCP integration
Every Knowledge Base is a native MCP server and exposes the knowledge_base_retrieve tool; callable from Foundry Agent Service, GitHub Copilot, Claude, and Cursor — direct functional overlap with ctx's MCP layer.
Agent memory (Public Preview, as of 2026-06)
Foundry Agent Service Memory: managed long-term memory, 3 types (User Profile / Chat Summary / Procedural), LLM-driven extraction → consolidation (merge + conflict resolution) → retrieval; item-level CRUD, store-default TTL, direct remember/forget commands, multimodal (images).
Memory quotas/scope
Max. 100 scopes per store, 10,000 memories per scope, 1,000 search and 1,000 update requests/min; scope must be set explicitly in low-level APIs (auto-resolution only via the memory-search tool with scope={{$userId}}).
Knowledge Sources (Foundry IQ)
Indexed + remote: M365 SharePoint, Fabric IQ, OneLake, Azure Blob, Azure AI Search, Web, MCP (private preview); automatic ingest → chunk → vectorize → hybrid retrieval; permission-aware grounding via Microsoft Graph.
Cost model (as of June 2026)
Dedicated: Free (50 MB / 10,000 docs) → Basic ~$0.10/h → Standard S1 ~$250/month (160 GB) → S3 ~$1.39/h (~$981/SU/month, 512 GB). Semantic ranker and agentic retrieval billed separately (ranker per 1,000 queries; agentic token-based). Azure OpenAI inference/embeddings additional, pay-as-you-go. Serverless preview — billing start announced for late 2026.
Temporal model
No built-in cyclic-temporal relevance model; memory offers TTL (retention/expiry), but no time-of-day/weekday/seasonal gravitation like ctx's GottZ Cyclic Phase Model.
Strengths
  • Fully managed and elastically scaling — no operating a DB, GPU, or embedding pipeline; Microsoft runs retrieval + inference
  • Deep native integration into the Microsoft/M365 ecosystem: permission-aware grounding via Microsoft Graph, SharePoint, OneLake, Fabric, Copilot extension
  • Agentic Retrieval as a managed multi-query decomposition + rerank pipeline (GA 2026-04-01) — ctx has deliberately disabled multi-query expansion
  • Managed long-term memory with genuine personalization semantics (user-profile memory, procedural how-to routines, multimodal/images) out of the box
  • Enterprise compliance/governance built in: content safety + prompt-injection detection, region selection, Microsoft Product Terms / DPA
  • Broad SDK/language coverage (C#, Java, JS, Python, REST) and established tooling/portal experience
ctx +
  • Self-hosted, all-local: full data sovereignty, $0 ongoing hosting/API fees — Azure bills the search tier + semantic ranker + agentic tokens + Azure OpenAI inference/embeddings separately and can get expensive at volume
  • Single-Go-binary simplicity instead of a multi-service suite (AI Search + Foundry IQ + Agent Service + Azure OpenAI as separate, separately billed building blocks)
  • Hybrid fusion in ONE Postgres transaction (semantic + EN-FTS + DE-FTS + trigram title) — no network hop to an external managed vector store; with Azure the fusion is a managed black box with no weight/k control
  • LLM-inferred LATENT cross-reference links (Dream Mode, 5 types) discover non-explicit relationships — Azure memory only consolidates/merges, it does not build a latent knowledge graph
  • Cyclic-temporal relevance model (GottZ Cyclic Phase Model: weekday/month/quarter/season/daily + Gaussian decay + Temporal Gravity) — Azure only knows TTL expiry, no cyclic temporal weighting
  • MPL-2.0 open source, fully inspectable and forkable — Azure is proprietary/closed-source
  • No vendor lock-in into the Microsoft/Azure ecosystem; runs on your own hardware with llama.cpp on-prem
  • Full control over embedding/reranker/LLM models (Qwen3-Embedding-8B, bge-reranker-v2-m3, qwen3) instead of being tied to supported Azure OpenAI deployments
them +
  • Zero operational overhead — no dedicated GPU/DB/pipeline; ctx is limited by a single RTX 6000 GPU/throughput, and CPU embedding is the bottleneck for bulk rebuilds
  • Elastic scaling across tiers/SUs and (upcoming) serverless — ctx does not scale horizontally
  • Managed long-term agent memory with a ready-made extraction/consolidation/conflict-resolution pipeline and personalization semantics (user-profile, procedural, multimodal) — ctx has Guard (dedup) + Dream (links), but no comparable automatic memory distillation per user scope
  • Agentic multi-query retrieval as a GA feature — ctx has deliberately disabled multi-query expansion; ctx does not traverse the graph @query (Dream links serve only as a supersedes drop filter)
  • Deep enterprise integration (M365/SharePoint/Graph/OneLake/Fabric/Copilot, permission-aware grounding) and broad knowledge-source connectors — ctx only has Obsidian ingestion + Blob
  • Enterprise governance/compliance guarantees (SLA, DPA, content safety, regions, certifications) and established support — ctx is single-maintainer OSS
  • Mature multimodality (memory over images) — ctx is text/embedding-centric

vs. ctx Azure AI is the enterprise-platform antithesis to ctx: maximum convenience, scaling, and ecosystem integration versus full cost transparency, data sovereignty, and architectural control. Functionally there are real overlaps — hybrid + RRF + semantic reranking aligns conceptually with ctx's GottZ 4-Way RRF + bge-reranker, and Foundry Agent Memory is the most direct commercial counterpart to ctx as a memory layer (with an MCP endpoint that, like ctx, is callable from Claude/Cursor). Azure is superior where ctx deliberately draws boundaries: managed multi-query agentic retrieval, automatic memory distillation per user, M365 Graph grounding, and elastic scaling. ctx is superior on $0 hosting/data sovereignty, single-binary simplicity, latent LLM links, cyclic-temporal gravitation, and MPL-2.0 openness without vendor lock-in. Differently positioned: Azure targets enterprise teams that consume retrieval as a managed service and pay per query/token/SU; ctx targets the self-hosting architect who wants a cross-LLM/cross-tenant memory bridge on their own hardware without ongoing cloud costs.

Research basis & sources

Researched 2026-06-17 via WebSearch/WebFetch. Version/release status: Azure AI Search agentic retrieval GA in REST API 2026-04-01 (portal/preview features in 2026-05-01-preview); Foundry Agent Service Memory in Public Preview (docs as of 2026-06-02/-04, new multimodal/TTL/direct-command capabilities at Build 2026); Foundry IQ as the brand for the knowledge-retrieval layer over Azure AI Search; pricing as of June 2026 (Free 50MB/10k docs, Basic ~$0.10/h, S1 ~$250/month, S3 ~$1.39/h/~$981/SU/month; serverless billing announced for late 2026). Concrete dollar/SU figures from third-party sources (the main pricing page timed out) — flagged as approximations, not every number verified against the official live price list (W3/W9).

Mem0

AI Agent Memory Layer (Open-Source Library + Hosted Platform)

The de facto standard "memory layer" for AI agents — an open-source library (Apache-2.0, ~58.8k stars) plus a hosted platform, with hybrid vector+graph+KV storage and publicly marketed best-in-class benchmark scores.

https://mem0.ai · https://github.com/mem0ai/mem0

Mem0 ("mem-zero") is a dedicated memory layer that gives AI agents and assistants persistent memory across user, session, and agent levels. It positions memory as a distinct architectural component alongside the context window: relevant facts are extracted from conversations, deduplicated, and retrieved across calls — with, per its own marketing, ~90% lower token costs compared to full-history prompting. The target audience is app and agent developers who want to buy memory as an infrastructure building block — either as a self-hosted Python/Node library or Docker server, or as a managed SaaS. It is not a knowledge-base tool for humans but an agent memory API with a large framework ecosystem (LangChain, CrewAI, LlamaIndex, Vercel AI SDK, and others).

License
Apache-2.0 (OSS library + self-hosted server)
GitHub
mem0ai/mem0, ~58,800 stars, primarily Python; active (e.g., OpenCode plugin v0.2.0, 2026-06-17)
Vendor
Mem0 Inc. (commercial startup, mem0.ai) — open-core model
Storage architecture
Hybrid of 3 backends in parallel: vector (semantic), graph (entity relations, multi-hop), key-value (exact match); a routing layer picks the backend per retrieval
Memory management
LLM-driven: for each new fact the LLM decides ADD / UPDATE / DELETE / NOOP; graph and vector writes run in parallel (ThreadPoolExecutor) + history audit log
Self-hosted stack
3 Docker containers: FastAPI REST API + PostgreSQL/pgvector + Neo4j (graph). Vector store is swappable (Qdrant default, Chroma, Pinecone, Milvus, FAISS, 20+)
LLM dependency
Requires an external LLM provider — default OpenAI (gpt-5-mini/nano + text-embedding-3-small); configurable locally via Ollama (llama3.1 + nomic-embed-text)
Benchmarks (public, marketed)
LoCoMo 91.6 · LongMemEval 94.8 · BEAM 1M 64.1 / 10M 48.6; arXiv:2504.19413 (2025)
Multi-tenancy
Shipped & first-class: scoping via metadata — user_id / agent_id / run_id / app_id / org_id / project_id; server mode with per-user API keys + audit logs
MCP
OpenMemory MCP (local MCP server) — currently being SUNSET; the recommendation is now a self-hosted Mem0 server with dashboard
Platform pricing
Free 10K memories / 1K retrievals; $19/mo (50K); Pro $249/mo. Graph memory is paywalled, available only from Pro
Platform-exclusive
Web dashboard/analytics, webhooks, memory export, Advanced Filters v2, custom categories, auto-scaling, built-in auth
Strengths
  • Market-leader mindshare and a huge ecosystem: ~58.8k stars, 21+ official framework/platform integrations, broad adoption as the standard memory layer
  • Publicly verifiable best-in-class benchmark scores (LoCoMo, LongMemEval, BEAM) plus an arXiv paper — external validation rather than only in-house eval
  • Explicit knowledge-graph layer (Neo4j/FalkorDB): entity relations are actually traversed for multi-hop at query time
  • LLM-driven incremental memory management (ADD/UPDATE/DELETE/NOOP) with deduplication and audit history — memories are actively consolidated, not just appended
  • Pluggable: free choice of vector DB (20+), LLM provider (10+), embedder — very flexible to integrate
  • Two operating modes: a fast managed SaaS (5-minute onboarding) OR fully self-hosted for data sovereignty — low barrier to entry
  • Mature multi-tenant primitives (user/agent/org/project scopes, per-user keys, server mode) already shipped in production
ctx +
  • True single-binary simplicity: ctx is ONE Go monolith on a single Postgres DB — mem0 self-hosting needs 3 containers (FastAPI + pgvector + a separate Neo4j) plus its own auth via a reverse proxy and open CORS defaults
  • No external vector store and no second graph DBMS: ctx fuses semantics + DE/EN FTS + trigram in ONE SQL transaction (4-Way RRF), with no network hop and no polyglot-persistence operational burden
  • Consistently local inference by default ($0 ongoing API costs): ctx runs llama.cpp on-prem; mem0 is wired out of the box to an external LLM API (OpenAI gpt-5-mini) — local/Ollama is possible, but not the default path
  • LLM-inferred LATENT links (Dream Mode, 5 types) discover non-explicit relationships — mem0's graph primarily stores explicit entity relations (Alice—works_at—Google)
  • Cyclic Phase Model + Temporal Gravity (7 cyclic time dimensions, Gaussian decay) — a temporal depth that mem0 does not have in this form
  • Cross-tenant/cross-LLM memory bridge with the GottZ Scope Model as a design goal — mem0 tenancy is isolation via metadata, not a shared cross-tenant knowledge layer
  • MPL-2.0 + a fully hardened web frontend (dashboard/graph map/workbench) is part of the self-hosted core in ctx — in mem0 the dashboard is platform-exclusive, and the local MCP server (OpenMemory) is currently being deprecated
  • Human-centric knowledge store (CLI query/save, Obsidian ingestion, blob storage) rather than a pure agent memory API
them +
  • Dramatically greater reach, maturity, and community (~58.8k stars, commercially funded) — ctx is a single-author project with ~434 blocks
  • Public, independent benchmarks + a research paper; ctx has only an in-house eval.sh without an external benchmark like LongMemEval
  • The knowledge graph is actually traversed at query time (multi-hop) — in ctx the graph is NOT traversed at query time (an open weakness)
  • Multi-tenancy is shipped in production (user/agent/org/project, server mode, per-user keys); ctx multi-tenancy is still under construction (~20/44 waves, not deployed)
  • Managed SaaS option with auto-scaling/HA and 5-minute onboarding — zero operational overhead, which ctx as pure self-hosting does not offer
  • Huge plugin/framework ecosystem (LangChain, CrewAI, LlamaIndex, Vercel AI SDK, 21+) and freedom of choice in vector DB/LLM/embedder
  • Cloud-/provider-agnostic and broad in languages/SDKs (Python + TypeScript) — ctx is a Go monolith plus llama.cpp, more committed to a single topology

vs. ctx Mem0 and ctx solve related problems from opposite directions. Mem0 is a broadly adopted agent memory infrastructure with an open-core business model, public best-in-class benchmark scores, real graph traversal, and mature multi-tenancy — but it is a polyglot-persistence framework (pgvector + Neo4j + vector store) with a default dependency on an external LLM API, and some of its convenience features (dashboard, filters, local MCP) are partly platform-exclusive or in sunset. ctx, by contrast, is a hardened single-binary appliance: everything in one Postgres transaction (4-Way RRF), consistently local inference at $0 API cost, latent rather than only explicit links, a more sophisticated cyclic-temporal model, and a fully integrated web frontend — but it is a single-author project without an external benchmark, with a graph that is not yet traversed and a multi-tenancy that is not deployed. Rule of thumb: if you need maximum reach, SaaS convenience, a multi-hop graph, and validation, pick mem0; if you prioritize data sovereignty, operational simplicity, zero API cost, and temporal/latent retrieval depth, you are better served by ctx. They are more like different bets than direct competitors for the same audience.

Research basis & sources

Research 2026-06-17 via WebSearch/WebFetch (mem0.ai docs/blog + GitHub mem0ai/mem0). Status: Apache-2.0, ~58,800 GitHub stars, primarily Python; most recent activity OpenCode plugin v0.2.0 from 2026-06-17 (mem0 does not use a classic single-version release but rolling package/plugin releases). Benchmark values LoCoMo 91.6 / LongMemEval 94.8 / BEAM 64.1(1M)/48.6(10M) per the GitHub README (note: some secondary sources/blog cite slightly different values, LoCoMo 92.5 / LongMemEval 94.4 — the canonical README numbers are used here, W3/W9). Platform pricing Free/$19/$249 Pro and the graph paywall from Pro as of June 2026; OpenMemory MCP officially in sunset.

Letta (formerly MemGPT)

competitor

Platform for stateful AI agents with a self-editing memory hierarchy (core/recall/archival) — born from the Berkeley research project MemGPT, and increasingly oriented in 2026 toward the coding agent "Letta Code".

https://www.letta.com

Letta is an open-source platform (Apache-2.0) for building "stateful agents": LLM agents that learn over time, remember, and curate their own memory. At its core is the operating-system analogy inherited from MemGPT (UC Berkeley, 2023): the context window is limited "RAM", external storage is "disk", and the agent itself moves data between the two. The target audience is developers and teams who want to build long-lived, model-agnostic agents with transparent, persistent memory — as an alternative to the closed agent stacks from OpenAI/Anthropic/Google. In 2026 the focus has shifted strongly toward "Letta Code" (a memory-first coding-agent harness competing with Claude Code) and the "Constellation" cloud.

License
Apache-2.0 (fully open source, no license fees)
Latest stable version
v0.16.8 (May 14, 2026); plus letta-nightly
GitHub
letta-ai/letta — ~23.4k stars, Python (99.5%)
Language/stack
Python; PostgreSQL as the state store
Memory hierarchy
Core (in-context, pinned memory blocks) · Recall (searchable message history) · Archival (semantically searchable long-term storage)
Retrieval (self-hosted)
pgvector for vector search; hybrid RRF (vector + full-text) supported; embedding pinned per agent
Retrieval (cloud API)
TurboPuffer for fast semantic search; default embedding text-embedding-3-small (OpenAI)
Reranking
No cross-encoder reranking (per a 2026 comparative analysis, neither Letta nor Mem0)
Retrieval paradigm
Agentic — the agent itself calls tool functions per memory tier (not deterministic fusion ahead of the LLM)
Multi-agent/async
Sleep-time agents: background agents share the primary agent's memory blocks and modify them asynchronously; shared memory blocks between agents
MCP/integration
Server-side MCP integrations are being phased out in 2026 in favor of client-side skills; ADE as the dev/debug interface
Cloud pricing (June 2026)
Free $0 (up to 3 managed agents, BYOK) · Pro $20/month (up to 20 stateful agents + Letta auto-quota, PAYG overage) · Teams/Enterprise custom. Previous $200 Max tier removed
Self-hosting
Docker (official image, downgraded to a product surface in 2026); Railway template with PostgreSQL+pgvector; free apart from hosting/API usage
Benchmarks
No published LongMemEval results (per third-party analysis 2026)
Recommended models
Model-agnostic; the docs recommend Opus 4.5 and GPT-5.2 for best performance
Strengths
  • Self-editing memory: agents actively curate what they retain via tool calls — not just passive RAG storage
  • Mature, research-grounded memory-OS model (MemGPT/Berkeley) with a clear core/recall/archival hierarchy and explicit memory blocks including character limits
  • Agent Development Environment (ADE): visual debugging of the entire context window (memory, state, prompts, tool execution) — strong developer experience
  • Sleep-time agents: asynchronous background processing of memory blocks; multiple agents share shared memory blocks (multi-agent coordination over shared state)
  • Complete, cohesive platform: runtime + memory + tooling + cloud (Constellation) + coding agent (Letta Code)
  • Model-agnostic with BYOK on all tiers (OpenAI/Anthropic/OpenRouter); no model-level vendor lock-in
  • Large mindshare/community (~23.4k GitHub stars), Apache-2.0, broad ecosystem (Aurora PostgreSQL reference, Codecademy course)
ctx +
  • Retrieval depth: ctx runs 4-Way RRF (semantic + EN-FTS + DE-FTS + trigram title) PLUS cross-encoder reranking (bge-reranker-v2-m3, A/B-proven). Letta uses at best a 2-way hybrid (vector + FTS) and NO cross-encoder reranking
  • Deterministic retrieval fused ahead of the LLM in a SINGLE Postgres transaction vs. Letta's agentic retrieval, where every memory operation costs inference tokens and quality depends on the model's judgment
  • $0 running costs / fully on-prem (llama.cpp + local embeddings) — Letta's default embedding (text-embedding-3-small) and cloud search (TurboPuffer) are hosted/API-bound; fully local is possible with Letta but not the maintained default path
  • LLM-inferred LATENT links (Dream Mode, 5 types) surface non-explicit relationships — Letta has no comparable automatic cross-reference / link-graph concept across the knowledge base
  • Cyclic Temporal Gravity (7 cyclic dimensions, Gaussian decay) as a ranking signal — not present in Letta
  • Cross-Tenant/Cross-LLM memory bridge with the GottZ Scope Model (private/hth/shared) as a shared knowledge layer across instances — Letta's sharing is agent/block-centric, not designed as a cross-tenant knowledge bridge
  • Single Go binary, no external vector store required — Letta is Python and, in a self-hosted setup, depends on a separate PostgreSQL/pgvector instance
  • Guard: async duplicate detection (HNSW similarity, auto-archive/flag) — Letta has no dedicated dedupe of the knowledge base
them +
  • Active agentic memory: Letta's agents edit their own memory (write/update/consolidate), whereas ctx is primarily a retrieval/storage layer that the LLM caller feeds — Letta is the complete agent loop including memory management
  • Sleep-time agents as a first-class concept: asynchronous background consolidation with shared memory blocks — comparable to ctx Dream/Guard, but in Letta integrated directly into the agent runtime and documented as a product feature
  • Agent Development Environment (ADE): a mature visual UI for inspecting/debugging context, state, and tool calls — ctx does have a web frontend (dashboard/graph/workbench), but no comparable agent-loop debugger
  • Mature platform & ecosystem: ~23.4k stars, managed cloud (Constellation), coding agent (Letta Code), Aurora PostgreSQL scaling reference, commercial support, courses — vs. ctx as a single-maintainer project
  • Out-of-the-box cloud scaling (TurboPuffer for hundreds of thousands of memories, managed scaling) — ctx is single-GPU/single-node and CPU-limited on bulk embedding
  • Multi-tenancy/multi-agent is production-ready and managed in Letta; ctx multi-tenancy is still under construction (20/44 waves, not deployed)
  • Established research brand (MemGPT) with broad adoption and documentation; ctx is proprietary/niche with no public benchmark history

vs. ctx Letta and ctx address related but distinct layers: Letta is a complete agent platform whose memory the agent manages itself via tool calls (agentic, token-consuming, model-dependent), whereas ctx is a dedicated, deterministic retrieval/memory layer that fuses and ranks knowledge ahead of the LLM. On the pure retrieval axis, ctx is deeper (4-Way RRF + cross-encoder reranking + Cyclic Temporal Gravity + latent Dream links, all as local SQL with no API costs) — Letta stays at a 2-way hybrid without a cross-encoder and has no published memory benchmarks. Letta's strengths lie elsewhere: active self-editing memory, sleep-time agents, the mature ADE debugging, and a commercially scaling cloud with a large ecosystem. Fairly framed: anyone who wants a local, cost-free, ranking-strong cross-LLM knowledge store is better served by ctx; anyone looking for a ready-made stateful-agent runtime with a managed cloud and self-curation is better served by Letta — the two are more complementary than direct one-to-one competitors.

Research basis & sources

Researched on 2026-06-17 via WebSearch/WebFetch (letta.com, docs.letta.com, GitHub letta-ai/letta, vectorize.io, AWS blog). Status: stable v0.16.8 (2026-05-14), Apache-2.0, ~23.4k GitHub stars; cloud pricing Free/$20 Pro/Enterprise (Max tier $200 removed). Strategic 2026 pivot toward "Letta Code" + "Constellation" cloud (blog "our-next-phase", 2026-03-16; LettaBot folded into Letta Code as channels in May 2026). Retrieval details (pgvector self-hosted / TurboPuffer cloud, text-embedding-3-small, hybrid RRF, no cross-encoder, no LongMemEval publication) drawn from docs + third-party comparative analyses, June 2026 — Letta's implementation internals are only partially documented officially (flagged accordingly, W3/W9).

Zep / Graphiti (getzep.com)

competitor

Temporal knowledge graph as agent memory — a cloud service (Zep) built on an open-source engine (Graphiti, Apache-2.0), both running on an external graph DB rather than a Postgres monolith.

https://www.getzep.com

Zep is a commercial, cloud-hosted memory layer for AI agents; its open-source core, Graphiti, is a temporal-aware knowledge graph engine. Both model knowledge as a graph of entities, relationships, and facts, where each fact carries a validity window (when it became true, when it was superseded). Graphiti's target audience: Python developers who want to self-host and build their own agent memory. Zep Cloud's target audience: teams and enterprises (finance, healthcare, legal) that want compliance (SOC2/HIPAA/GDPR) and a managed service rather than self-operation.

Vendor / Repo
Zep AI; github.com/getzep/graphiti (OSS core), getzep.com (Cloud)
Graphiti Version
v0.29.2 (08.06.2026), 27.6k GitHub stars, Apache-2.0
Language
Python (99.4%), Python 3.10+
Storage Backend
External graph DB required: Neo4j 5.26+, FalkorDB 1.1.2+, Amazon Neptune; Kuzu 0.11.2 deprecated
Retrieval
Hybrid: cosine similarity + BM25 + breadth-first search; reranker RRF / MMR / cross-encoder; node-distance reranking; sub-second latency
LLM Provider
OpenAI (default), Anthropic, Google Gemini, Groq, Azure; OpenAI-compatible: Ollama/vLLM/llama.cpp/LM Studio/DeepSeek/OpenRouter
Embeddings
OpenAI, Azure OpenAI, Google Gemini, Voyage
MCP
Dedicated MCP server in the repo (Claude + other clients), FastAPI REST API
Benchmark
Zep: LongMemEval 63.8% (vs Mem0 49.0%); DMR 94.8% (GPT-4 Turbo) / 98.2% (GPT-4o Mini)
Zep Cloud Pricing
Free 1,000 credits/mo; Flex $104/mo (50k credits); Flex Plus $312/mo (200k credits); Enterprise custom
Self-Hosting
Graphiti freely self-hostable; Zep Cloud BYOC Enterprise only; Zep Community Edition deprecated (April 2025, feature retirement Feb 2026, code in legacy/)
Compliance
Zep Cloud: SOC 2 Type II, HIPAA BAA, GDPR; 1-year audit-log retention (Enterprise)
Strengths
  • A true, bi-temporal knowledge graph: every fact has a validity window (valid-from/valid-to) and, on contradiction, is invalidated rather than overwritten — enabling historical queries
  • The graph is actually traversed at retrieval time (node-distance reranking, BFS) — relationships are a first-class query dimension
  • Public benchmark track record (LongMemEval 63.8%, DMR ~95-98%) — verifiable, published numbers plus an arXiv paper
  • Broad provider matrix: 6+ LLM providers, 4 embedding providers, 4 graph DBs — flexibly interchangeable
  • Strong OSS momentum: 27.6k stars, active releases (most recently June 2026), MCP server out of the box
  • The cloud variant delivers enterprise compliance (SOC2/HIPAA/GDPR) turnkey — RFP-ready for regulated industries
  • Incremental updates without graph recompute — scales for continuous data ingestion
ctx +
  • A genuine single-binary monolith + ONE Postgres instance — Graphiti additionally requires a separate graph DB (Neo4j/FalkorDB/Neptune) as an operational and licensing-cost factor
  • Hybrid fusion (GottZ 4-Way RRF: Semantic + EN-FTS + DE-FTS + trigram title) runs in ONE SQL transaction with no network hop; Graphiti coordinates at the app layer against an external graph DB
  • $0 running cost / all-local: no cloud API fees, no credit model — Zep Cloud costs $104-312/mo+; Graphiti OSS defaults to paid OpenAI APIs
  • Fully on-prem (llama.cpp): data sovereignty by default; Zep self-host ships without a compliance stack, compliance only in the paid cloud
  • A dedicated GottZ Cyclic Phase Model (7 phases, Gaussian decay, Temporal Gravity) — finer-grained than Graphiti's pure valid-from/valid-to window
  • LLM-inferred LATENT links (Dream Mode, 5 types) discover non-explicit relationships, not just extracted entities/edges
  • Native bilingual full-text search (DE+EN FTS) + query translation DE→EN with a domain glossary — Graphiti's BM25 is not designed to be language-dual
  • Cross-Tenant/Cross-LLM memory bridge as a design goal spanning multiple Anthropic tenants
them +
  • The graph is traversed at query time (node-distance/BFS) — by its own positioning, the ctx graph is NOT traversed (Dream links serve only as a supersedes filter)
  • Bi-temporal fact invalidation with validity windows is more mature and more explicit than ctx's Temporal Gravity
  • Public, reproducible benchmarks (LongMemEval/DMR) plus a peer-reviewed paper — ctx's eval is endogenous (its own eval.sh, frozen baseline, no public benchmark)
  • Managed cloud + enterprise compliance (SOC2/HIPAA/GDPR, BAA, audit retention) available immediately — ctx has nothing comparable
  • Multi-tenancy is solved in production in Zep Cloud — ctx's MT is still under construction (not deployed)
  • A markedly larger ecosystem/adoption (27.6k stars, many integrations/forks) and a larger provider portfolio
  • Horizontal scaling via the cloud backend; ctx is single-GPU-bound (one RTX 6000)
  • The Python ecosystem lowers the barrier to entry for the AI/agent majority (ctx is Go + self-hosting-oriented)

vs. ctx Zep/Graphiti and ctx solve the same problem (persistent LLM memory) with opposing architectural philosophies: Graphiti relies on a true, bi-temporal knowledge graph in a separate graph DB with query-time traversal and published benchmarks; ctx relies on a single-binary Postgres monolith with GottZ 4-Way RRF hybrid fusion in a single transaction, latent LLM links, and $0 all-local operation. Graphiti wins on genuine graph traversal, benchmark evidence, provider breadth, and (via Zep Cloud) enterprise compliance/managed operation/multi-tenancy. ctx wins on operational simplicity (no second datastore), zero cost, data sovereignty by default, bilingual search, and a fine-grained GottZ Cyclic Phase Model. A fair assessment: Graphiti is the more mature, more widely adopted "platform with a cloud upsell"; ctx is the leaner, fully sovereign self-hosted primitive — though ctx's open flanks (no query-time graph traversal, endogenous eval, MT still under construction) are precisely Graphiti's strengths.

Research basis & sources

Research 2026-06-17 (WebSearch/WebFetch). Status: Graphiti v0.29.2 (08.06.2026), 27.6k GitHub stars, Apache-2.0, Python 3.10+. Zep Cloud Free/Flex ($104)/Flex Plus ($312)/Enterprise; Zep Community Edition deprecated April 2025, feature retirement Feb 2026 (code in legacy/). Benchmark figures (LongMemEval 63.8%, DMR 94.8/98.2%) from Zep's own sources/arXiv 2501.13956 — vendor claims, not independently re-measured (W3/W9).

Vector Databases (Pinecone · Weaviate · Qdrant)

Retrieval infrastructure / vector-store class

Specialized vector search engines as retrieval infrastructure — the ANN index layer you build your own RAG on top of, not a turnkey memory store like ctx.

https://www.pinecone.io/ · https://weaviate.io/ · https://qdrant.tech/

Pinecone, Weaviate, and Qdrant are the three leading dedicated vector databases (as of June 2026). They store embeddings, build ANN indexes (HNSW), and serve nearest-neighbor search — by now uniformly including hybrid search (dense + sparse/BM25) and, in some cases, integrated reranking. Their target audience is developers and platform teams building semantic search, recommendation, or RAG pipelines for AI agents. The decisive point for this comparison: this is retrieval INFRASTRUCTURE (the index and search building block), not a turnkey memory/knowledge system. Synthesis, graph relationships, temporal logic, the scope model, and the actual memory layer are built by the user on top of it — which is precisely what ctx already provides as an opinionated end-to-end pipeline.

Pinecone — model
Proprietary, fully-managed SaaS (no self-hosting; BYOC on AWS/GCP/Azure in preview), Rust engine, serverless
Pinecone — cost
Read/Write units + storage (~$3.60/GB/mo); Standard $8.25/1M RU + $2/1M WU; ~$70/mo @10M, ~$700+/mo @100M vectors
Pinecone — retrieval
Hybrid (semantic+keyword) native, Integrated Inference (hosted embedding+reranking: pinecone-rerank-v0, cohere-rerank-v3.5, bge-reranker-v2-m3), Pinecone Assistant, ~8ms p50
Weaviate — model
Open source (Apache 2.0), written in Go; self-hosted (Docker/K8s) OR Weaviate Cloud; seamless migration managed↔self-hosted
Weaviate — cost
Self-hosted free; Cloud Flex from $45/mo (Oct 2025 $25 tier retired), Plus from $280/mo annual; ~$135/mo @10M, ~$900+/mo @100M
Weaviate — retrieval
BM25F + dense + metadata filters in a single query (alpha-weighted fusion), reranker/generator/reader modules, multimodal (text/image/audio), GraphQL+gRPC; 2,000+ companies in prod, 14k+ GitHub stars
Qdrant — model
Open source (Apache 2.0), written in Rust; self-hosted/cloud/hybrid/edge (Qdrant Edge); 250M+ downloads, 29k+ stars, 146 employees (May 2026)
Qdrant — cost/funding
Self-hosted free (~$30–50/mo VPS); Cloud ~$65/mo @10M, ~$350/mo @100M; Series B $50M (2026-03-12), $87.8M total
Qdrant — retrieval
Dense + sparse + multivector/ColBERT late-interaction + custom scoring in a single query, Binary Quantization (up to 40x), GPU indexing, filter-aware HNSW, ~4ms p50 (fastest in the group)
Shared class
All = vector index + ANN search. NO LLM-synthesized answer, no latent knowledge graph, no cyclic-temporal model, no memory-pipeline layer out of the box — the user builds RAG/memory on top
Strengths
  • Massive scaling: billions of vectors, distributed/sharded clusters, multi-AZ — far beyond ctx's single node
  • Mature managed clouds with SLA, auto-scaling, monitoring (Pinecone serverless, Weaviate Cloud, Qdrant Cloud)
  • Quantization for memory efficiency: Qdrant Binary (up to 40x, SIMD popcount), Scalar/Product (8–64x)
  • Sub-10ms latency on billion-scale datasets (Qdrant ~4ms, Pinecone ~8ms, Weaviate ~10ms p50)
  • Sparse vectors, multivector/ColBERT late-interaction, multimodal (text/image/audio) — broader retrieval primitives
  • Large ecosystems, SDKs, LangChain/LlamaIndex integrations, VC-funded (Qdrant Series B $50M 2026), enterprise-proven
ctx +
  • Turnkey memory store rather than just an index: ctx delivers the complete opinionated pipeline (synthesized answer, sources, Scope, temporal) — with the vector-DB class you build RAG/memory on top yourself
  • Hybrid fusion in a SINGLE Postgres transaction: GottZ 4-Way RRF (semantic + EN-FTS + DE-FTS + trigram title) over the same tables, no network hop to an external vector store
  • LLM synthesis built in (qwen3.6:27b, fact extraction): ctx returns a condensed answer + sources, not just hit lists like the pure vector engines
  • LLM-inferred LATENT links (Dream Mode, 5 types) — discovers non-explicit relationships; the vector DBs offer only vector neighborhood, no semantic relationship graph
  • GottZ Cyclic Phase Model: 7 cyclic temporal dimensions + Temporal Gravity as a post-RRF reranker — present in none of the three engines
  • $0 running cost / all-local: no read/write-unit fees, no storage pricing, no cloud bill that climbs to $350–900/mo at 100M vectors
  • Cross-tenant/cross-LLM memory bridge + Scope isolation as SQL — a shared knowledge layer across instances; the vector DBs offer only namespaces/collections for tenant separation, no memory bridge
  • MPL-2.0 + single binary (CLI+daemon) on an existing Postgres — no separate vector-DB component to operate (Weaviate/Qdrant require their own service, Pinecone the cloud)
them +
  • Scaling in another league: billions of vectors, horizontal sharding clusters, multi-AZ — ctx is single-node on an RTX 6000, with limited inference/embedding throughput
  • Managed option without ops: Pinecone Cloud/Weaviate Cloud/Qdrant Cloud handle operations, scaling, backups — ctx is pure self-hosting
  • Quantization (Qdrant Binary up to 40x, Product 8–64x) for extreme memory efficiency — ctx uses Matryoshka truncation to 1024d, but no comparable quantization pipeline
  • Sub-10ms retrieval on massive datasets without LLM-synthesis latency; ctx pays the synthesis time of the local LLM stage
  • Richer retrieval primitives: sparse vectors, multivector/ColBERT, multimodal (image/audio) — ctx is text- and block-centric
  • Mature, documented SDKs/integrations + a large ecosystem + enterprise support/SLA; ctx is a single-author project (GottZ) with an endogenous eval.sh rather than a public benchmark

vs. ctx A wrong comparison at the product level, the right one at the architecture level: Pinecone/Weaviate/Qdrant are the index and search INFRASTRUCTURE, while ctx is the turnkey memory store. The three engines deliver first-class, scalable vector/hybrid search (billions of vectors, quantization, sub-10ms) — but synthesis, the latent graph, the temporal model, Scope, and the memory pipeline are built by the user on top, typically as an "external vector store + self-built RAG" with a network hop to the DB. ctx collapses exactly these layers: pgvector is just the index, while GottZ 4-Way RRF fusion, FTS, latent links, cyclic temporal gravity, Scope isolation, and LLM synthesis all run as SQL over the same Postgres tables in a single transaction — all-local, $0 running cost, with a cross-tenant memory bridge. Anyone who needs web-scale vector search with managed ops and billions of embeddings should take the vector DBs; anyone who wants a self-hosted, opinionated cross-LLM memory layer without a cloud bill and without an external store should take ctx. ctx builds on pgvector, the same indexing technique that is the core of this class — but wins by integrating the entire memory layer into the DB.

Research basis & sources

Research 2026-06-17 (WebSearch/WebFetch). Versions/status: Pinecone serverless (Rust, Integrated Inference, pinecone-rerank-v0; pricing Mar–Apr 2026: $8.25/1M RU, $2/1M WU, ~$3.60/GB/mo, proprietary/no self-hosting). Weaviate open source Apache 2.0, in Go (marktechpost's "Java" claim corrected against the GitHub primary source), Cloud Flex from $45/mo, 2,000+ prod companies, 14k+ stars. Qdrant open source Apache 2.0, in Rust, v1.17 (Relevance Feedback Queries), Binary Quantization, Qdrant Edge, audit logging (Apr 2026), Series B $50M (2026-03-12, $87.8M total), 250M+ downloads, 29k+ stars, 146 employees. ctx anchor: ctx-positionierung.md (2026-06-17). Latency/pricing figures from secondary comparisons (jobsbyculture, marktechpost) — order of magnitude reliable, individual values variable by workload.

Glean

Enterprise Work Assistant / Permissions-aware company-wide search (agentic Work-AI platform)

Permissions-aware enterprise search and agentic Work AI across 275+ SaaS connectors — a proprietary platform for large organizations, positioned opposite to ctx as a self-hosted single-binary memory.

https://www.glean.com

Glean is a commercial enterprise AI platform (founded 2019, Palo Alto) that bundles company-wide search, a RAG-backed assistant, and "Glean Agents" across all of a company's SaaS tools. The core idea is a "neutral intelligence layer" / enterprise knowledge graph that indexes a company's entire body of knowledge (docs, chats, tickets, code, CRM) through connectors and makes it searchable in a permissions-aware way — each user sees only what their identity-provider rights (Okta/AD/Azure AD) allow. The target audience is mid-size to very large enterprises (typically from ~100 seats up) that want a finished, managed knowledge-and-agent platform rather than a building block.

Vendor / model
Glean Technologies Inc., proprietary/closed-source, commercial (not open source)
Valuation / ARR
$7.2B valuation (June 2025, Series F $150M); ARR doubled to $200M by Dec. 2025
Connectors
275+ out-of-the-box connectors (native + MCP-based + Push API), search across 100+ tools
Retrieval
Hybrid: lexical (BM25-style) + vector embeddings ("Scholastic", learned item embeddings) + proprietary enterprise knowledge graph
LLM integration
"Agentic Engine 2" (Sept. 2025), 15+ LLMs across multiple cloud providers; Search/Chat/Agents APIs, headless MCP
Deployment
Single-tenant cloud (Glean-hosted) · cloud-prem in your own GCP/AWS VPC · customer-managed (2026) · on-prem via Dell partnership (May 2025)
Security/compliance
Zero-copy (content stays at the source, only index/vectors cached), AES-256 at rest, TLS, RBAC with inherited permissions, SOC 2 Type II, ISO 27001
Pricing
No list price, custom sales; ~$50+/user/month, min. ~100 seats (~$60k+/year ACV), Work-AI suite +~$15/user/month; fully-loaded TCO often $350k–480k/year
Scale
~20 trillion tokens/year processed, >100M agentic actions/year (as of 2026)
Strengths
  • Broad SaaS coverage: 275+ ready-made connectors — usable immediately without writing your own ingestion code
  • Permissions-aware retrieval as a first-class feature: maps IdP rights (Okta/AD/Azure) onto every connector, so a user sees only what they are entitled to — a hard enterprise compliance requirement
  • Enterprise + personal knowledge graph: relationships across people, content, customers, and products, plus a personalized user/work model
  • Agentic platform: a horizontal agent environment, natural-language agent building, parallel sub-agent orchestration (Agentic Engine 2)
  • Multi-LLM routing (15+ models) without vendor lock-in to a single foundation model
  • Enterprise maturity: SOC 2 Type II, ISO 27001, zero-copy data model, cloud-prem/VPC options for data residency, a dedicated security product (Glean Protect)
  • High commercial maturity: $200M ARR, $7.2B valuation, an established support/sales/onboarding apparatus
ctx +
  • Cost model: ctx is all-local with $0 in ongoing API/seat fees vs. Glean's ~$50+/user/month, ~100-seat minimum, and $350k–480k TCO — for individuals or small teams Glean is structurally out of reach
  • True data sovereignty & self-hosting: ctx runs entirely on-prem as a single Go binary + Postgres, with llama.cpp inference local — no hosted API, no vendor in the data path. Even in its cloud-prem/customer-managed variant, Glean remains tied to Glean's code, tenant, and sales
  • Open source (MPL-2.0) vs. Glean's proprietary closed-source platform — inspectable, forkable, no vendor lock-in
  • Architectural frugality: hybrid fusion (GottZ 4-Way RRF: Semantic + EN-FTS + DE-FTS + Trigram), FTS, graph, and Temporal Gravity all run in ctx as SQL within ONE Postgres transaction — no separate vector store, no network hop; Glean spreads across a search index + Amazon RDS + a graph layer
  • LLM-inferred LATENT links (Dream Mode, 5 types) surface non-explicit relationships — going beyond Glean's enterprise graph derived from connector metadata/identity
  • Cyclic Phase Model / Temporal Gravity (7 cyclic time dimensions, Gaussian decay) as a retrieval signal — not identifiable as a standalone feature in Glean
  • A cross-LLM/cross-tenant memory bridge between heterogeneous LLM instances is a ctx design goal; Glean is enterprise-internal knowledge, not conceived as a memory layer for external agents
  • Complexity/footprint: a single binary running in minutes vs. a VPC deployment + IdP mapping + sales cycle
them +
  • Connector ecosystem: 275+ ready-made SaaS integrations vs. ctx (manual ingestion, Obsidian, Blob, API) — Glean indexes an entire company without any build-it-yourself
  • Permissions-aware multi-user security at the org level: granular mapping of IdP groups/rights per connector. ctx does have a Scope model + Multi-Tenant (under construction), but no enterprise IdP integration and no document-level ACL mapping
  • Scaling & SLA: proven at ~20 trillion tokens/year and thousands of users; ctx runs on a single GPU (one RTX 6000), with limited inference throughput and bulk embedding
  • Compliance certifications (SOC 2 Type II, ISO 27001) and a security product — formally demonstrable for enterprise procurement; absent in ctx
  • Agentic platform with natural-language agent building, sub-agent orchestration, and multi-LLM routing (15+ models) as a product surface — ctx is a memory/retrieval layer, not agent orchestration
  • Personal graph + enterprise memory: personalized, role-aware results per employee
  • Operated as a managed service: no self-hosting effort, dedicated support/onboarding — with ctx the operator has to run everything themselves

vs. ctx Glean and ctx address overlapping problems (making knowledge findable, grounding LLMs) from opposite ends. Glean is the heavyweight, proprietary enterprise suite: 275+ connectors, permissions-aware multi-user search across the entire SaaS stack, an agentic platform, and a managed service starting at ~$60k/year and 100 seats — the right choice for a large enterprise that needs to unlock all of its company knowledge without building it itself and to respect org-wide permissions. ctx is the opposite: a self-hosted single-binary memory with $0 ongoing cost, full data sovereignty, MPL-2.0, an elegant 4-Way RRF hybrid fusion in ONE Postgres transaction plus latent links and cyclic Temporal Gravity — built as a cross-LLM/cross-tenant brain for agents and power users, not as an org search portal. Where Glean leads with connector breadth, IdP ACLs, compliance certification, and scale, ctx leads with cost, data sovereignty, inspectability, architectural frugality, and retrieval idiosyncrasies (latent links, Temporal Gravity). They barely compete for the same buyer — Glean sells to enterprise procurement, ctx serves the sovereign self-hoster.

Research basis & sources

Research date 2026-06-17 (WebSearch/WebFetch). Status: $7.2B valuation (June 2025, Series F), ARR $200M (Dec. 2025), Agentic Engine 2 (Sept. 2025, 3rd-gen assistant), 275+ connectors, 15+ LLMs, customer-managed deployment model (2026), Dell on-prem partnership (May 2025). Pricing figures are custom-sales estimates from third-party sources (CheckThat.ai, gosearch.ai, workativ), not an official list price — read them accordingly as ballpark values. Sources include glean.com (overview, connectors, security, docs.glean.com) and agentmarketcap.ai (April 2026).

LLM-native Memory-Features (ChatGPT Memory · Claude Memory & Projects · Notion AI)

LLM-native memory (proprietary, vendor-locked)

Built-in, proprietary memory features from individual AI vendors — convenient and zero-setup, but each locked into its own platform; ctx, by contrast, is the vendor-neutral cross-LLM/cross-tenant bridge that connects exactly these silos.

An umbrella term for the memory features built into AI assistants, considered here as a group: OpenAI ChatGPT Memory, Anthropic Claude Memory + Projects, and Notion AI. All three learn facts and preferences about the user across sessions and automatically feed them into future responses. The target audience is end users and teams who want personalized assistants without any setup of their own. Their common structural trait: each feature lives exclusively within its vendor's platform (cloud-hosted, proprietary) — there is no open, shared store across vendor boundaries. That is precisely where ctx steps in, as a self-hosted, vendor-neutral store.

ChatGPT Memory — two layers
(1) Saved Memories: an explicit list of facts that can be individually viewed/edited/deleted; (2) Reference Chat History: implicit pattern recognition across all earlier chats, with NO list view (not auditable). Jan-2026 upgrade: reliable recall of details from 12+ months.
ChatGPT 'Memory Dreaming' (June 2026)
A single asynchronous background process synthesizes memory from many conversations at once, captures context automatically, and updates existing memories; it produces a readable 'memory summary'. Per reports, a limited audit trail. (Conceptually parallel to ctx Dream Mode.)
ChatGPT — export gap
The standard data export (ZIP) includes conversations but NOT a structured export of memory entries; memory is stored separately and can only be copied out manually. Account-wide, cloud-only.
Claude Memory — availability & modes
Available to everyone, including Free, since March 2, 2026. Two modes: (1) chat memory = a single summarized note, viewable/editable under Settings → Capabilities → Memory; (2) file-system memory = Claude writes notes into a /memory folder (agentic/Claude Code), read at session start.
Claude Projects — silo
Project chats have their OWN, separate memory space; standalone memory synthesizes only from standalone chats. A project's preferences/context apply only there. Splitting work across Projects and chats also splits the memory context.
Claude 'Memory Files' (dual-mode, in testing)
Reported May 24, 2026: distributes notes across multiple structured documents by topic/project/context (a 'personal wiki'), with greater capacity and selective consultation. Dual-mode (classic vs. file-based). Status: testing phase, no firm date. 'Dreams' consolidation in limited beta for managed agents. Cloud consumer feature.
Notion AI — context & persistence
Custom Instructions + instruction pages teach brand voice, team structure, and terminology; context is preserved when switching models. Since Jan 2026 it reads up to 50 pages per context window (previously 20); Custom Agents work autonomously for up to 20 min across hundreds of pages; it also pulls context from Slack, Google Drive, and Teams.
Notion AI — pricing & data sovereignty (2026)
Free $0 · Plus $10 · Business $20/user/month (AI bundled) · Enterprise custom. Custom Agents since May 4, 2026 priced by credits ($10 / 1,000 credits). Data Residency (EU/Japan/Korea) + zero data retention with LLM providers ONLY in the Enterprise tier. Cloud SaaS; an OSS self-host alternative would be AppFlowy (third party).
Common denominator
All three: cloud-hosted, proprietary, vendor-locked, with ongoing subscription/token costs (beyond Free limits). Memory is NOT portable across vendors — migrating ChatGPT↔Claude is possible only via manual copy or experimental import tools (Claude import 'experimental' since March 2026).
Strengths
  • Zero setup, usable instantly — no infrastructure, no operations, built directly into the respective assistant.
  • Seamless, invisible integration into your own chat/workspace flow (the ChatGPT/Claude UI or Notion pages).
  • Automatic, incidental capture of context without the user having to actively save anything (ChatGPT Dreaming, Claude auto-summary).
  • Persistence across model switches within the platform (Notion AI: 'switch models, your memory stays').
  • Huge reach and constant ongoing development from the major vendors; deep integration into tools (Notion: Slack/Drive/Teams).
  • Editability/deletability of explicit entries (ChatGPT Saved Memories, Claude chat memory) gives end users simple control.
ctx +
  • Vendor-neutral & cross-LLM/cross-tenant: ctx is ONE shared store spanning multiple Claude instances AND Anthropic tenants (and, prospectively, third-party LLMs via the OpenAI wire protocol) — the proprietary features each lock memory into their own platform.
  • No silos: ChatGPT memory, Claude Projects, and the Notion workspace are separated from one another AND internally (Projects vs. chats); ctx keeps a single searchable memory with a Scope model (private/hth/shared) instead of fragmented islands.
  • Self-hosted & full data sovereignty: runs entirely on-prem (your own GPU, your own PostgreSQL) — no data with OpenAI/Anthropic/Notion; data residency is the default here, not an Enterprise surcharge as with Notion.
  • $0 ongoing cost instead of subscription/token billing (Notion: $10/1,000 credits; ChatGPT/Claude Pro plans).
  • Full transparency & portability: every Block is retrievable via CLI/API/MCP, exportable, and versioned — vs. ChatGPT's non-exportable, partly non-auditable 'chat history' layer.
  • Open architecture: documented retrieval (4-Way RRF, cross-encoder reranking, cyclic-temporal Gravity, latent Dream links), MPL-2.0 open source, an MCP server with 5 remote tools — the vendor features are black boxes.
  • A structured Zettelkasten with explicit Scope/tags/categories and blob storage, instead of a single summarized note (Claude classic) or an opaque list of facts (ChatGPT).
them +
  • Zero setup vs. running ctx: end users need no GPU, no PostgreSQL, no Docker — ctx demands self-hosting know-how and hardware (a single-RTX-6000 bottleneck).
  • Fully automatic, incidental capture with no user effort at all; ctx relies on deliberate saving or hooks/ingestion.
  • Deep native embedding in the respective assistant UI — no tool-call/MCP round trip needed, memory is part of the product itself.
  • Mature consumer-scale operation & availability (Free tiers, mobile apps, multi-region infra) — ctx is a one-person open-source project.
  • Notion AI: broad native app connectors (Slack, Google Drive, Teams) and 20-minute autonomous agents across hundreds of pages — ctx is a memory/retrieval layer, not a workspace agent.
  • Claude 'Memory Files' bring a topic-/project-organized wiki and the Claude /memory filesystem directly into the agentic loop, with no external store.
  • Mature, continuously improved recall over months (ChatGPT's 12+-month upgrade), backed by large research/operations budgets.

vs. ctx The three are not direct competitors but rather the silos that ctx aims to bridge: convenient, built-in memory within a SINGLE proprietary cloud platform each — ChatGPT account-wide (but partly opaque/non-exportable), Claude isolated per project, Notion per workspace. ctx is the counter-model: a vendor-neutral, self-hosted store that shares the same memory across Claude instances, tenants, and prospectively third-party LLMs, with full data sovereignty, $0 ongoing cost, open documented retrieval (4-Way RRF, reranking, latent links), and export/versioning. The price for that is operational overhead and the lack of zero-setup convenience — the proprietary features win on convenience, reach, and native UI embedding, while ctx wins on sovereignty, cross-boundary coverage, and transparency. Notably, ChatGPT's 'Memory Dreaming' (asynchronous background synthesis) and Claude's 'Dreams' are conceptual parallels to ctx's Dream Mode — the industry is moving toward ctx's ideas, but stays closed and platform-bound.

Research basis & sources

Research as of 2026-06-17 (WebSearch June 2026). Version/release status: ChatGPT Memory — 'Memory Dreaming' update (async synthesis, limited audit trail) June 2026, 12+-month recall since Jan 2026, memory still not in the standard export. Claude Memory — available to everyone including Free since March 2, 2026; 'Memory Files' dual-mode in testing phase (reported May 24, 2026, no firm date), 'Dreams' in limited beta. Notion AI — Plus $10 / Business $20 (AI bundled) / Enterprise custom; Custom Agents priced by credits ($10/1,000) since May 4, 2026; 50-page context since Jan 2026; Data Residency EU/JP/KR Enterprise-only. Uncertain/not conclusively established (W3/W9): the exact internal mechanics of ChatGPT's audit-trail limitation (primary source TechTimes returned 403 via WebFetch, only a search snippet available); the hosting model of Claude Memory Files (the source gives no details, presumably cloud-only).

PositioningThe landscape splits cleanly into \"platform/suite\" vs. \"focused primitive.\" On the platform side stand the heavyweight, proprietary enterprise suites (Glean with 275+ connectors and permissions-aware org search, Langdock as a GDPR-compliant secure-ChatGPT wrapper, Microsoft Azure AI/Foundry as a fully managed RAG/agent-memory stack), as well as the open-core agent-memory platforms with a managed upsell (Mem0, Letta, Zep) — they deliver breadth, scaling, production-grade multi-tenancy, compliance certifications, and public benchmarks, in exchange for ongoing costs and vendor/cloud lock-in. Alongside them is the pure retrieval INFRASTRUCTURE (Pinecone/Weaviate/Qdrant), on which you first build memory yourself, and the vendor-locked, LLM-native features (ChatGPT/Claude/Notion), which trade maximum convenience at zero setup for silo lock-in. ctx is the deliberate counter-model at the other end of the spectrum: not a platform competitor, but a focused, fully sovereign self-hosted primitive that collapses the entire memory layer into a single-binary Postgres monolith — its closest direct relative is gbrain (self-hosted agent memory, convergent in its retrieval core), with the strategic fork running there between gbrain's broad, MIT-licensed, Git-Markdown-centric single-operator knowledge OS with a hosted default/public eval/mass mindshare and ctx's all-local-$0, MPL-2.0, latent-linked, cyclic-temporal Cross-Tenant primitive. Rule of thumb: platform convenience, scaling, benchmark evidence, and org governance -> competitors; data sovereignty, $0 operation, architectural control, latent/temporal retrieval depth, and a vendor-neutral Cross-LLM bridge -> ctx.