Skip to main content

SQLite for associative memory — embedded, single-file, zero-config associative memory engine powered by Modern Hopfield Networks

Project description

MemHop

嵌入式联想记忆引擎。O(1) 召回,单文件存储,零配置。

安装

pip install memhop

Python 3.10+,预编译 wheel,无需本地编译。

Quick Start

import memhop

# 打开数据库
with memhop.open("brain.db") as db:
    # 写入记忆
    db.remember("今天吃了豆浆油条", meta={"tags": ["早餐"]})

    # 联想召回(O(1))
    m = db.recall("早餐吃了什么")
    print(m.text)       # "今天吃了豆浆油条"
    print(m.confidence) # 0.94

API

方法 说明
db.remember(text, meta?) 写入记忆
db.recall(cue) 联想召回最佳匹配
db.recall_topk(cue, k=5) Top-K 召回
db.search(filters) 按 meta 过滤
db.recent(limit=5) 最近记忆
db.forget(id) 删除
db.update(id, text?, meta?) 更新
db.remember_batch(items) 批量写入
db.purge_before(datetime) 清理旧记忆

核心特性

  • O(1) 召回:Modern Hopfield Network,与记忆总量无关
  • 单文件:LMDB 持久化,brain.db 即走即拷
  • 零模型默认:字符 n-gram 哈希,无需下载模型
  • 三层记忆:entity(纠缠图)/ knowledge(知识树)/ episode(原文)

License

All Rights Reserved. Copyright (c) 2026 MemHop Contributors.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

memhop-0.2.0-cp310-cp310-win_amd64.whl (553.8 kB view details)

Uploaded CPython 3.10Windows x86-64

memhop-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (579.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

memhop-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (526.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file memhop-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: memhop-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 553.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for memhop-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fc0b28d69bb7c28a7ef005c3e152d8230a88ae4cecd0a668a6bf66ef46df87a1
MD5 df24f7285e739183556dd33a8cbb1f60
BLAKE2b-256 aed521fb40b3fad2308ec4fb5d084266f4ab4670b961cb090774a968f90b0c9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for memhop-0.2.0-cp310-cp310-win_amd64.whl:

Publisher: workflow.yml on qyiun666/MemHop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memhop-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for memhop-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4ec3a4329fe8b3c8b5725294fd50d44aae2935c8d027b24ff1805091af7f2388
MD5 ce1d468fd319193d3ce4760f0af2338c
BLAKE2b-256 1f78be61b294a23ef99f0fac56cbe170cbac427fe870567f53538aaf3557edc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for memhop-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: workflow.yml on qyiun666/MemHop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memhop-0.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for memhop-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f18c579be5bdfa19a58958449f39ec7e86b1471956f82b11e4d7b9b283c1c04
MD5 6c61638f7966de5efc9086212dbe8c68
BLAKE2b-256 c4b94cef9e2733d3cc331bf21e5d0ce6a84a4f53ee60dba6e2705495757c2a03

See more details on using hashes here.

Provenance

The following attestation bundles were made for memhop-0.2.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: workflow.yml on qyiun666/MemHop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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