Quick Start Guide
You’ll need a Nebula API key before starting. Get one at
trynebula.ai
Get up and running with Nebula in minutes.
Prerequisites
1. Install
# Python
pip install nebula-client
# Node.js
npm install @nebula-ai/sdk
# Go
go get github.com/nebula-ai/nebula-client-go
2. Initialize Client
from nebula import Nebula
# With API key
nebula = Nebula(api_key="your-api-key-here")
# Or set NEBULA_API_KEY environment variable
# nebula = Nebula()
3. Store & Search
from nebula import Nebula
nebula = Nebula(api_key="your-api-key-here")
# Create a collection
collection = nebula.create_collection(name="my_notes", description="Personal notes")
# Store a memory
memory_id = nebula.store_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],
limit=5
)
for result in results:
print(f"Score: {result.score:.2f}")
print(f"Content: {result.content}")
What You’ll Get Back
When you store a memory, Nebula returns the memory ID:
# Returns the memory ID
memory_id = "eng_abc123def456"
When you search, you get a list of relevant results with scores:
# Search results structure
[
{
"memory_id": "eng_abc123def456",
"content": "Machine learning is transforming healthcare",
"score": 0.95,
"metadata": {"topic": "AI", "importance": "high"},
"created_at": "2024-01-15T10:30:00Z"
},
{
"memory_id": "eng_xyz789ghi012",
"content": "AI models improve diagnostic accuracy",
"score": 0.87,
"metadata": {"topic": "AI", "importance": "high"},
"created_at": "2024-01-14T09:15:00Z"
}
]
Scores range from 0-1, with higher scores indicating better semantic matches to your query.
Next Steps
Need Help?