RAG scoping enables precise filtering of retrieval results using scope identifiers, allowing multi-tenant isolation and session-specific knowledge retrieval.Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
How It Works
| Scope Type | Purpose | Example Use Case |
|---|---|---|
user_id | Per-user isolation | Personal documents, user-specific data |
agent_id | Per-agent isolation | Different bot types sharing infrastructure |
run_id | Per-session isolation | Conversation-specific temporary context |
Configuration Options
Knowledge Backend Configuration
Learn about different vector store backends and their scoping support
Common Patterns
Multi-Tenant SaaS Application
Department-Specific Knowledge
Session-Based Memory
Best Practices
Choose the Right Scope Level
Choose the Right Scope Level
Single scope for simple use cases:
- Use
user_idfor personal documents - Use
agent_idfor shared knowledge bases - Use
run_idfor temporary session data
- All three scopes provide maximum isolation
- Omit scopes to broaden access as needed
Scope Identifier Naming
Scope Identifier Naming
Use consistent, readable naming patterns:
Backend Compatibility
Backend Compatibility
mem0 backend requires at least one scope identifier.
ChromaDB backend supports all scoping patterns and automatically combines multiple scopes with
$and operator.
Internal backend has limited scoping support.Choose your backend based on scoping requirements.Performance Considerations
Performance Considerations
More specific scopes = faster queries:
- Narrow scopes reduce the search space
- Combined scopes create more selective filters
- Consider indexing strategies for your vector database
Related
Knowledge Backends
Configure different vector store backends with scoping support
Agents
Learn how agents use knowledge and memory systems

