Quickstart Guide
Quickstart Guide
Get started with Sovant in 5 minutes.
1. Get Your API Key
Sign up at sovant.ai and get your API key from the dashboard.
Your key will look like: sk_live_22955ddcb441e098d23599d32cb390e5...
2. Install SDK
JavaScript/TypeScript
npm install @sovant/sdk
Python
pip install sovant
cURL
No installation needed - use your terminal directly.
3. Initialize Client
JavaScript
import { Sovant } from "@sovant/sdk";
const sv = new Sovant({
apiKey: process.env.SOVANT_API_KEY,
});
Python
import os
from sovant import Sovant
client = Sovant(api_key=os.environ["SOVANT_API_KEY"])
4. Create Your First Memory
JavaScript
const memory = await sv.memory.create({
data: "User prefers flat white coffee",
type: "preference",
tags: ["beverage", "coffee"],
});
console.log("Created memory:", memory.id);
Python
from sovant import MemoryCreate
memory = client.memory_create(MemoryCreate(
data="User prefers flat white coffee",
type="preference",
tags=["beverage", "coffee"],
))
print(f"Created memory: {memory['id']}")
cURL
curl -X POST https://sovant.ai/api/v1/memory \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "User prefers flat white coffee",
"type": "preference",
"tags": ["beverage", "coffee"]
}'
Note: The SDK accepts
datawhich it converts tocontentfor the API. When using cURL/REST directly, sendcontent.
5. Search Memories
JavaScript
const results = await sv.memory.search({
query: "coffee preferences",
limit: 5,
});
for (const r of results.results) {
console.log(r.content);
}
Python
from sovant import SearchQuery
results = client.memory_search(SearchQuery(
query="coffee preferences",
limit=5,
))
for r in results["results"]:
print(r["content"])
6. Recall (Hybrid Search)
Recall uses Sovant's hybrid pipeline (profile fast-path + lexical + semantic) for conversational queries like "What do you know about me?".
JavaScript
const recall = await sv.memory.recall({
query: "coffee preferences",
limit: 5,
});
for (const r of recall.results) {
console.log(r.content);
}
Python
recall = client.memory_recall(
query="coffee preferences",
limit=5,
)
for r in recall.get("results", []):
print(r["content"])
7. Threads (Optional)
Threads let you organize related memories into conversations or sessions. Both SDKs have full thread support.
JavaScript
const thread = await sv.threads.create({
title: "Coffee Preferences",
});
await sv.memory.create({
data: "User likes oat milk in their coffee",
type: "preference",
thread_id: thread.id,
});
const threadRecall = await sv.memory.recall({
query: "milk preference",
thread_id: thread.id,
});
console.log(threadRecall.results);
Python
thread = client.threads_create(
title="Coffee Preferences",
)
client.memory_create(MemoryCreate(
data="User likes oat milk in their coffee",
type="preference",
thread_id=thread["id"],
))
thread_recall = client.memory_recall(
query="milk preference",
thread_id=thread["id"],
)
print(thread_recall.get("results", []))