Metadata-Version: 2.4
Name: grafomem
Version: 0.4.0
Summary: GRAFOMEM — agent-memory conformance benchmark and compliance toolkit
Author: Camilo Ayerbe Posada
License: MIT
Project-URL: Homepage, https://grafomem.com
Project-URL: Documentation, https://docs.grafomem.com
Project-URL: Repository, https://github.com/GNS-Foundation/grafomem
Project-URL: Issues, https://github.com/GNS-Foundation/grafomem/issues
Project-URL: API, https://grafomem-production.up.railway.app/docs
Project-URL: Portal, https://grafomem-production.up.railway.app/portal
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jsonschema>=4
Requires-Dist: click>=8
Provides-Extra: backends
Requires-Dist: sentence-transformers>=2.2; extra == "backends"
Requires-Dist: numpy>=1.24; extra == "backends"
Provides-Extra: store
Requires-Dist: sqlite-vec; extra == "store"
Requires-Dist: apsw; extra == "store"
Provides-Extra: crypto
Requires-Dist: cryptography>=41; extra == "crypto"
Provides-Extra: runtime
Requires-Dist: numpy>=1.24; extra == "runtime"
Requires-Dist: cryptography>=41; extra == "runtime"
Requires-Dist: structlog>=23.1.0; extra == "runtime"
Requires-Dist: mcp>=0.1.0; extra == "runtime"
Provides-Extra: postgres
Requires-Dist: psycopg[binary]>=3.1; extra == "postgres"
Requires-Dist: psycopg_pool>=3.2; extra == "postgres"
Requires-Dist: pgvector>=0.3; extra == "postgres"
Requires-Dist: numpy>=1.24; extra == "postgres"
Requires-Dist: tiktoken>=0.7.0; extra == "postgres"
Provides-Extra: server
Requires-Dist: fastapi>=0.110; extra == "server"
Requires-Dist: uvicorn[standard]>=0.29; extra == "server"
Requires-Dist: mcp>=1.0; extra == "server"
Requires-Dist: pydantic>=2.0; extra == "server"
Requires-Dist: sse-starlette>=2.0; extra == "server"
Requires-Dist: fpdf2>=2.8; extra == "server"
Provides-Extra: cloud
Requires-Dist: grafomem[crypto,postgres,server]; extra == "cloud"
Requires-Dist: stripe>=8.0; extra == "cloud"
Requires-Dist: bcrypt>=4.0; extra == "cloud"
Requires-Dist: PyJWT>=2.8; extra == "cloud"
Requires-Dist: authlib>=1.3; extra == "cloud"
Requires-Dist: prometheus-client>=0.20; extra == "cloud"
Requires-Dist: apscheduler>=3.10; extra == "cloud"
Requires-Dist: pandas>=2.0; extra == "cloud"
Requires-Dist: minisom>=2.3; extra == "cloud"
Requires-Dist: scikit-learn>=1.3; extra == "cloud"
Requires-Dist: psycopg2-binary>=2.9; extra == "cloud"
Provides-Extra: all
Requires-Dist: grafomem[backends,cloud,crypto,llm,postgres,server,store]; extra == "all"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.30; extra == "anthropic"
Provides-Extra: gemini
Requires-Dist: google-genai>=1.0; extra == "gemini"
Provides-Extra: llm
Requires-Dist: openai>=1.0; extra == "llm"
Requires-Dist: anthropic>=0.30; extra == "llm"
Requires-Dist: google-genai>=1.0; extra == "llm"
Provides-Extra: crewai
Requires-Dist: crewai<2.0,>=0.60; extra == "crewai"
Provides-Extra: autogen
Requires-Dist: autogen-agentchat>=0.4; extra == "autogen"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: PyNaCl>=1.5; extra == "dev"
Dynamic: license-file

# GRAFOMEM

