Skip to main content
You’ll need a Nebula API key before starting. Get one at trynebula.ai

Prerequisites

  • A Nebula account at trynebula.ai
  • An existing Nebula collection with some stored memories (see Quick Start to create one)
  • Python: Python 3.10+ with pip install nebula-client
  • JavaScript/TypeScript: Node.js 18+ with npm install @nebula-ai/sdk

Install

pip install nebula-client

Walkthrough

1

Initialize the client

from nebula import Nebula

client = Nebula(api_key="YOUR_API_KEY")
2

Export a snapshot from an existing collection

snapshot = client.export_snapshot(collection_id="YOUR_COLLECTION_ID")
After export, the local snapshot is the canonical copy. Nebula does not retain a server-side copy.
3

Store memories against your snapshot

Use the same store_memory method you already know — just pass snapshot instead of collection_id.
from nebula import Memory

result = client.store_memory(
    Memory(
        snapshot=snapshot,
        content="Had a meeting with Alice about the Q2 roadmap",
    )
)

# Update your local snapshot with the returned snapshot
snapshot = result.snapshot
4

Search memory

Same search method — pass snapshot instead of collection_ids.
results = client.search(
    query="What do I know about Alice?",
    snapshot=snapshot,
)

for fact in results.semantics:
    print(f"{fact['subject']} -> {fact['predicate']} -> {fact['value']}")

Next Steps