Skip to main content

沙漏记忆系统 — 纯本地零依赖L3思考层

Project description

NexSandglass ⏳ — 沙漏记忆系统

pip install nexsandglass · 纯本地 · 零依赖 · 零 API Key

PyPI Python License


不是记住你说过什么——是理解你怎么变成今天的你。

投石问路 + 影子沙双引擎搜索 · 偏移率感知 · 管道聚合画像 · 四层问答式极简注入。纯本地,零依赖,越用越懂你。


快速开始

pip install nexsandglass
from sandglass_vault import search, count
from sandglass_log import log_message

log_message("今天讨论了搜索排序优化", "user")
print(search("搜索排序"))
print(f"沙漏总量: {count()}条")

Hermes 用户:

hermes plugins install lovevin1314-tech/NexSandglass
# 重启 Desktop → 设置 → 记忆体 → 选择 NexSandglass

MCP 用户:

git clone https://github.com/lovevin1314-tech/NexSandglass-Agent-DedicatedMemory
python sandglass_mcp.py

Docker:

docker-compose up -d

与现有方案对比

维度 Mem0 / Letta NexSandglass
依赖 向量数据库+N个包 零依赖,纯 stdlib
注入量 ~200-22000t ~60t
决策追踪 决策粒子+偏移率+心理预判
情绪感知 情绪熵(会话级摘要)
画像溯源 可追溯到行号
搜索 向量检索 四路并发(影子沙+FTS5+IDX+TF-IDF)
安装 服务栈 pip install

五大支柱

支柱 做什么
🧬 管道聚合画像 fact_tags + decision_particles → 越用越懂你
📊 偏移率 省钱/愿投/放弃 三维量化 + 跨阶段对比
🔍 搜索滤镜 六维感知扩展关键词
🧵 织布机 四支柱合成 + 矛盾检测
🪡 织线 正则三元组,纯本地因果链

设计原则

  1. 层追加不替换 — 新层叠加,永不修改下层
  2. 纯本地 — Python stdlib + SQLite,零外部依赖
  3. 极简注入 — 每轮 ~60t,LLM 按需搜索
  4. 越用越懂你 — 管道数据随沙子自然积累

性能基准

操作 median p99
L1 写 单次落沙 4.3ms 19.5ms
L2 搜 FTS5搜索 1.6ms 5.4ms
影子沙 0.7ms 1.2ms
四路并发 79.4ms
L3 思 偏移率 <0.1ms
情绪熵(会话级) 6.5ms
心理预判 7.0ms
铁律因子 <0.1ms

测试:5900条 · Windows 10 · i5-8265U · Python 3.11 · 完全隔离


版本历程

V2.10 — PyPI 发布

pip install nexsandglass — 全球 AI Agent 一键安装。两段式轮次注入(60t),DB 自省增量启动,沙子自愈,Porter Stemmer。

V2.9 — 极简注入 + 纯本地化

四路并发搜索 + 管道聚合画像 + 去 LLM 全链路闭环。偏移率·纠结度·铁律因子·停用词过滤。

V1.x — 奠基

偏移率·情绪感知·决策粒子·影子沙·织布机·场景系统·回音折

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexsandglass-2.10.4.tar.gz (133.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexsandglass-2.10.4-py3-none-any.whl (152.9 kB view details)

Uploaded Python 3

File details

Details for the file nexsandglass-2.10.4.tar.gz.

File metadata

  • Download URL: nexsandglass-2.10.4.tar.gz
  • Upload date:
  • Size: 133.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nexsandglass-2.10.4.tar.gz
Algorithm Hash digest
SHA256 6f072c54d73cf1eaa507ca47f03407476b06bd414b4784c1b8dd130e68b5271e
MD5 aee1f471bd71075dccb9fb6765e43d78
BLAKE2b-256 f80f1a995a47db0f822c4c1dd04126c5669efe6abd74a3fd8d96b11419d4d5fd

See more details on using hashes here.

File details

Details for the file nexsandglass-2.10.4-py3-none-any.whl.

File metadata

  • Download URL: nexsandglass-2.10.4-py3-none-any.whl
  • Upload date:
  • Size: 152.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for nexsandglass-2.10.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0217aac2e3abc97d8e3d9db0056f3e5f3b996c5dc9114169faaf90e3df66b0f0
MD5 aa112e9e6284e9e796622176421276d7
BLAKE2b-256 0ec3daf3e71ea9e6ab7ff80f7ed89713f6547ae4694804b71cfaaeed6a5fa064

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page