LlamaIndex Retriever Example
Use Papr search results as node inputs for LlamaIndex query pipelines.
Pattern
- Execute Papr search.
- Map results into LlamaIndex text nodes.
- Run response synthesis in your LlamaIndex stack.
Prerequisites
PAPR_MEMORY_API_KEYin your environment- LlamaIndex pipeline where you can inject retrieved nodes
Minimal Setup
- Run
papr_search()with one query and user scope. - Convert response memories into LlamaIndex nodes.
Python Skeleton
from papr_memory import Papr
import os
client = Papr(x_api_key=os.environ.get("PAPR_MEMORY_API_KEY"))
def papr_search(query: str, user_id: str):
return client.memory.search(
query=query,
external_user_id=user_id,
enable_agentic_graph=True,
max_memories=20,
max_nodes=15,
)Validation Checklist
- Search returns memories and optional graph nodes.
- Node conversion step preserves source IDs for traceability.
Troubleshooting
If no relevant nodes are returned, increase max_memories and verify that prior writes exist for the selected user scope.