Skip to main content

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mainspring-memory 0.1.0
File Size Uploaded Provenance Actions
mainspring_memory-0.1.0.tar.gz 15.2 kB With provenance Details for mainspring_memory-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mainspring-memory 0.1.0
File Interpreter ABI Platform Actions
mainspring_memory-0.1.0-py3-none-any.whl Python 3 none any Details for mainspring_memory-0.1.0-py3-none-any.whl

Total release size: 34.8 kB

Release files / mainspring_memory-0.1.0.tar.gz

Download URL mainspring_memory-0.1.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
16f4d4605f789c3f0de79c836840de89490ad5545129b7546bcc353b741502a1
BLAKE2b-256 checksum
How to use checksums
94e7a5ebdde236b43d1a769afb7170977b362096bcbf2ede7a632bb80ac8f457
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 log

Release files / mainspring_memory-0.1.0-py3-none-any.whl

Download URL mainspring_memory-0.1.0-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9a51b6bf70ddb63577fb7a6ee918bd092706eb811449c628ce96345b73f2c92
BLAKE2b-256 checksum
How to use checksums
e84757a7e0ab213a3a6c48f7ad58606842d1251964d0af125894a4a3f18a4962
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 log

Security for mainspring-memory 0.1.0

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.

Select from 2 files

Attestation for mainspring_memory-0.1.0.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page