
Llm Kosh
io.github.rastogivaibhav由 GitHub 账号 rastogivaibhav 发布v2.1.3更新于 Oct 27, 2026
Local-first AI memory cartridge with persistent MCP memory for Claude via SQLite FTS5.
概览
本地优先的 AI 记忆卡带,通过本地文件与 SQLite FTS5 为 MCP 客户端提供持久、可检查的记忆。
- 可以做什么
- 在本地卡带中保存、查询与召回持久记忆,底层为普通文件加 SQLite/FTS 索引
- 提议、召回、查看、列出冲突并审阅受信任记忆,写入与变更需显式开启权限
- 执行证据感知的验证,报告支持事实、矛盾、因果路径、证据缺口与明确弃答
- 登记已有文件,生成带引用的上下文包以及会话或事件图谱
- 从受监视的收件文件夹导入材料,并运行后台摄取与维护任务
- 适用场景
- 适合希望助手跨会话、跨客户端保留记忆,又不想把工作区交给托管记忆服务的场景;也适合需要记忆保持可读、可审计且有证据支撑的用途。
- 运行要求
- 以本地 Python 包形式通过 stdio 运行,需要 Python 3.10 或更高版本;必须通过环境变量 CARTRIDGE_WORKSPACE 指定作为记忆卡带根目录的本地文件夹。可选扩展提供文件系统监视、FastAPI 服务、本地语义搜索与文档摄取。未声明需要账号或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Llm Kosh,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
LLM-Kosh
Local-first durable memory for AI agents.
Give Claude, Cursor, and other MCP-compatible clients persistent, inspectable memory without handing your workspace to a hosted memory service.
Kosh Verify makes that memory show its work: evidence, timing, causal paths, contradictions, inference boundaries, missing evidence, and abstention.
[PyPI] [Python] [Tests] [Quality] [License: MIT] [GitHub stars]
Quickstart · Kosh Verify · Architecture · MCP · Security · Contributing
Why this exists
AI agents can reason across increasingly long workflows, but their memory is often either ephemeral or delegated to opaque hosted services.
LLM-Kosh treats memory as local infrastructure: inspectable, portable, auditable, permissioned, and usable across MCP-compatible clients.
It gives agents a durable memory layer built from ordinary local files plus structured indexes and governance controls:
- Local-first — your cartridge stays on your machine by default.
- Inspectable — memory remains readable, backupable, diffable, and reviewable.
- Auditable — mutations are recorded in a tamper-evident ledger.
- Permissioned — MCP starts read-only; write, mutation, and private export require explicit opt-in.
- Portable — one cartridge can support multiple compatible AI clients and workflows.
- Evidence-aware — Kosh Verify can distinguish support, contradiction, inference, evidence gaps, and absence.
Install it:
python -m pip install --upgrade llm-kosh
Kosh Verify: memory that can show its work
Long-lived memory creates a different failure mode from a one-off bad answer: a weak or misunderstood memory can be recalled again in later sessions.
Kosh Verify is LLM-Kosh's evidence-aware verification surface. Given the evidence already present in a cartridge, it can produce a structured report containing temporal context, supporting facts, causal paths, contradictions, inferred-but-not-discovered relationships, missing evidence, stability information, and an explicit abstention state when there is not enough evidence.
It is not a universal truth oracle and it does not make an imported source trustworthy simply because it was stored. The aim is to preserve the difference between what the cartridge observed, what it inferred, what conflicts, and what it cannot support.
Try the deterministic synthetic incident demo:
--demo-seed writes synthetic incident evidence into the selected root, so use a disposable directory. The same behavior is covered by automated tests and a network-free acceptance harness:
See Kosh Verify for the contract, boundaries, API example, MCP surface, and reproducible checks.
What makes LLM-Kosh different
Architecture
The repository root contains the code. The cartridge root contains the live memory store. Watched intake folders can feed new material into the cartridge without mixing runtime data into the source checkout.
60-second quickstart
Python 3.10 or newer is required.
That installs the package, creates the default cartridge at ~/.llmkosh/cartridge, configures local defaults, and registers supported desktop integration where possible.
Create and query a custom cartridge:
Manage the background service:
What works today
The core project is usable now:
- Python package published as
llm-kosh - local CLI for creating, searching, importing, packing, and verifying cartridges
- governed
llm-kosh-memoryCLI for proposing, recalling, inspecting, conflicting, and explicitly reviewing Trusted Memory - Kosh Verify CLI and Python API for evidence-aware temporal/causal verification
- deterministic Kosh Verify incident demo and acceptance tests
- local MCP server with explicit write, mutation, and private-export capability gates
- source-level MCP composition that adds read-only
kosh_verifyplus governed Trusted Memory tools without changing those gates - background service for intake and maintenance jobs
- plain-file, inspectable storage with local indexes
- tamper-evident mutation ledger
- GitHub Actions test, quality, security-scanning, and publishing workflows
- experimental company-brain foundation for evidence-backed memory and cited context
The remaining release work is primarily desktop packaging polish and signing across Windows, macOS, and Linux. The llm-kosh-mcp and llm-kosh-memory entry points described here are present on current master source and are intended for the next package release; the currently published PyPI 2.1.3 package predates those entry points.
Use with MCP clients
The currently published package exposes the standard MCP server through the existing CLI:
On current source, the composed MCP entry point exposes the standard server, read-only kosh_verify, and governed Trusted Memory tools:
Equivalent module invocation:
The Trusted Memory MCP surface is deliberately permissioned:
trusted_memory_recall,trusted_memory_inbox,trusted_memory_conflicts, andtrusted_memory_explainare read-only.trusted_memory_proposerequires--allow-write.trusted_memory_reviewrequires--allow-mutate.- agent-created proposal evidence is recorded as
agent_observation, never self-elevated touser_direct. - explicit review can change lifecycle without rewriting the original source authority; strict recall still requires authoritative/trusted evidence.
Kosh Verify does not require additional privileges. Write, mutation, and private-export capabilities remain opt-in and continue to use the standard server flags:
The composed server also supports local streamable HTTP:
Treat HTTP transport as a real network boundary if you expose it beyond loopback. See Trusted Memory over MCP for the governed memory contract, Kosh Verify for the kosh_verify contract, and MCP guide for general MCP setup.
Company-brain foundation
The experimental company-brain layer extends the cartridge beyond simple note recall. It introduces reference-first evidence, session and episode understanding, evidence-backed memories, review lifecycles, permission-first retrieval, and structured cited context packs.
Migrate an existing cartridge:
Register existing files without copying their source bytes:
Build a replayable session or episode graph from a registered JSONL export:
Core concepts
Three locations matter:
- Repository root — the source checkout.
- Cartridge root — the live memory store selected by
--rootorLLMKOSH_ROOT. - Watched intake folders —
receipts/,intake/, and configured external drop folders.
If files are dropped into cartridge intake areas, the service can process them asynchronously. External folders can also be watched through [daemon].watched_directories.
Optional features
MCP support is included in the base installation.
Security model
LLM-Kosh is intentionally conservative around agent privilege and export boundaries:
- storage and search are local by default
- there is no automatic cloud sync or package telemetry
- MCP starts read-only
- write, mutation, and private-export capabilities require explicit opt-in
- optional HTTP transport is a real network boundary and should be configured accordingly
- exported context is checked for common secret patterns before sharing
- cartridge files are plaintext by design, so use operating-system disk encryption when local data at rest requires encryption
See SECURITY.md for the canonical threat model, reporting guidance, and current security boundaries.
Project status
LLM-Kosh is actively maintained open-source infrastructure for durable agent memory.
The Python package, CLI, MCP server, local service, Kosh Verify surface, test workflow, and publishing path are operational. Current work focuses on interoperability, packaging, governed memory, evidence-aware verification, and making the project easier for external contributors to extend safely.
The Electron desktop app is packaged separately from the Python package. Local developer builds and Windows installer smoke tests are supported; public GA desktop distribution still requires verified Windows code signing and macOS Developer ID signing/notarization.
See GA_READINESS.md for the detailed release posture.
Developer workflow
Run the small public verification acceptance contract separately:
For packaging or release changes:
Native C++ math acceleration is optional. Set LLM_KOSH_BUILD_NATIVE=1 and install pybind11 before building to test it. Release wheels use the portable pure-Python fallback.
Contributing
Contributions are welcome, especially around:
- MCP interoperability
- tests and regression coverage
- packaging and cross-platform reliability
- documentation
- local-first memory workflows
- security hardening
- evidence and retrieval quality
- reproducible verification and benchmark methodology
Please read CONTRIBUTING.md before proposing substantial changes. Use GitHub Issues for reproducible, non-sensitive bugs and feature proposals, and follow SECURITY.md for security-sensitive reports.
Documentation
Open source
LLM-Kosh is maintained in the open under the MIT License.
Bug reports, focused pull requests, interoperability improvements, tests, and documentation contributions are welcome.
来源:README.md,提交 4abb479
工具
0版本历史
1- v2.1.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分