Last updated

Changelog

All notable changes to Papr Memory API will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

  • Future enhancements and features will be listed here

[2.0.0] - 2026-02-11

Added

Messages API

  • NEW: /v1/messages endpoint - Store chat messages with automatic memory creation
    • POST /v1/messages - Store user and assistant messages
    • GET /v1/messages/sessions/{session_id} - Retrieve conversation history
    • GET /v1/messages/sessions/{session_id}/compress - Get compressed conversation context
    • GET /v1/messages/sessions/{session_id}/status - Check session metadata
    • POST /v1/messages/sessions/{session_id}/process - Batch process messages into memories
  • Session Management - Built-in grouping and compression of chat conversations
  • Automatic Compression - Hierarchical summaries generated every 15 messages
  • Role-Based Memory Creation - User messages and assistant learnings automatically categorized

Memory Policy (Replaces graph_generation)

  • memory_policy field - Unified field for controlling knowledge graph generation, ACL, consent, and risk
  • Node Constraints - More powerful entity matching and property control
    • Control when entities are created vs linked (create: "auto" | "never" | "always")
    • Define search strategies (exact vs semantic matching)
    • Force specific property values on matched entities
  • Edge Constraints - Control relationship creation between entities
  • link_to DSL - Shorthand syntax for defining node/edge constraints
  • Schema-Level Policies - Define default memory_policy in schema definitions
  • Document-Level Policies - Apply memory_policy during document uploads
  • ACL Support - Access control lists for read/write permissions (OMO standard)
  • Consent Tracking - Track consent level: explicit, implicit, terms, none (OMO standard)
  • Risk Classification - Classify data as none, sensitive, or flagged (OMO standard)

Changed

Breaking Changes

  • graph_generationmemory_policy (backward compatible, but deprecated)
    • Old graph_generation.auto.schema_id → New memory_policy.schema_id
    • Old graph_generation.auto.property_overrides → New memory_policy.node_constraints
    • Old graph_generation.auto.simple_schema_mode → Removed (use schema_id directly)
    • Nodes: label field renamed to type
    • Relationships: Simplified field names (source_node_idsource, etc.)

Document Processing

  • POST /v1/document now accepts memory_policy parameter
  • Document uploads can inherit schema-level memory_policy settings
  • Removed simple_schema_mode parameter (use memory_policy.schema_id instead)

Schema Definitions

  • UserGraphSchema-Input now supports memory_policy field for schema-level defaults
  • Schemas can enforce default node/edge constraints for all memories using that schema

Deprecated

  • graph_generation field - Still works but use memory_policy instead
    • All graph_generation functionality is now in memory_policy
    • Will be removed in a future version
  • simple_schema_mode parameter - Use schema_id within memory_policy instead
  • property_overrides - Use node_constraints with more granular control

Migration Guide

Migrating from graph_generation to memory_policy

Before (deprecated):

client.memory.add(
    content="Meeting with Jane",
    graph_generation={
        "mode": "auto",
        "auto": {
            "schema_id": "crm_schema",
            "simple_schema_mode": True,
            "property_overrides": [
                {
                    "nodeLabel": "Contact",
                    "match": {"name": "Jane"},
                    "set": {"id": "contact_jane", "role": "manager"}
                }
            ]
        }
    }
)

After (recommended):

client.memory.add(
    content="Meeting with Jane",
    memory_policy={
        "mode": "auto",
        "schema_id": "crm_schema",
        "node_constraints": [
            {
                "node_type": "Contact",
                "search": {
                    "properties": [{"name": "name", "mode": "semantic"}]
                },
                "set": {
                    "role": {"mode": "exact", "value": "manager"}
                }
            }
        ]
    }
)

Manual Mode Changes:

# Before
memory_policy={
    "mode": "manual",
    "manual": {
        "nodes": [
            {"id": "n1", "label": "Contract", "properties": {...}}
        ],
        "relationships": [
            {"source_node_id": "n1", "target_node_id": "n2", "relationship_type": "REFERS_TO"}
        ]
    }
}

# After
memory_policy={
    "mode": "manual",
    "nodes": [
        {"id": "n1", "type": "Contract", "properties": {...}}
    ],
    "relationships": [
        {"source": "n1", "target": "n2", "type": "REFERS_TO"}
    ]
}

Migrating to Messages API

If you're building chat applications, switch from direct memory storage to the Messages API:

Before:

# Storing chat messages as direct memories
client.memory.add(
    content="User message",
    metadata={"role": "user", "conversation_id": "conv_123"}
)

After (recommended for chat):

# Using Messages API
client.messages.store(
    content="User message",
    role="user",
    session_id="session_123",
    external_user_id="user_456",
    process_messages=True  # Automatically create memories
)

# Get conversation history
history = client.messages.get_history(session_id="session_123", limit=50)

# Compress long conversations
compressed = client.messages.compress_session(session_id="session_123")
context = compressed.context_for_llm  # Use in LLM prompts

Schema-Level Policies

Before:

# Schema without policies
schema = client.schemas.create(
    name="E-commerce Schema",
    node_types={...}
)

# Apply policies per memory
client.memory.add(
    content="...",
    graph_generation={"mode": "auto", "auto": {"schema_id": schema.id}}
)

After (DRY approach):

# Schema with default policy
schema = client.schemas.create(
    name="E-commerce Schema",
    node_types={...},
    memory_policy={
        "mode": "auto",
        "node_constraints": [
            {
                "node_type": "Product",
                "create": "never",  # Never create products via chat
                "search": {"properties": [{"name": "sku", "mode": "exact"}]}
            }
        ]
    }
)

# Inherits schema's policy automatically
client.memory.add(
    content="...",
    memory_policy={"schema_id": schema.id}
)

Impact Summary

AreaBreaking?Action Required
Messages APINoOptional: Adopt for new chat applications
memory_policyNo*Optional: Migrate from graph_generation
Node ConstraintsNoOptional: Upgrade from property_overrides
Schema PoliciesNoOptional: Define policies at schema level
Document ProcessingNoOptional: Use memory_policy parameter
Manual Mode StructureNoOptional: Update field names (labeltype)

* graph_generation is deprecated but still works. Plan to migrate before future removal.

Backward Compatibility

All changes are backward compatible:

  • graph_generation field still works (deprecated)
  • Existing schemas and memories work unchanged
  • Old property_overrides format still accepted
  • No immediate action required for existing implementations

However, we recommend migrating to the new syntax for:

  • Access to new features (ACL, consent, risk)
  • More powerful node/edge constraints
  • Better schema-level policy inheritance
  • Future-proofing your code

Resources

Support

If you encounter issues during migration:

  1. Check the Migration Guide above
  2. Review updated documentation
  3. Contact support with specific questions

Version History Summary

v2.0.0 (2026-02-11) - Major release with Messages API and memory_policy architecture

  • New Messages API for chat applications
  • memory_policy field replacing graph_generation
  • Schema-level policies
  • Message compression and summarization
  • ACL, consent, and risk tracking (OMO standard)

Previous Versions

For detailed information about earlier versions, see our GitHub releases.