Biologically-inspired agent memory with decay, consolidation, and tiered storage
Project description
cognitive-memory
Biologically-inspired agent memory with decay, consolidation, and tiered storage.
Install
pip install cognitive-memory
Requires Python 3.10+.
Quick Start
from cognitive_memory import SyncCognitiveMemory
mem = SyncCognitiveMemory(embedder="hash")
mem.add("User is allergic to shellfish", category="core", importance=0.95)
response = mem.search("what allergies does the user have?")
for r in response.results:
print(r.memory.content, f"(score: {r.combined_score:.2f})")
For production, use OpenAI embeddings (set OPENAI_API_KEY):
from cognitive_memory import CognitiveMemory
mem = CognitiveMemory() # defaults to OpenAI embeddings
await mem.add("User prefers dark mode", category="semantic", importance=0.7)
response = await mem.search("UI preferences")
For sync usage in scripts and notebooks, use SyncCognitiveMemory (same API, no await).
Docs
Full documentation, guides, and API reference at bhekanik.github.io/cognitive-memory.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognitive_memory-0.4.0.tar.gz.
File metadata
- Download URL: cognitive_memory-0.4.0.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d43adb96be80742362fb25b33e540994b3dcf345fa6b28195b44528a4697db49
|
|
| MD5 |
e8237039e865b60d981cd7e5f2eb3781
|
|
| BLAKE2b-256 |
34d781b8bd021160d178360196e803609f42981e26ce5f8ee4d759ecad28055a
|
File details
Details for the file cognitive_memory-0.4.0-py3-none-any.whl.
File metadata
- Download URL: cognitive_memory-0.4.0-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a17f8e1be7cb9ae2cb18be434b8cfffe954e1b807f18df42f08af045b50ea4a
|
|
| MD5 |
b26538453c479889d66e1d2113f020c7
|
|
| BLAKE2b-256 |
7b10db58b0a140f3a7ac4d3d9d9501129abdd4bc85ca1c6256ee1bcfd24a6a31
|