Last updated

Golden Paths

Golden paths are the four canonical integration routes for Papr. Start with one path, ship value quickly, then expand.

Quick Context: Why These Paths Work

Most teams building AI memory start with simple storage (SQLite, keyword search). These paths give you that simplicity — but without the production failures (vocabulary mismatch, memory drift, context explosion).

Each path below shows:

  1. What you'd build with a DIY approach
  2. What breaks in production
  3. How Papr solves it with the same simple API

See detailed comparison →

1) Chat Memory Path

Best for assistants, copilots, and support chat.

What You'd Build (DIY)

# Store in SQLite
db.execute("INSERT INTO messages (content, user_id, session_id) VALUES (?, ?, ?)")

# Retrieve with keyword search
messages = db.execute("SELECT * FROM messages WHERE session_id = ? AND content MATCH ?")

Works for: Basic recall of exact phrases
Breaks on: Vocabulary mismatch ("refund policy" vs "return process"), cross-session context, memory consolidation

Papr Approach (Same Simplicity, Production-Ready)

# Store with automatic analysis
client.messages.store(
    content=message,
    role="user",
    session_id=session_id,
    process_messages=True  # Auto-extracts: refund → subscription → cancellation
)

# Retrieve with hybrid search (keyword + semantic + graph)
results = client.memory.search(
    query="What did they say about returns?",  # Matches "refund policy"
    enable_agentic_graph=True  # Follows relationships automatically
)

Minimal Flow

  1. POST /v1/messages with sessionId and process_messages=true
  2. GET /v1/messages/sessions/{session_id} for history
  3. GET /v1/messages/sessions/{session_id}/compress for context_for_llm
  4. POST /v1/memory/search with enable_agentic_graph=true

2) Document Memory Path

Best for document Q&A, policy lookup, and internal knowledge.

Minimal Flow

  1. POST /v1/document
  2. GET /v1/document/status/{upload_id} until complete
  3. POST /v1/memory/search with agentic graph enabled
  4. Optional: POST /v1/graphql for analytics

3) Structured Data Memory Path

Best for CRM, product catalogs, tickets, finance, and operational data.

Minimal Flow

  1. Model entities and relationships (mode: "manual")
  2. POST /v1/memory or /v1/memory/batch with memory_policy.nodes and memory_policy.relationships
  3. POST /v1/memory/search and/or POST /v1/graphql
  4. Apply schema with schema_id for consistency

4) Agent Memory Path

Best for agents that need long-term operational memory and self-improvement loops.

Minimal Flow

  1. Store reasoning outcomes and workflows via POST /v1/memory
  2. Tag with metadata.role="assistant" and category labels
  3. Retrieve with POST /v1/memory/search before decisions
  4. Feed quality signal through feedback endpoints

Path Selection Heuristic

Use this quick rule:

  • Starting from chat logs -> Chat Memory Path
  • Starting from files and docs -> Document Memory Path
  • Starting from rows/events/APIs -> Structured Data Memory Path
  • Starting from autonomous agent actions -> Agent Memory Path

If you have multiple sources, start with one path, then converge into a unified graph model.