Metadata-Version: 2.4
Name: cordis-memory
Version: 0.2.0
Summary: SQLite cognitive store and relationship graph for Cordis.
Author: Cordis Contributors
License-Expression: MIT
Project-URL: Homepage, https://github.com/ntoniorvn-blip/cordis
Project-URL: Issues, https://github.com/ntoniorvn-blip/cordis/issues
Project-URL: Changelog, https://github.com/ntoniorvn-blip/cordis/blob/main/CHANGELOG.md
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Cordis Memory

`cordis-memory` is the persistent cognitive store for Cordis. It uses Python's
built-in SQLite support: no graph server, vector database, model, or network
dependency is required.

It stores five durable kinds of cognition:

- `event`: a task, plan, tool, test, error, or verification observation;
- `episode`: a completed task experience;
- `knowledge`: an evidence-backed fact with provenance;
- `pattern`: a repeated independently sourced observation with confidence;
- `capability` and `principle`: model/tool performance and stable action rules.

Memory scopes are `conversation`, `workflow`, `project`, and `global`.
Project-scoped cognition is never returned to another project. Global knowledge
is deliberately shared only when a caller requests global scope.

The relationship graph uses nodes and edges in the same SQLite database. The
initial graph records task-to-event and event-to-tool relations; hosts can add
their own project, artifact, model, environment, plan, and evidence nodes.

## Minimal use

```python
from cordis_memory import CognitiveStore

store = CognitiveStore("cordis-cognition.db")
store.record_event({
    "event_type": "tool_failed",
    "project_id": "my-app",
    "task_id": "task-1",
    "tool": "shell",
    "subject": "npm test",
    "actual": "exit code 1",
})

store.remember(
    kind="knowledge",
    subject="package manager",
    content="This project uses pnpm workspace.",
    scope="project",
    project_id="my-app",
    source_id="repo-readme",
)

snapshot = store.query(intent="package workspace", project_id="my-app")
```

Patterns begin as candidates and become active only after at least two
independent `source_id` values support the same statement.
