LightHouseOS
AI Agent 记忆系统 — 让小模型管理记忆,让记忆永不丢失、越用越精准
LightHouseOS 是一个轻量级 AI Agent 记忆系统,基于 坐标索引(而非向量检索)和 三个 33M 参数的小模型 实现长期记忆管理。
核心思路
与所有主流记忆系统(Mem0、MemGPT、RAG)不同,LightHouseOS 不用向量检索:
传统方案: 对话 → 嵌入向量 → 向量数据库 → 余弦相似度检索 → 注入提示词
LightHouseOS: 对话 → 小模型分类 → pin 坐标 → 哈希索引查找 → 直接返回
三个模型各自专攻一个环节:
- 输入模型 (33M) — 对话 → pin坐标(event, entity, topic) + importance
- 召回模型 (33M) — 查询 → pin坐标 + precision
- 整理模型 (33M) — 修正错误的 pin 标注
快速开始
pip install lighthouse-memory
# 写入记忆
lh write "我刚把 update_query 的返回值从 Vec<Row> 改成 usize" \
--event 代码修改 --entity src/db.rs --topic 数据库层
# 查询记忆
lh recall "刚才改了啥"
# 列出最近记忆
lh list
集成到 Claude Code
lh serve
然后在 Claude Code 的 MCP 配置中指向这个服务,即可通过 tools 读写记忆。
项目结构
lighthouse-memory/
├── lighthouse/
│ ├── memory/ # TF Database (pin index + fragment archive)
│ ├── models/ # 模型推理(计划中)
│ ├── cli/ # 命令行工具
│ └── server/ # MCP 服务器
├── Models/ # 训练代码
├── Docs/ # 设计文档
└── scripts/ # 工具脚本
设计文档
- 总纲 — 顶层架构
- TECH_SPEC.md — TF Database 详细设计
- ROADMAP.md — 开发路线图
License
MIT
Metadata
Release files for lighthouse-memory 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lighthouse_memory-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / lighthouse_memory-0.1.0-py3-none-any.whl
| Download URL | lighthouse_memory-0.1.0-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05e24f576230028000162e335af795dc8dae736685d6596c999220ab36b5b007
|
|
BLAKE2b-256 checksum How to use checksums |
a71b9f5e49edc4ff519ec747b198432d079165b647812d3203e7cd442f432b48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|