Skip to main content

Installation

npm install @nebula-ai/sdk

Quick Start

import { Nebula } from '@nebula-ai/sdk';
// or: const { Nebula } = require('@nebula-ai/sdk');

const nebula = new Nebula({ apiKey: process.env.NEBULA_API_KEY });

async function example() {
  // Create a collection
  const collection = await nebula.createCollection({ name: 'my-collection' });

  // Store a memory
  const memoryId = await nebula.storeMemory({
    collection_id: collection.id,
    content: 'Nebula supports Node.js and TypeScript',
    metadata: { topic: 'nebula', language: 'javascript' }
  });

  // Search memories
  const results = await nebula.search({
    query: 'Node.js support',
    collection_ids: [collection.id]
  });

  for (const fact of results.semantics) {
    console.log(fact);
  }
}

example();
For more detailed examples, see Memory Operations.

Next Steps