Memory for AI that behaves more like memory.

CogKura is a research-grounded cognitive memory layer for LLM applications and agents.

It combines activation, associations, forgetting, working memory, updating, learning, and metamemory in a deterministic Python package.

shell
pip install cogkura

Memory

  • Recent project decision

    PostgreSQL

    high activation
  • Related architecture

    Cloud SQL

    associated
  • Earlier decision

    MongoDB

    superseded
  • Unrelated discussion

    Redis

    low activation

Memory is more than similarity.

Similarity can identify information related to a query, but memory also has to decide what is active, what has faded, what has been superseded, what is associated, what should fit into working context, and when there is not enough evidence to answer.

  • Similar

    Relevant now

  • Retrieved

    Still true

  • Stored

    Worth remembering

  • Related

    Fits working context

  • Missing evidence

    Guess

A memory layer, not another AI framework.

CogKura is a Python memory library. Keep the model, agent framework, and database you already have.

Your application calls remember and recall. CogKura decides what is active, superseded, associated, or not yet supported by evidence. The model you already use still does the reasoning.

Your application

orchestration

remember / recall

CogKura

cognitive memory

prompt

Your LLM

reasoning

Your application database stays yours. CogKura stores observations and the memories derived from them, not customer records.

  • You keep

    the model, agent framework, and database you already use.

  • You add

    a Python package that your app calls for remember and recall.

  • CogKura does not

    run the agent loop, replace persistence, or require a hosted memory service.

Cognitive mechanisms

These mechanisms work together as a memory system, not as unrelated product features.

  • Declarative activation

    Research basis: ACT-R

    Memories compete based on activation rather than only textual similarity.

  • Spreading activation

    Research basis: Collins & Loftus

    Related memories can become relevant through associations.

  • Forgetting

    Research basis: Ebbinghaus-inspired decay

    Memory strength changes with time and experience rather than remaining permanently equal.

  • Working memory

    Research basis: Baddeley-inspired bounded working memory

    Relevant memories compete for limited prompt and context capacity.

  • Reconsolidation

    Research basis: Reconsolidation research

    Knowledge can be revised when later observations update or contradict earlier memories.

  • Learning and reinforcement

    Research basis: Outcome-driven learning

    Useful outcomes can strengthen memories and relationships while negative feedback can weaken them.

  • Metamemory

    Research basis: Metamemory research

    The system can assess whether available evidence is sufficient rather than always forcing a result.

Mechanism flow

  1. remember
  2. activate
  3. associate
  4. decay
  5. select
  6. update
  7. reinforce
  8. assess confidence

Memory changes as knowledge changes.

Earlier observation

“We plan to use MongoDB for project storage.”

Later observation

“We've decided to use PostgreSQL instead.”

Question

“What database did we decide to use?”

Simple similarity retrieval

  • MongoDB
  • PostgreSQL

Both statements are highly related to the query.

CogKura

  • PostgreSQLCurrent decision
  • MongoDBsuperseded

A simple similarity retrieval can surface both statements. CogKura's memory mechanisms can represent that the earlier decision has been superseded.

Memory behaviour should be measurable.

CogKuraBench provides a separate, reproducible evaluation suite for testing whether CogKura's memory mechanisms produce the intended behaviour.

  • Direct recall
  • Associative recall
  • Episodic recall
  • Temporal recall
  • Knowledge update
  • Stale-memory suppression
  • Metamemory abstention
  • Working-memory selection
  • Learning

Results are reported per capability. There is no combined benchmark score.

Repository: https://github.com/cogkura/cogkura-bench

Built from cognitive memory research.

CogKura turns established ideas from cognitive science into deterministic software mechanisms that can be evaluated and composed.

CogKura does not implement an entire cognitive architecture.

Add cognitive memory to your application.

shell
pip install cogkura
python
import asyncio
from datetime import UTC, datetime

from cogkura import Memory, ObservationInput


async def main() -> None:
    memory = Memory()
    tenant_id = "local"

    await memory.observe(
        ObservationInput(
            tenant_id=tenant_id,
            subject_id="george",
            source_namespace="direct",
            source_record_id="1",
            content="George discussed cognitive memory algorithms",
            observed_at=datetime.now(UTC),
            metadata={"conversation_id": "research", "source": "conversation"},
        )
    )

    await memory.encode_episodes(tenant_id=tenant_id)

    results = await memory.recall(
        "What was discussed about cognitive memory?",
        tenant_id=tenant_id,
    )

    for result in results:
        print(result.score, result.memory.statement, result.reason)


asyncio.run(main())