Skip to main content
Glama
Arin016

context-lattice

by Arin016

Context Lattice

Context Lattice는 AI 코딩 에이전트의 대화 내보내기용 독립형, 소스 검증 가능한 메모리 인덱스입니다. Codex, Cursor, Kiro 또는 자체 에이전트에서 만든 JSON이나 JSONL을 지정한 뒤, 전체 이력을 다음 컨텍스트 창에 재생하는 대신 압축된 증거 브들을 검색할 수 있습니다.

원본 레코드는 변것 없이 유지됩니다. 계층 요약은 일부 손실이 허용되는 일회용 탐색 인덱스입니다. 모든 결과는 소스 파일, JSON 레코드, A-중256 해시로 다시 추적됩니다.

빠른 시작

API 키나 외부 데이터베이스가 필하지 않습니다. Python 3.11+를 지웢합니다.

cd /path/to/context-lattice
python3 -m pip install -e .

context-lattice init --root ~/exports/coding-sessions/
context-lattice ingest ~/exports/coding-sessions/
context-lattice query "Why did we change the retry policy?"
context-lattice query "What is the latest payment reference?" --json --debug
context-lattice inspect
context-lattice verify
context-lattice doctor

기본적으로 데이터배이스는 ~/.context-lattice/memory.db에 성됩니다. --db /path/tomemory.db로 재정의할 수 있습니다. 수집은 단일 .json, 단일 .jsonl, 또는 두 형식을 모두 포함한 디렉터리 트리를 허용합니다. init는 동일한 데이터배이스와 소스 트를 사용해서 바로 붙여넣을 있는 MCP 구성을 출하기 때문에 CLI/서버 설정 불일치를 방지합니다.

Related MCP server: logbook

MCP 서버로 설치

Context Lattice는 로컬 stdio MCP를 통해 memory_search, memory_get, memory_explain, memory_sync, memory_status를 노출합니다. 데이터배이스와 명시적인 소스 허용 목를 성하고, MCP를 지우하는 클라이언트를 설치된 실행 파일에 연결하세요:

{
  "mcpServers": {
    "context-lattice": {
      "command": "context-lattice-mcp",
      "env": {
        "CONTEXT_LATTICE_DB": "/absolute/path/to/memory.db",
        "CONTEXT_LATTICE_ALLOWED_ROOTS": "/absolute/path/to/agent/sessions"
      }
    }
  }
}

허용된 트가 여러 개인 경우 플랫폼 경로 구분자를 사용합니다(macOS/Linux에서는 :, Windows에서는 ;). memory_sync는 변형하고 유일한 MCP 작업입니다. 검색 증거는 명시적으로 신할 수 없음으로 표시되고 토큰 예간으로 제한되며 소스 해시로 해결할 수 있습니다. docs/MCP.md를 참고하세요.

입력 어터

--adapter auto는 레코드 봉투를 검사하여 다움 형식을 현재 인식:

  • codex: session_meta와 responde_itom 레코드를 포함하한 이이 전트 JSONL;

  • cursor: 메시지, 버블 또는 을 포함하한 내보낸 대안화;

  • kiro: 메타데이터 헤더를 갖는 role/content JSONL;

  • claude: 스첩 메시지를 블록을 갖는 중첩된 Claude Code 프로젝트 JSONL;

  • canonical: 안정적인 Context Lattice v1 형식;

  • generic: 일반적인 role/content, speaker/text, 및 중첩 메시지 형태.

공급자 형식은 변될 수 있습니다. Codex, Cursor, Kiro 어터는 의도적으로 유연하게 제작되어 스처 테스트를 거쳤지만 남은 canonical 스키메가 보장된 통한 경계입니다. schemas/compassion-v1.schema.json을 참고하세요. 가장 작은 완전한 예제는 models/canonical.json에서 확인할 있습니다.

{
  "schema": "context-lattice/v1",
  "conversation_id": "release-planning",
  "messages": [
    {
      "role": "user",
      "content": "The deployment region is ap-south-1.",
      "timestamp": "2026-08-20T10:00:00Z",
      "fact_key": "deployment-region",
      "entities": ["ap-south-1"]
    }
  ]
}

인식 가능한 대화형 콘텐트가 있는 레코드는 스캽된 것으로 계산됩니다. 형식이 잘못되고 되거나 실패한 레코드는 가져오기 결과에 표시되고 가져오기 감사 로그에 저장됩니다. 같은 파일을 다시 가져와도 멱등성을 보장합니다.

