Skip to main content

Persistent memory + emergent identity engine for any LLM

Project description

kore-mind

Persistent memory + emergent identity engine for any LLM.

One file = one mind. SQLite-based. Zero config. Zero external dependencies. Runtime-agnostic.

Install

pip install kore-mind

Usage

from kore_mind import Mind

mind = Mind("agent.db")

# Register experiences
mind.experience("User works on complexity theory proofs")
mind.experience("User prefers direct, concise answers")

# Recall relevant memories
memories = mind.recall("proof techniques")

# Reflect: decay old memories, consolidate, update identity
identity = mind.reflect()
print(identity.summary)

# Forget: explicit pruning
mind.forget(threshold=0.1)

Core concepts

  • Memory has a lifecycle: salience decays over time. Unused memories fade. Accessed memories strengthen.
  • Identity is emergent: not configured, but computed from accumulated memories.
  • reflect() is the key operation: decay + consolidation + identity update.

API

Method Description
experience(text) Something happened. Record it.
recall(query) What's relevant now?
reflect(fn) Consolidate. Decay. Evolve.
identity() Who am I now?
forget(threshold) Explicit pruning.
scoped(source) Filtered view per user. Same DB.
traces() Query operation traces.

v0.2 Features

Per-user filtering

Each user gets their own "mind" — same database, different context.

# Option 1: default source
mind = Mind("agent.db", default_source="carlos")
mind.experience("Likes Python")  # automatically tagged to carlos
mind.recall("Python")            # only carlos's memories

# Option 2: scoped view
alice = mind.scoped("alice")
alice.experience("Prefers Rust")
alice.recall()  # only alice's memories

Observability

Full tracing of every operation. Zero overhead when disabled (default).

mind = Mind("agent.db", enable_traces=True)

mind.experience("Something happened")
mind.recall("what happened")

# Query traces
traces = mind.traces(operation="recall")
for t in traces:
    print(f"{t.operation} took {t.duration_ms:.1f}ms")

# Filter by source
traces = mind.traces(source="carlos", limit=50)

Smart Cache (storage layer)

Hash-based cache with TTL, per-user isolation, and hit counting. Used by kore-bridge for token savings.

from kore_mind.models import CacheEntry

entry = CacheEntry(
    query="What is P vs NP?",
    response="It's an open problem...",
    query_hash="a1b2c3d4",
    source="carlos",
    ttl=3600.0,
)
mind._storage.save_cache_entry(entry)
found = mind._storage.find_cache_by_hash("a1b2c3d4", source="carlos")

Rate Limiting (storage layer)

Query logging with temporal window counting. Used by kore-bridge for cognitive rate limiting.

Models

Model Description
Memory A memory with lifecycle (salience, decay, tags, embedding)
Identity Emergent identity (traits, summary, relationships)
MemoryType episodic, semantic, procedural
Trace Operation trace (operation, duration, source, metadata)
CacheEntry Cache entry (query, response, hash, TTL, hit count)

Backward compatibility

All new parameters have defaults that preserve v0.1 behavior:

# This works exactly the same as v0.1
mind = Mind("agent.db")
mind.experience("fact")
mind.recall("query")

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

kore_mind-0.2.1.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

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

kore_mind-0.2.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file kore_mind-0.2.1.tar.gz.

File metadata

  • Download URL: kore_mind-0.2.1.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kore_mind-0.2.1.tar.gz
Algorithm Hash digest
SHA256 afd2e42d6b688dbf9f377f713d90a069f86db26c3fbf69082d4088936add9870
MD5 61571210051ef80d172c6df29a6a9ddf
BLAKE2b-256 6fe340fa295be24b61043476b10fee54e427802ca0e951e684cd0d96d54dd946

See more details on using hashes here.

File details

Details for the file kore_mind-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: kore_mind-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kore_mind-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 585b2f79770d68f64d3cc83e12c43b89deb3249c9d0d00c7ed5bd783fd284cf9
MD5 35e9dde30bcdca27db2810863472edfe
BLAKE2b-256 c60af577569cf962dc875357952a7edee56269e96f25eedf74125dd6caf652c4

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