Search
Find relevant memories using adaptive dense and sparse retrieval, entity and graph evidence, temporal truth, facet coverage, and calibrated ranking metadata.
How Search Works
Hebbrix uses multiple independent signals to find the most relevant memories:
- Vector Search: semantic similarity using embeddings. Understands meaning, not just keywords.
- BM25 Keyword: classic keyword matching for exact terms and names.
- Graph Traversal: finds related memories through entity relationships.
- Temporal & Calibrated Ranking: distinguishes current from superseded facts, preserves multi-intent facet coverage, and exposes whether scores are calibrated or relative.
Endpoints
Code Examples
Basic Search
Python
import os
import requests
BASE = "https://api.hebbrix.com/v1"
H = {"Authorization": f"Bearer {os.environ['HEBBRIX_API_KEY']}"}
# Adaptive hybrid search with explicit confidence and coverage metadata
r = requests.post(
f"{BASE}/search",
headers=H,
json={"query": "user preferences", "limit": 10},
)
for hit in r.json()["results"]:
print(f"[{hit['score']:.2f}] {hit['content']}")Search with Filters
Python
# Top-level SDK helper, scoped to a collection
results = client.search(
query="project deadlines",
collection_id="col_work",
limit=20,
)
# Advanced search with date range and recency boost: call the endpoint directly
from datetime import datetime, timedelta
r = requests.post(
f"{BASE}/search/advanced",
headers=H,
json={
"query": "meetings",
"date_range_start": (datetime.now() - timedelta(days=7)).isoformat(),
"boost_recent": True,
},
)
results = r.json()Find Similar Memories
Python
# GET /v1/search/similar/{memory_id}: vector similarity search
r = requests.get(
f"{BASE}/search/similar/mem_abc123",
headers=H,
params={"limit": 5},
)
for hit in r.json()["results"]:
print(f"[{hit['score']:.2f}] {hit['content']}")cURL Examples
POST
/v1/searchcurl -X POST "https://api.hebbrix.com/v1/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What are the user's preferences?",
"limit": 10
}'POST
/v1/search/reasoncurl -X POST "https://api.hebbrix.com/v1/search/reason" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What programming languages does the user know?",
"include_steps": true
}'Search Types
| Field | Type | Description |
|---|---|---|
| hybrid | Fast (default) | General queries (default) |
| vector | Fast | Semantic/conceptual queries |
| bm25 | Fastest | Exact keyword matching |
| graph | Moderate | Entity relationships |