Skip to main content

Biologically-inspired agent memory with decay, consolidation, and tiered storage

Project description

cognitive-memory

Biologically-inspired agent memory with decay, consolidation, and tiered storage.

PyPI version

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

MIT

Project details


Download files

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

Source Distribution

cognitive_memory-0.3.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

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

cognitive_memory-0.3.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file cognitive_memory-0.3.0.tar.gz.

File metadata

  • Download URL: cognitive_memory-0.3.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

Hashes for cognitive_memory-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bc89bc67a22912448cbe98835bfa1f49d9e873cdfc123e8eda10639b5a3c59d2
MD5 ce31ce55e4d14aefe9e399af48110901
BLAKE2b-256 cfaae057ababaa84648f5e355221493c10866d1b7a9607068c60501d36d3a0a9

See more details on using hashes here.

File details

Details for the file cognitive_memory-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cognitive_memory-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be199abf7a16832a377d1bf001469f4db69483dffdd6e6d282062f22d34bbefe
MD5 86508dde7303be7ea3f83eaf5764dd29
BLAKE2b-256 720fc2d2669b2869a21d61f00a9d77fc54f5325e7824e0d4918126b7d6317345

See more details on using hashes here.

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