Last updated

Production Best Practices

This guide covers recommended patterns for running Papr in production workloads.

1) Scope Every Request Explicitly

For multi-tenant products, include:

  • organization_id
  • namespace_id
  • external_user_id

Apply this to both writes and reads.

2) Standardize Policy Defaults

Set default memory_policy conventions:

  • mode: auto for unstructured, manual for structured imports
  • consent: based on your legal model
  • risk: explicit risk tiering
  • acl: deterministic read/write templates

3) Tune Retrieval for Quality

Baseline recommendations:

  • enable_agentic_graph=true
  • max_memories=15-20
  • max_nodes=10-15

Increase limits for deeper multi-hop use cases.

4) Use Messages Compression for Long Sessions

For chat-heavy systems:

  • Store all turns via /v1/messages
  • Use /compress and context_for_llm for prompt budgets

5) Add Feedback Loop

Capture retrieval quality signals through /v1/feedback to improve quality tracking and regression detection.

6) Operational Reliability

  • Add retries with bounded backoff.
  • Log request IDs and memory/search IDs.
  • Protect write paths with idempotency checks in your ingestion layer.

7) Portability and Backup

Use OMO export/import for:

  • migration,
  • archival,
  • interoperability with OMO-compatible systems.