Skip to main content

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

Patterns and Tips

PatternWhen to Use
One collection per userUser-specific memory/context
One collection per projectProject-scoped documentation
One collection per data typeDifferent content types (docs, chats, notes)