mainspring-memory
长期记忆外挂(M5):可插拔后端 + 语义召回 + 模型可调用的 remember 工具。记忆不进 core。
安装
pip install mainspring-memory
用法
from mainspring_memory import InMemoryBackend, MemoryRecall, MemoryRecord, MemoryScope
backend = InMemoryBackend()
await backend.add(MemoryRecord(content="用户偏好深色模式"))
hits = await backend.search(MemoryScope(), "深色模式")
agent = Agent(..., fragment_sources=[MemoryRecall(backend)])
单文件场景用 SqliteBackend;mainspring-memory[postgres] 提供 asyncpg 后端,可与会话同库。
宿主注入 embedder 时,SemanticBackend 可把任意后端包装成向量召回。
mainspring 工作区成员,与 core 同源。MIT。
Metadata
Release files for mainspring-memory 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mainspring_memory-0.1.2.tar.gz | 15.2 kB | With provenance | Details for mainspring_memory-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mainspring_memory-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for mainspring_memory-0.1.2-py3-none-any.whl |
Total release size: 34.8 kB
Release files / mainspring_memory-0.1.2.tar.gz
| Download URL | mainspring_memory-0.1.2.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c991ad7167f0c77560ca804b967fffecea60f678733e440fa2a7c3bfdc1af89a
|
|
BLAKE2b-256 checksum How to use checksums |
1b047d97a079178c410986c276697dbdcaee827f8784fd9fd2b2d2b5f7f6ddd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logRelease files / mainspring_memory-0.1.2-py3-none-any.whl
| Download URL | mainspring_memory-0.1.2-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bebc07375a887c8953070e5861a75bd3a5b6b01a727f582c08674541337100c5
|
|
BLAKE2b-256 checksum How to use checksums |
b9a46611058cfd7bf36c0d38f1b267c4fc1aec2610800340813a85faccd29354
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logSecurity for mainspring-memory 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mainspring_memory-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.