Skip to main content
Glama

ContextLattice

context-lattice MCP server

为什么选择 ContextLattice

ContextLattice 通过将之前的项目工作转化为高价值、可检索的上下文,减少了重复推理。

  • 持久化内存写入,并扇出至专用存储。

  • 具备分阶段获取和故障开放延续功能的快速+深度检索模式。

  • 优先使用汇总上下文,在保持高效 Token 使用的同时,保留通往原始工件的深入路径。

  • 本地优先部署,并提供可选的云端依赖支持。

  • 通过 HTTP API、MCP 传输和操作仪表板实现人机协作 UX。

Related MCP server: Context Fabric

架构 (Public v3 lane)

层级

主要运行时

职责

网关/API

Go

/memory/* + /v1/* 编排、分阶段检索策略、延续生命周期

检索 + 内存服务

Go + Rust

快速/持久检索通道、汇总处理、内存库适配器

旧版回退

Python

仅用于兼容性回退(非默认热路径)

仪表板

TypeScript/Next.js

控制台、思维导图、状态、计费、设置 UX

安装

非技术用户安装程序

  • macOS DMG: https://github.com/sheawinkler/ContextLattice/releases/latest/download/ContextLattice-macOS-universal.dmg

  • Linux bundle: https://github.com/sheawinkler/ContextLattice/releases/latest/download/ContextLattice-linux-bootstrap.tar.gz

  • Windows MSI: https://github.com/sheawinkler/ContextLattice/releases/latest/download/ContextLattice-windows-x64.msi

开发者安装

git clone git@github.com:sheawinkler/ContextLattice.git
cd ContextLattice
gmake quickstart

快速入门

先决条件

  • 兼容 Docker/Compose v2 的运行时

  • macOS、Linux 或 Windows (WSL2)

  • gmake, jq, rg, python3, curl

启动

1) 配置环境

cp .env.example .env
ln -svf ../../.env infra/compose/.env
gmake quickstart

gmake quickstart 会提示输入运行时配置文件,并以合理的默认值启动。 如果从 macOS DMG 引导程序启动,它还会生成:

  • ~/ContextLattice/setup/agent_contextlattice_instructions.md (已复制到剪贴板)

  • ~/ContextLattice/setup/agent_smoke_write_read.md (操作员写入/读取冒烟测试)

验证

ORCH_KEY="$(awk -F= '/^CONTEXTLATTICE_ORCHESTRATOR_API_KEY=/{print substr($0,index($0,"=")+1)}' .env)"

curl -fsS http://127.0.0.1:8075/health | jq
curl -fsS -H "x-api-key: ${ORCH_KEY}" http://127.0.0.1:8075/status | jq '.service,.sinks'

运行时配置文件

配置文件

使用场景

CPU

内存

存储

lite

笔记本电脑友好型本地使用

2-4 vCPU

8-12 GB

25-80 GB

full

更高的吞吐量和更深度的召回

6-8 vCPU

12-20 GB

100-180 GB

核心 API 示例

MCP 工具契约 (Glama-lite / stdio 桥接)

Glama 单容器配置文件暴露了三个具有明确作用域的 MCP 工具:

  • health: 只读就绪/故障排除检查 (GET /health),无副作用。

  • memory.search: 只读作用域检索 (POST /memory/search),包含生命周期状态 (ready|pending|degraded|empty) 以及可选的接地/调试负载。

  • memory.write: 状态变更的持久化写入 (POST /memory/write),包含明确的扇出状态和警告字段。

这三个工具均以文本内容和结构化负载形式返回 JSON,以实现客户端兼容性。

写入内存

curl -X POST "http://127.0.0.1:8075/memory/write" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ${ORCH_KEY}" \
  -d '{
    "projectName": "my_project",
    "fileName": "notes/decision.md",
    "content": "Switched retrieval_mode to balanced for normal runs.",
    "topicPath": "runbooks/retrieval"
  }'

读取内存

curl -X POST "http://127.0.0.1:8075/memory/search" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ${ORCH_KEY}" \
  -d '{
    "project": "my_project",
    "query": "retrieval mode decision",
    "topic_path": "runbooks/retrieval",
    "include_grounding": true
  }'

带有延续元数据的深度读取

curl -X POST "http://127.0.0.1:8075/memory/search" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ${ORCH_KEY}" \
  -d '{
    "project": "my_project",
    "query": "full architecture context",
    "retrieval_mode": "deep",
    "include_grounding": true,
    "include_retrieval_debug": true
  }'

配置 (公共安全要点)

仅设置正常运行所需的内容:

CONTEXTLATTICE_ORCHESTRATOR_URL=http://127.0.0.1:8075
CONTEXTLATTICE_ORCHESTRATOR_API_KEY=<set-by-setup>
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=<long-random-secret>
APP_URL=http://localhost:3000

如需完整配置参考,请使用 .env.example

仪表板

  • UI: http://127.0.0.1:3000/console

  • 思维导图: http://127.0.0.1:3000/mindmap

  • 状态: http://127.0.0.1:3000/status

公共版与付费版

此仓库跟踪公共免费通道 (v3.x)。 高级付费调优、专有优化策略以及私有商业化文档位于此公共通道之外。

文档

  • 网站文档: https://contextlattice.io/

  • 本地文档索引: docs/

  • Hugging Face lite 部署: docs/huggingface-space-lite.md

许可证

Apache 2.0。请参阅 LICENSE

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - A tier

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sheawinkler/context-lattice'

If you have feedback or need assistance with the MCP directory API, please join our Discord server