Metadata-Version: 2.4
Name: lighthouse-memory
Version: 0.1.0
Summary: AI Agent Memory System — coordinate-based memory management with 30M parameter models
Author-email: AgenBot11 <dev@lighthouseos.ai>
License: MIT
Project-URL: Homepage, https://github.com/AgenBot11/LightHouseOS
Project-URL: Repository, https://github.com/AgenBot11/LightHouseOS.git
Keywords: memory,ai-agent,llm,rag,claude-code
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# LightHouseOS

> AI Agent 记忆系统 — 让小模型管理记忆，让记忆永不丢失、越用越精准

LightHouseOS 是一个轻量级 AI Agent 记忆系统，基于 **坐标索引**（而非向量检索）和 **三个 33M 参数的小模型** 实现长期记忆管理。

## 核心思路

与所有主流记忆系统（Mem0、MemGPT、RAG）不同，LightHouseOS **不用向量检索**：

```
传统方案: 对话 → 嵌入向量 → 向量数据库 → 余弦相似度检索 → 注入提示词
LightHouseOS: 对话 → 小模型分类 → pin 坐标 → 哈希索引查找 → 直接返回
```

三个模型各自专攻一个环节：
- **输入模型** (33M) — 对话 → pin坐标(event, entity, topic) + importance
- **召回模型** (33M) — 查询 → pin坐标 + precision
- **整理模型** (33M) — 修正错误的 pin 标注

## 快速开始

```bash
pip install lighthouse-memory

# 写入记忆
lh write "我刚把 update_query 的返回值从 Vec<Row> 改成 usize" \
  --event 代码修改 --entity src/db.rs --topic 数据库层

# 查询记忆
lh recall "刚才改了啥"

# 列出最近记忆
lh list
```

### 集成到 Claude Code

```bash
lh serve
```

然后在 Claude Code 的 MCP 配置中指向这个服务，即可通过 tools 读写记忆。

## 项目结构

```
lighthouse-memory/
├── lighthouse/
│   ├── memory/        # TF Database (pin index + fragment archive)
│   ├── models/        # 模型推理（计划中）
│   ├── cli/           # 命令行工具
│   └── server/        # MCP 服务器
├── Models/            # 训练代码
├── Docs/              # 设计文档
└── scripts/           # 工具脚本
```

## 设计文档

- [总纲](Docs/总纲.md) — 顶层架构
- [TECH_SPEC.md](Docs/TECH_SPEC.md) — TF Database 详细设计
- [ROADMAP.md](Docs/ROADMAP.md) — 开发路线图

## License

MIT
