Quick Start Guide
Deployment Options: This guide uses Papr Cloud (managed service). For self-hosted deployment, see the Self-Hosted Guide.
Turn your data into intelligence in 5 minutes. Store and search with graph-aware embeddings, extract entities with knowledge graphs, and compress conversations automatically.
What is Papr? Papr transforms unstructured data—documents, conversations, and memory—into intelligence through four products that work standalone or together:
- Graph-Aware Vector Search - Domain-tuned search (code, science, custom domains)
- Knowledge Graphs - Entity relationships and pattern detection
- Document Intelligence - Extract structure from PDFs and docs
- Chat Memory & Compression - Conversation storage with automatic compression
Start with simple APIs, add intelligence as you need it. Ranked #1 on Stanford's STaRK benchmark with 91%+ accuracy and <150ms retrieval (when cached).
Already have embeddings? Use our plugin approach to transform OpenAI/Cohere embeddings with /v1/holographic endpoints. No migration needed.
First Success in 60 Seconds
Store and search with graph-aware capabilities enabled. This example uses external_user_id and does not require pre-creating a user.
export PAPR_MEMORY_API_KEY='your_api_key_here'
# Store with graph-aware embeddings
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": "User prefers weekly email summaries and dark mode UI.",
"external_user_id": "user_123",
"memory_policy": {"mode": "auto"},
"enable_holographic": true,
"frequency_schema_id": "general"
}'
# Search with entity awareness and domain filtering
curl -X POST "https://memory.papr.ai/v1/memory/search?max_memories=5&max_nodes=5" \
-H "X-API-Key: $PAPR_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-Type: curl" \
-d '{
"query": "What are the user'\''s communication and UI preferences?",
"external_user_id": "user_123",
"enable_agentic_graph": true,
"holographic_config": {
"enabled": true,
"frequency_schema_id": "general"
}
}'Choose Your Path
Pick the product that matches your use case:
Graph-Aware Vector Search
- Code Search - Find code by intent with language/API filtering
- Transform Existing Embeddings - Plugin for OpenAI/Cohere embeddings
Knowledge Graphs
- Structured Data Memory - Convert records into graph nodes and relationships
- Entity Extraction - Auto-extract entities from memories
Document Intelligence
- Document Memory - Extract and search PDFs, Word docs, images
Chat Memory & Compression
- Chat Memory - Session storage with automatic compression
- Add Memory to Existing Agent - Retrofit into any agent loop
General Memory
- Agent Memory - Persist agent learnings and policies at runtime
What You'll Learn
By the end of this guide, you'll know how to:
- Store and search with semantic + graph-aware embeddings
- Enable domain-tuned retrieval (code, science, custom schemas)
- Extract entities and relationships into knowledge graphs
- Compress conversations automatically
- Query insights with natural language or GraphQL
Get your API Key
Create a free account then get your API Key from settings.
Installation
# No installation needed for curl
# Just make sure curl is installed on your systemAuthentication
Add PAPR_MEMORY_API_KEY to your .env file, then use it to authenticate:
# Set your API key as an environment variable
export PAPR_MEMORY_API_KEY='your_api_key_here'Creating Users
Before adding memories, create users to associate with your memories. This enables:
- User-specific memory storage and retrieval
- Access control for memories
- Organizing memories by user
- Sharing of memories between users
Note: While creating users explicitly is recommended for better performance and control, you can also use
external_user_iddirectly in memory operations without creating users first. Papr will automatically create users for you behind the scenes.
# Create a user
curl -X POST https://memory.papr.ai/v1/user \
-H "X-API-Key: $PAPR_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-Type: curl" \
-d '{
"external_id": "user123", # Your application's user identifier
"email": "user@example.com", # Optional
"metadata": {
"name": "John Doe", # Optional
"role": "developer" # Optional
}
}'User ID Storage Best Practices
You have two options for associating memories with users:
Using external_user_id (Recommended for most cases)
- Use your application's existing user IDs
- No need to store additional IDs
- Automatic user creation behind the scenes
Using Papr-generated user_id (For advanced use cases)
- Pre-create users for better performance
- More control over user metadata and settings
- Requires storing the Papr user ID
# Example: Storing user ID in your database
def save_papr_user_id(app_user_id, papr_user_id):
# Your database code here
db.users.update_one(
{"id": app_user_id}, # Your application's internal user ID
{"$set": {"papr_user_id": papr_user_id}} # The Papr-generated ID (e.g., "usr_abc123")
)
# Example: Retrieving user ID from your database
def get_papr_user_id(app_user_id):
user = db.users.find_one({"id": app_user_id})
return user.get("papr_user_id") # Returns the Papr-generated IDPerformance Optimization with Batch User Creation
For applications with many users, pre-creating users in bulk can improve performance:
# Pre-create users in bulk
bulk_users = client.user.create_batch(
users=[
{"external_id": "user123", "email": "user123@example.com"},
{"external_id": "user456", "email": "user456@example.com"},
{"external_id": "user789", "email": "user789@example.com"}
]
)Adding Memories
Add a new memory to your knowledge base, using either your external user ID or the Papr-generated user ID:
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": "Meeting notes from the product planning session",
"type": "text",
"external_user_id": "user123", // Your application's user identifier
"metadata": {
"createdAt": "2024-03-21T10:00:00Z",
"topics": ["meeting", "planning", "product"],
"customMetadata": {
"priority": "high",
"department": "product",
"meeting_type": "planning"
}
}
}'Searching Memories
Search through memories using natural language and either your external user ID or the Papr-generated user ID:
curl -X POST https://memory.papr.ai/v1/memory/search \
-H "X-API-Key: $PAPR_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept-Encoding: gzip" \
-H "X-Client-Type: curl" \
-d '{
"query": "What are the key points from our recent product planning?",
"external_user_id": "user123", // Your application's user identifier
"enable_agentic_graph": true, // Enable intelligent entity-aware search
"max_memories": 20,
"max_nodes": 15,
"metadata": {
"topics": ["planning", "product"],
"customMetadata": {
"priority": "high",
"department": "product"
}
}
}'User-Specific vs. Global Search
You can choose whether to search memories for a specific user or across all accessible memories:
# Search only for a specific user's memories (using external_user_id)
user_specific_results = client.memory.search(
query="product planning",
external_user_id="user123", # Your application's user identifier
enable_agentic_graph=True # Enable intelligent entity-aware search
)
# Search across all accessible memories
global_results = client.memory.search(
query="product planning",
enable_agentic_graph=True # Enable intelligent entity-aware search
# No user filter means search all accessible memories
)Getting a Specific Memory
Retrieve a specific memory by its ID to verify it was added correctly:
curl -X GET https://memory.papr.ai/v1/memory/mem_abc123 \
-H "X-API-Key: $PAPR_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Client-Type: curl"Providing Search Feedback
After retrieving search results, you can provide feedback to improve future search quality:
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_def456",
"feedbackData": {
"feedbackType": "thumbs_up",
"feedbackSource": "inline",
"feedbackText": "These results were helpful!"
}
}'Advanced Topics (Recommended Next)
Explore deeper implementations for each product:
Graph-Aware Vector Search
- Graph-Aware Embeddings Guide - Built-in schemas and custom domains
- Search Tuning - Optimize retrieval for your domain
Knowledge Graphs
- Structured Data Memory - Convert data into graph nodes
- Custom Schemas - Define domain-specific entity types
- GraphQL Analysis - Query relationships and patterns
Document Intelligence
- Document Memory - PDF/Word/image extraction
- Document Processing Guide - Advanced extraction techniques
Chat Memory & Compression
- Chat Memory - Session storage and compression
- Messages Management - Full conversation API
General
- Agent Memory - Persist runtime learnings
Next Steps
- Explore Products - See all 4 products and integration options
- Pick Your Integration Path - Choose the right product for your use case
- Run End-to-End Tutorials - Document Q&A, code search, fraud detection
- Production Best Practices - Harden your implementation
- API Reference - Complete REST API documentation