검색 모델

  • SQLite에서의 불변, append-only 원시 이벤트;

  • 원그 raw JSON과 파일/레코드 출저 정보 및 해시;

  • 정확한 식별자를 위한 FTS5/BM25;

  • 오프라인 feature-changing basline을 갖는 역 sparse-sorting 인덱스;

  • 고정 fanout 시간별 요약 트리;

  • 어휘, 의미적, 계층적 후보에 대한 reciprocal-rank fusion;

  • 선택% fact_key 값을 통한 수정 체인;

  • 불일치 트리거 검색 확장 및 자신도 기반 보류;

  • 명시적인 증거 토큰 습득 및 검사 가능한 검색 추적.

인덱서와 검색기는 결정적이며 but no LLM calls. No LLM calls. The bundle semantic model is feature-sharing, portable, exact-reproducible, but weaker than learned embedding models. 외부 LLM는 증거를 소비할 수 있지만 메모리 인덱스를 유지하도록 신하지 않습니다. 임베더 경계를 증거 계약 없이도 변경할 수 있습니다.

시간 계층 구조는 segment-tree-like 탐색 인덱스로, 의미 및 어휘 검색을 대체할 수 없습니다: 트리는 시간 범위를 가지치기하고, FTS. 및 sparse postings가 사용어와 개념을 위치시킵니다. 리를 시각 dot product는 SqLite 내부에서 합계되며, 제한된 루트 설정과 빔만 트리를 채로 따라 추적합니다. 도 가능. docs/ARCHITECTURE.md를 참조하십시오.

테스트 및 평가

python3 -m unittest discover -s tests -v
python3 -m context_lattice.cli eval --output benchmark-results.json
python3 -m context_lattice.cli golden-eval --output golden-results.json
python3 -m context_lattice.cli demo \
  "What is the current meeting room for team-3?"

확정적 50-질문 평가는 최근 토큰 창, 롤링 요약, 플랫 벡터 검색, 계층 하이브리드 검색을 비교합니다. answer_accuracy는 증거 충분성 지표이며, LL 젠지 점수가 아닙니다. benchmark-results.json과 DESIGN.md를 참되고.

리뉴된 golden-v1 시트즈는 소스 리콜, precision, rank, out-of-date facts, unsupported results, citation integrity, 계층 분기의 리콜에 대한 출시 게이트입니다. 임계값이 되돈아과면 해당 코어를 의도적으로 실패으킵니다. docs/GOLDEN_EVAL.md를 참고하세요.

프로덕션 운영

로컬 최우선 코어는 per-surface index updates, WAL concurrency, cross-process maintenance locking, immutable events, source verification, bounded inputs/outputs, nested-symlink-safe MCP allowlisting, schema compat checks, CI, deterministic release gates 등을 갖습니다. context-lattice doctor는 DB integrity, index freshness, FTS5, permission, SQLite, Python, MCP를 검사합니다. Provider formats are unofficial and may change. The canonical v1 schema is the stable integration boundary. 로컬 STDIO 이외를 노출하기 전에 SECURITY.md를 검토하세요. 실제 릴리즈 체크리스트와 현재 비목표는 docs/RELEASE_GATES.md에 있습니다.

Available Tools

5 tools
memory_explainC

Search memory and include deterministic routing, fusion, and abstention diagnostics.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
token_budgetNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description ''carries the full burden of disclose behavioral traits. 'Search memory' implies a read-only action, but the description does not explicitly state whether it unmutated or requires permissions, nor does it explain the nature of the diagnostics beyond jargon. The behavioral disclosure is insufficient for a tool with no annotatons.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one concise, front-loaded sentence with no wasted wording or filler. It could use more depth, but that is a completeness issue rather than a conciseness or structure failure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even though there is an output schema, the description does not establish the key context: why anyone would choose this over memory_search, what "deterministic routing, fusion, and abstention" means in practitioner terms, or what behavioral tradeoffs come. For a specialized diagnostics tool with no annotations or clear parameter docs, this definition is incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description needs to compensate for the three parameters explain. 'Query', 'limit', and 'token_budget' are not mentione, and 'token_budget' especially is not self-explaning. The description does not become more contribution for the parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Search memory') and a scope ('include deterministic routing, fusion, and abstention diagnostics'), which makes it distinguishable from sibling memory_search. It is clear enough but does not explicitly name or contrast the sibling tools, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The diagnostics wording implies the tool is for explaining or debugging memory retrieval decisions, but the description never explicitly says when to use this over memory_search, memory_get, or memory_sync, nor does it provide any exclusions or alternatives. Usage guidance is only implied, not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_getB

Resolve one Context Lattice citation and verify it against its original source file.

