Quickstart: Agent Memory
Store and retrieve agent learnings so behavior improves over time.
What You Will Build
- Persist assistant-generated memory
- Retrieve prior learnings before new actions
- Keep safety and access controls explicit
Prerequisites
PAPR_MEMORY_API_KEYconfigured in your environment- A stable agent runtime identity for
external_user_id
Minimal Setup
- Write one assistant learning entry.
- Search for that learning before the next action.
- Submit feedback to reinforce retrieval quality.
1) Store Agent Learning
curl -X POST https://memory.papr.ai/v1/memory \
-H "X-API-Key: $PAPR_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-Type: curl" \
-d '{
"content": "When refund request is older than 30 days, escalate to manager with purchase metadata attached.",
"external_user_id": "agent_runtime_001",
"metadata": {
"role": "assistant",
"category": "learning",
"topics": ["refunds", "escalation"]
},
"memory_policy": {
"mode": "auto",
"consent": "terms",
"risk": "none"
}
}'2) Retrieve Learning Before Action
curl -X POST "https://memory.papr.ai/v1/memory/search?response_format=toon&max_memories=20&max_nodes=15" \
-H "X-API-Key: $PAPR_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-Type: curl" \
-d '{
"query": "What refund handling rules has the assistant learned?",
"external_user_id": "agent_runtime_001",
"enable_agentic_graph": true
}'3) Feed Quality Signal
curl -X POST https://memory.papr.ai/v1/feedback \
-H "X-API-Key: $PAPR_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-Type: curl" \
-d '{
"search_id": "search_123",
"feedbackData": {
"feedbackType": "thumbs_up",
"feedbackSource": "inline",
"feedbackText": "Retrieved the correct escalation policy."
}
}'Validation Checklist
- Agent learning is persisted successfully.
- Retrieval query returns prior learned policy.
- Feedback call succeeds with the returned
search_id.
Troubleshooting
If retrieval misses known learnings, confirm external_user_id consistency and check Search Tuning.