Skip to main content
Get up and running with Hexel Studio quickly.

Prerequisites

  • A Hexel Studio account
  • Python 3.9+
  • Your API key from the dashboard

Step 1: Install the SDK

pip install hx-sdk

Step 2: Set Your API Key

export HX_API_KEY="your-api-key"
Your API key contains your organization, workspace, and environment context.

Step 3: Initialize the Client

from hx import Client

client = Client()

# Verify your context
print(f"Org: {client.org_id}")
print(f"Workspace: {client.workspace_id}")
print(f"Environment: {client.environment_id}")

Step 4: Search Your Knowledge Store

results = client.knowledge.search(
    store_id="ks-your-store-id",
    query="How do I reset my password?",
    top_k=5
)

for result in results["results"]:
    print(f"Score: {result['score']}")
    print(f"Text: {result['text'][:200]}...")

Step 5: Store and Search Memories

# Store a memory
client.memory.add(
    store_id="ms-your-store-id",
    user_id="user_123",
    messages=[
        {"role": "user", "content": "My name is Alex."}
    ],
    metadata={"type": "identity"}
)

# Search memories
memories = client.memory.search(
    store_id="ms-your-store-id",
    query="What is my name?",
    user_id="user_123",
    top_k=10
)

print(memories["results"])

Next Steps