By default, all Ask AI modes (Chat, Deep Research) and basic search query across all collections — no collection_id is needed to search everything. To narrow results to a single collection, pass a collection_id; vector search, keyword search, and graph traversal will then only include data from that collection's documents.
By default, Ask AI searches across all collections. To scope a question to a single collection:
In the UI: Open the Settings panel on the Ask AI page and use the Collection Scope dropdown. It defaults to "All Collections" — select a specific collection to filter. A persistent indicator below the input shows the active scope.
Via API:
Code
# Search all collections (default — omit collection_id)curl -X POST "http://localhost:8000/api/ask" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "question": "What are the common themes across all papers?" }'# Search a specific collectioncurl -X POST "http://localhost:8000/api/ask" \ -H "X-API-Key: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "question": "What are the common themes in these papers?", "collection_id": "coll_abc123" }'
Documents uploaded without a collection_id go to the default collection.
Configure the default collection name:
Code
DEFAULT_COLLECTION=default
Configuration
Code
# Enable collections featureENABLE_COLLECTIONS=true# Default collection for uncategorized documentsDEFAULT_COLLECTION=default
Collection-Scoped API Keys
The most powerful use of collections is pairing them with collection-scoped API keys. A key restricted to specific collections can only see and write to those collections — everything else returns a 403. This enables true multi-tenancy from a single Cortex instance.
New collections are never automatically accessible to existing restricted keys — access must be explicitly granted.
In the UI
Go to Settings → API Key Management → New Key and select Specific Collections to open a multi-select picker. Each restricted key card shows an amber N Collections badge.
Best Practices
Meaningful Names - Use descriptive names for easy identification
Logical Grouping - Group documents by topic, project, or source
Don't Over-Segment - Too many small collections reduce graph connectivity