[![GMP Certified](https://img.shields.io/badge/GMP-Certified-00c853?style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBvbHlnb24gcG9pbnRzPSIxMiwyIDIxLDcgMjEsMTcgMTIsMjIgMywxNyAzLDciIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwOTljYyIgc3Ryb2tlLXdpZHRoPSIyIi8+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMyIgZmlsbD0iIzAwYzg1MyIvPjwvc3ZnPg==)](https://grafomem.com/registry.html)
[![GMP v0.2.0](https://img.shields.io/badge/GMP-v0.2.0-0099cc?style=flat-square)](https://grafomem.com/spec.html)
[![M8 1.000](https://img.shields.io/badge/M8-1.000-00c853?style=flat-square)](https://grafomem.com/registry.html)

**The governed memory runtime for agents.**

Give your AI agents memory they can **move, merge, and prove they erased** — a fast in-model working
state plus a durable fact store, signed and auditable at the substrate.

> **Fair Source — source-available.** The GRAFOMEM runtime core is licensed **FSL-1.1-Apache-2.0**
> (self-host, use, and modify freely; only a competing managed service is restricted; converts to
> Apache-2.0 after 2 years). The spec, `.gfm` format, conformance suite, and adapters are **Apache-2.0**.
> Please do not describe the runtime core as "open source" — it is Fair Source. (See `LICENSE` files.)

## What it is

A two-tier memory system with governance built in:

- **Working memory (CSO)** — a fast, fixed-size in-model state `M`, read `y = Mq`: bounded, portable,
  mergeable, constant-size. Adaptive state as a movable, forkable, erasable object.
- **Durable facts (GMP)** — a lossless, queryable, model-agnostic fact store.
- **Governance primitives** — signed transition receipts on the working tier, cryptographic erasure
  certificates on the durable tier.

## Quickstart (5 minutes) — governed checkpoints for LangGraph

```bash
pip install grafomem langgraph-checkpoint-grafomem
```

```python
from langgraph.checkpoint.memory import MemorySaver
from grafomem_checkpoint import GrafomemSerializer, GrafomemCheckpointSaver

saver = GrafomemCheckpointSaver(MemorySaver(serde=GrafomemSerializer(private_key, key_id, trust, consent)))
graph = builder.compile(checkpointer=saver)

# ... run your agent ...
saver.delete_thread("thread-123")          # right-to-erasure
receipt = saver.last_receipt("thread-123") # signed, verifiable proof the erasure transition occurred
```

Every checkpoint is signed and tamper-evident; `delete_thread` yields a **signed state-transition
receipt** — a cryptographic, verifiable proof that the erasure *operation* occurred (not a claim of
media sanitization).

---

## The Protocol (GMP)

GRAFOMEM began as a benchmark for one question — *what should a standard for agent
memory actually specify?* — and turned into the answer: a benchmark, a protocol
(**GMP**), an executable conformance suite, and a certified, persistent reference
implementation. 

> Memory capabilities are **orthogonal**, a **declared** capability is not the same as
> **observed** behavior, and the only way to tell them apart is to **test** — so agent
> memory should be specified and conformance-checked like any other protocol.

The benchmark demonstrates three key results:
1. **Four orthogonal axes.** Representational capability (versioning / supersession), embedding quality, retention policy, and a two-sided privacy primitive (deletion **and** tenant isolation) must be specified and verifiable separately.
2. **Claims ≠ behavior.** A backend can declare `HARD_DELETE` or `MULTI_TENANT` and still leak forbidden data. 
3. **Protocol + conformance.** "Supports capability X" is defined operationally: *passes the conformance suite for X.*

## Repository layout

```
src/grafomem/   working memory runtime (CSO · sdk · mcp · server)   [FSL-1.1-Apache-2.0]
src/aml/        durable facts runtime (GMP · backends)               [MIT]
spec/           .gfm format + SPEC                                   [Apache-2.0]
tests/runtime/  test suite for the working memory tier               [Apache-2.0]
tests/          test suite for the durable tier & GMP benchmark      [Apache-2.0]
adapters/       framework adapters (langgraph-checkpoint-grafomem)   [Apache-2.0]
verifier-ts/    zero-dependency TypeScript .gfm verifier             [Apache-2.0]
examples/       runnable demos                                       [Apache-2.0]
```

## Develop

```bash
# Editable install for the entire unified runtime
pip install -e ".[runtime]"
bash ci.sh          # pytest · conformance · TS verifier · Fair-Source lint
```

## Cloud

Self-host everything above for free, forever. **GRAFOMEM Cloud** adds the hosted, multi-tenant,
governed, attested platform — [talk to us](https://grafomem.com). You point your registry at the cloud;
it's a config change, not a migration.

---

GRAFOMEM is a project of **Ulissy s.r.l.**
