Skip to main content
You’ll need a Nebula API key before starting. Get one at trynebula.ai
Using Claude Code, Cursor, or Codex? Run npx skills add nebula-agi/skills to integrate Nebula automatically.

Prerequisites

  • Python 3.8+ or Node.js 16+
  • A Nebula account at trynebula.ai

1. Install

# Python
pip install nebula-client

# Node.js
npm install @nebula-ai/sdk

2. Initialize Client

from nebula import Nebula

# Uses NEBULA_API_KEY environment variable
nebula = Nebula()

from nebula import Nebula, Memory

nebula = Nebula()

# Create a collection
collection = nebula.create_collection(name="my_notes", description="Personal notes")

# Store a memory
memory_id = nebula.store_memory(
    Memory(
        collection_id=collection.id,
        content="Machine learning is transforming healthcare",
        metadata={"topic": "AI", "importance": "high"}
    )
)

# Search memories
results = nebula.search(
    query="machine learning healthcare",
    collection_ids=[collection.id]
)

# Results contain semantics, procedures, episodes, and sources
for fact in results.semantics:
    print(f"{fact['subject']}{fact['predicate']}{fact['value']}")
for source in results.sources:
    print(source['text'])

What You’ll Get Back

When you store a memory, Nebula returns the memory ID:
memory_id = "eng_abc123def456"
When you search, Nebula returns a MemoryResponse with structured memory:
{
  "semantics": [
    {
      "category": "fact",
      "subject": "Machine Learning",
      "predicate": "is transforming",
      "value": "healthcare",
      "activation_score": 0.92
    }
  ],
  "procedures": [],
  "episodes": [],
  "sources": [
    {
      "text": "Machine learning is transforming healthcare",
      "activation_score": 0.91
    }
  ]
}
  • Semantics: Subject-predicate-value assertions (facts, inferences, tasks)
  • Procedures: User preferences and behavioral patterns
  • Episodes: Temporally clustered events
  • Sources: The original source text that grounds each assertion
See Core Concepts for a deeper explanation of the memory response.

Next Steps