Agent Cookbook
This guide is optimized for AI coding agents and developers who want deterministic integration steps.
Prerequisites
- Papr API key in your runtime environment
- A stable
external_user_idfrom your application identity layer - Access to the API endpoints used in your chosen path
Minimal Setup
- Choose one integration path from Rule 1.
- Implement write and search calls with current fields only.
- Validate with the baseline search settings before tuning.
Rule 1: Pick One Path
- If input is chat transcripts -> use Messages path.
- If input is files/docs -> use Document path.
- If input is rows/events/APIs -> use Structured Data path.
- If input is agent outcomes/workflows -> use Agent Memory path.
Do not mix all paths at the start. Implement one, verify, then expand.
Rule 2: Use Current Fields
Use:
memory_policyexternal_user_idenable_agentic_graph
Avoid deprecated fields:
graph_generationuser_idrank_results
Deterministic Recipes
Recipe A: Chat Agent with Long-Term Memory
- Store message (
POST /v1/messages) - Fetch compressed context (
GET /messages/sessions/{session_id}/compress) - Search memory (
POST /v1/memory/searchwithenable_agentic_graph=true) - Generate model response
Recipe B: Structured CRM Agent
- Ingest entities in manual mode (
POST /v1/memorywithmemory_policy.mode=manual) - Query related context (
POST /v1/memory/search) - Run analytics (
POST /v1/graphql)
Recipe C: Document Support Agent
- Upload documents (
POST /v1/document) - Poll status (
GET /v1/document/status/{upload_id}) - Search with graph-aware retrieval (
POST /v1/memory/search)
Recommended Search Baseline
{
"enable_agentic_graph": true,
"max_memories": 20,
"max_nodes": 15
}Use response_format=toon when passing search output directly to an LLM.
Validation Checklist
- Requests use
external_user_idandmemory_policy - Retrieval uses
enable_agentic_graph=true - One deterministic path is working end to end
Troubleshooting
Use the Error Playbook for common auth, validation, and retrieval issues.