Verity
A cognitive memory system for AI agents and applications — inspired by how the brain actually stores, recalls, and forgets.
What it does
AI memory systems treat memory as a database: store a string, retrieve a string. Verity treats memory as cognition. It uses a dual-speed store (fast episodic buffer + slow semantic store), runs a sleep consolidation cycle between sessions to decay, prune, and abstract memories, and applies reconsolidation rules that let memories update without drifting. The result is a memory system that behaves more like a mind than a key-value store.
Three things Verity does that no other package does: reconsolidation stability (memories update on access but cannot drift — a four-tier Bayesian system gates every modification), sleep consolidation (an offline decay → prune → abstract cycle that runs between sessions, mirrors the SO-spindle-ripple cascade), and tiered temporal weighting (the system auto-graduates from exponential to Bayesian renewal to Hawkes processes as event history grows, per-memory, without any configuration).
The API is seven methods. Zero configuration. No GPU. No cloud. No API key required. Runs on a Raspberry Pi and in a Kubernetes pod identically. Works with nothing but Python's stdlib, and gets progressively smarter as you add optional packages.
Install
pip install veritycog # stdlib only — text search
pip install "veritycog[cognitive]" # + model2vec + hnswlib (recommended)
pip install "veritycog[connectors]" # + dlt (60+ data sources)
pip install "veritycog[full]" # everything
Quickstart
from verity import Memory
m = Memory() # SQLite, zero config
m.add("I prefer dark mode") # store
m.add("Team standup every day at 9am")
m.add("The API uses JWT authentication")
results = m.search("daily schedule") # retrieve
for r in results:
print(r["content"], f"({r['confidence']:.0%} confidence)")
m.update(results[0]["id"], "standup moved to 10am") # update
m.consolidate() # sleep cycle
m.export() # GDPR portability
m.delete(results[0]["id"]) # GDPR erasure
The cognitive layer
| Component | Neuroscience model | What it does | Maps to |
|---|---|---|---|
| DualSpeedStore | Complementary Learning Systems | Fast episodic buffer + slow semantic store | SQLite + numpy |
| ImportanceScorer | Predictive Processing | Prediction error as surprise signal | Embedding cosine distance |
| ReconsolidationEngine | Memory Reconsolidation | 4-tier stability prevents drift | Bayesian Beta-Bernoulli |
| ConsolidationCycle | Sleep Consolidation | Decay/prune/abstract between sessions | Scheduled background pass |
| TemporalWeighter | Temporal Point Processes | Auto-selects exponential/renewal/Hawkes | Tiered by event density |
| GlobalWorkspace | Global Workspace Theory | K=5 competitive selection + position-aware output | Mitigates lost-in-middle |
Advanced: Engine API
Memory wraps the lower-level Engine API, which provides the full RELATE/NAVIGATE/GOVERN/REMEMBER loop with connectors, profiles, consent management, and a Merkle-chained audit trail. See examples/01_personal_notes.py for a complete walkthrough.
For AI agents
from verity import Memory
memory = Memory()
def agent_response(user_input: str) -> str:
# Recall relevant context
context = memory.search(user_input, k=5)
context_str = "\n".join(r["content"] for r in context)
# ... call your LLM with context_str ...
# Remember the interaction
memory.add(f"User asked: {user_input}")
return response
License
Apache-2.0
Release files for veritycog 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| veritycog-0.1.1.tar.gz | 174.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| veritycog-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 274.9 kB
Release files / veritycog-0.1.1.tar.gz
| Download URL | veritycog-0.1.1.tar.gz |
|---|---|
| Size | 174.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8025ab1e5721dd33343667414a29b5a2442e3d0d7e6a1ac9c3aecd39c60f4759
|
|
BLAKE2b-256 checksum How to use checksums |
77f2073eb9947c6cc66568a342e79865f7dc664c8b1717337940a3d13f1cd30e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 15, 2026.
Transparency logRelease files / veritycog-0.1.1-py3-none-any.whl
| Download URL | veritycog-0.1.1-py3-none-any.whl |
|---|---|
| Size | 100.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d24ed231c0d05faef16b18aa69fb11dc88d3579a9e05174292c42d9d6f3653ec
|
|
BLAKE2b-256 checksum How to use checksums |
b94f334f22b25358bb4658b384f96c64c4454966a927eb2246643e738e36d9c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 15, 2026.
Transparency log