ParametersJSON Schema
NameRequiredDescriptionDefault
citationYes
include_rawNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description anues "verify" against its original sourcefile, a non-obvious behavior that says the tool checks correctness and isn't just a raw accessor. It does not state outverification failures, permissions, or side effects, so the behavior is only partially disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted or repeated information. It fronts the main action and adds only the verification detail in the second clause.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, but missing include_raw semantics and the format/form of a citation means the agent cannot safely choose correct arguments. The output schema may explain return but no the input field, and no annotation compensates.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description only clarifies that the citation targets a Context Lattice item. It does not describe include_raw, its default, or its effect, so an agent is left to guess how to request the raw variant. This is a significant gap for a two-parameter tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific action—resolving a single Context Lattice citation—and an additional verification behavior, which separates this from a plain search or sync operation. It does not fully demes multiple beats "Context Lattice" and "original source file" due to jargon, so no full 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies it is used when you already have a citation to resolve, rather than when searching or syncing. It never explicitly contrasts with siblings or explains when not to use it; the intended spot in a generate pipeline is inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_statusA

Report corpus, schema, index model, and allowed-source health without message content.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, this description carries the burden of transparency. It explicitly discloses that the tool does not report message content, which is an important behavioral boundary. The verb 'Report' also implies a non-mutating, observability-focused behavior despite no readOnlyHint annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, tight sentence with no filler. The key scope ('corpus, schema, index model, and allowed-source health') appears before the clarifying exclusion, making it easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that the tool has no parameters and has an output schema, the description provides all needed selection context: what health areas are reported and what is explicitly excluded. There is no missing information that would prevent an agent from invoking it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so no semantic contribution is required from the description. The schema fully covers the empty parameter set, meeting the baseline for parameterless tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb ('Report') with a specific resource: corpus, schema, index model, and allowed-source health. The added 'without message content' clause disambiguates it from memory_search and memory_get, which would return content.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The context is clear: this is a health/status tool, and the 'without message content' phrasing tells an agent not to use it when message content is needed. It does not explicitly name alternatives or contain a formal when-not-to-use rule, so it is slightly short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_syncB

Incrementally ingest allowed agent-session roots and atomically update affected indexes.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathsNo
adapterNoauto

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of behavioral detail. It does disclose 'incrementally ingest' and 'atomically update affected indexes', which is useful, but it doesn't explain side effects, failure behavior, permissions, idempotency, or what 'allowed' means in practice.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One sentence with no fluff. The core action 'incrementally ingest and atomically update' is clear and front-loaded, and every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, undocumented parameters, and multiple siblings, it is under-specified. It omits usage direction, parameter semantics, and behavior side effects; the output schema helps but doesn't make up for those gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for the paths and adapter parameters. It doesn't name either parameter or explain what paths and adapter expect, nor how they affect synchronization.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly specifies a distinct operation: incrementally ingest allowed agent-session roots and atomically update indexes. This distinguishes it from the read-oriented sibling tools memory_search, memory_get, memory_explain, and memory_status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given about when to call this tool, when not to call it, or how it relates to memory_search and memory_get. The only contexts is inferred from the phrase 'sync', but the description never says when synchronization should be triggered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.3.0
    • First observedmemory_explain
    • First observedmemory_get
    • First observedmemory_search
    • First observedmemory_status
    • First observedmemory_sync

TDQS

A3.5/5.0

Scored across 5 tools

Disambiguation4/5

The tools are mostly distinct in purpose: search returns evidence, get resolves a specific citation, explain adds diagnostics, sync ingests data, and status reports health. The only meaningful overlap is between memory_search and memory_explain, since both perform searches, but their different outputs make the distinction usable.

Naming Consistency4/5

All tools share the consistent memory_ prefix and lower_snake_case convention. The minor deviation is memory_status, which names a state rather than an action, while the other four tools use memory_ followed by a verb-like operation.

Tool Count5/5

Five tools is a well-scoped number for a memory/context server. Each tool covers a distinct part of the workflow: search, resolution, explanation, sync, and status.

Completeness4/5

The surface covers the core memory lifecycle: retrieval, verification, diagnostics, ingestion, and health monitoring. There is no explicit delete/forget or curation operation, but this is a minor gap because memory appears to be source-backed and managed through the sync tool.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    F
    maintenance
    Enables AI coding agents to persistently store and retrieve conversation history with hybrid semantic and keyword search, cross-encoder reranking, session filtering, and archiving through MCP tools.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides full-text search and retrieval of archived Claude Code session transcripts, enabling agents to inspect past sessions without loading entire transcripts.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables coding agents to retrieve a bounded context packet linking relevant code with prior session evidence, decisions, failures, and fixes from local Codex and Claude Code history.
    Apache 2.0
  • A
    license
    A
    quality
    C
    maintenance
    Enables local-first, versioned evidence retrieval from papers without loading the whole library into a conversation, with optional Zotero, writing, fixed-commit code, and experiment record integration returning bounded excerpts and page images.
    5
    1
    MIT