Documentation Index
Fetch the complete documentation index at: https://docs.trynebula.ai/llms.txt
Use this file to discover all available pages before exploring further.
A collection is a named container that groups related memories together. You create collections, assign memories to them, and scope searches to them.
Why Use Collections?
- Separate contexts: Keep work, personal, and project memories distinct
- Targeted search: Search only within relevant collections
- Access control: Different API keys can have different collection permissions
- Multi-tenancy: Isolate data for different users or customers
Creating Collections
Collection names are case-insensitive. “Work” and “work” are treated as duplicates.
from nebula import Nebula
nebula = Nebula()
collection = nebula.collections.create(
name="Research Papers",
description="Academic research documents",
).results
Storing Memories in Collections
Always specify collection_id when storing memories:
nebula.memories.create(
collection_id=collection.id,
raw_text="Q4 planning meeting notes",
metadata={"type": "meeting"},
)
Searching Within Collections
# Search specific collection
results = nebula.memories.search(query="deadlines", collection_ids=["Work"]).results
# Search multiple collections
results = nebula.memories.search(query="notes", collection_ids=["Work", "Personal"]).results
# Search all accessible collections
results = nebula.memories.search(query="important").results
Search accepts collection names or UUIDs. When storing memories, collection_id must be a UUID.
Managing Collections
collections = nebula.collections.list(limit=50).results
work_collections = nebula.collections.list(name="Work").results
collection = nebula.collections.retrieve(collection_id).results
nebula.collections.update(
collection.id,
name="Updated Name",
description="New description",
)
nebula.collections.delete(collection_id)
Deleting a collection removes its graph data and vector sources. The underlying memory records are disassociated from the collection, not deleted.
Patterns and Tips
| Pattern | When to Use |
|---|
| One collection per user | User-specific memory/context |
| One collection per project | Project-scoped documentation |
| One collection per data type | Different content types (docs, chats, notes) |