Skip to main content
MemoryBrain

===========

Long-term memory library for AI assistants, chatbots, and autonomous agents.
Stores memories in a local SQLite database with intelligent ranked retrieval.

Requirements
------------
- Python 3.10 or newer
- No third-party runtime dependencies

Installation
------------
pip install memorybrain

Or install from source:

pip install .

Quick Start
-----------
from memorybrain import MemoryBrain

brain = MemoryBrain()

brain.remember(
"User likes Flutter development",
tags=["flutter", "programming"],
importance=10,
)

results = brain.recall("What framework does the user like?")
for memory in results:
print(memory.text)

matches = brain.search("Flutter")
print(matches)

print(brain.stats())

API Overview
------------
remember(text, tags=None, importance=5)
Store a new memory. Returns a Memory object.

recall(query, limit=10)
Retrieve memories ranked for a natural-language query.

search(query, limit=10)
Search memories by keyword relevance.

forget(memory_id)
Delete a memory by ID. Returns True if deleted.

export("memories.json")
Export all memories to a JSON file.

import_file("memories.json")
Import memories from JSON (upsert by ID).

stats()
Return statistics:
- total_memories
- most_common_tags (list of {tag, count})
- database_size_bytes

Custom Database Path
--------------------
brain = MemoryBrain(db_path="./data/my_memories.db")

Default location: ~/.memorybrain/memories.db

Build and Publish to PyPI
-------------------------
Install build tools:

pip install wheel twine build

Build source distribution and wheel:

python setup.py sdist bdist_wheel

Or using the modern build frontend:

python -m build

Validate packages:

twine check dist/*

Upload to PyPI (requires PyPI account and API token):

twine upload dist/*

Test upload to TestPyPI first:

twine upload --repository testpypi dist/*

License
-------
MIT License — see LICENSE.txt


MIT License

Copyright (c) 2026 MemoryBrain Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Metadata

Release files for memorybrain 1.0.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 memorybrain 1.0.0
File Size Uploaded Provenance Actions
memorybrain-1.0.0.tar.gz 10.9 kB Without provenance Details for memorybrain-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for memorybrain 1.0.0
File Interpreter ABI Platform Actions
memorybrain-1.0.0-py3-none-any.whl Python 3 none any Details for memorybrain-1.0.0-py3-none-any.whl

Total release size: 21.5 kB

Release files / memorybrain-1.0.0.tar.gz

Download URL memorybrain-1.0.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ea827927c1a0328ee0e6ead55bc5407b09698cf6166ce95da7591cfe509edc93
BLAKE2b-256 checksum
How to use checksums
dba762fc3154b1fb29466425fa38369a66999dcae8aefdbc5b7a7858bea1c613
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / memorybrain-1.0.0-py3-none-any.whl

Download URL memorybrain-1.0.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9b80687fb02624a363a47d0e1365a5eda7e900af05ffb4c73f80057f40cedab
BLAKE2b-256 checksum
How to use checksums
7b5ee98fe20876a27ccbb6120f0c1ae4ca2de598de3196609fe8af637747264c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for memorybrain 1.0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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