Core Concepts
Understanding Nebula’s architecture helps you work more effectively with memories, conversations, and documents.Memories: Universal Information Containers
In Nebula, everything is stored as a memory - a container for related information. A memory represents a complete unit:- Conversation Memory: Contains all messages in a conversation
- Document Memory: Contains an entire document (potentially split into chunks)
- Simple Memory: Contains a single piece of information
Memories vs Chunks
- Memory: The container with a unique
memory_id- represents complete conversations or documents - Chunks: Individual pieces within a memory (messages in conversations, sections in documents)
- Chunk ID: Unique identifier for each chunk, used for granular operations
Types of Memories
Document Memories
Contain entire documents, split into chunks internally for processing.Conversation Memories
Contain entire conversations with all messages and context.Simple Memories
Contain standalone pieces of information.Memory Operations
Creation
Everystore_memory() call without memory_id creates a new memory:
Expanding (Adding Content)
Usestore_memory() with memory_id to add content to existing memories:
Retrieval
Retrieve complete memories with all chunks:Chunk Operations
Work with individual pieces within memories:Memory Lifecycle
- Creation:
store_memory()withoutmemory_idcreates new memory with unique ID - Expansion:
store_memory()withmemory_idadds chunks/messages to existing memory - Retrieval:
get_memory()returns complete memory with all chunks (each chunk has an ID) - Chunk Operations: Use chunk IDs for granular updates/deletes
- Deletion:
delete()removes entire memory and all its chunks
Why This Matters
Understanding memories and chunks helps you:- Think in containers: Build complete conversations or documents, not isolated pieces
- Use
memory_ideffectively: Add to existing conversations/documents vs creating new ones - Understand search results: Search returns chunks with their parent
memory_id - Granular control: Use chunk IDs to update/delete specific messages or sections
Best Practices
- Build complete units: Use
memory_idto build entire conversations or documents in the same container - Use descriptive metadata: Identify memory types (conversation, document, preference)
- Choose appropriate collections: Group related memories logically
- Consider memory scope: Each memory should represent one complete conversation or document
- Chunk operations when needed: Use chunk IDs only for granular edits (e.g., deleting one message)
Next Steps
- Memory Operations Guide - Practical usage examples
- Conversations Guide - Working with conversation memories
- Collections Guide - Organizing your memories effectively