Docs K  Search
Docs/Search & chat/Hybrid search
Search API

Search

Find relevant memories using our hybrid search system that combines dense vector similarity, sparse BM25 keyword matching, and knowledge graph traversal.

query()one requestVector similarityKeyword · BM25Knowledge graphRecencyOutcome re-rankrankedwhat worked first
One query, five signals, one ranking. Vector, keyword, graph, and recency run in parallel, then an outcome re-rank pushes what actually worked to the top.

How Search Works

Hebbrix uses a multi-layer search approach 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.

Endpoints

Code Examples

Python
import os
import requests

BASE = "https://api.hebbrix.com/v1"
H = {"Authorization": f"Bearer {os.environ['HEBBRIX_API_KEY']}"}

# Hybrid search: combines vector similarity, BM25 keyword, and KG traversal
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/search
curl -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/reason
curl -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

FieldTypeDescription
hybridFast (default)General queries (default)
vectorFastSemantic/conceptual queries
bm25FastestExact keyword matching
graphModerateEntity relationships
Ask the docs
reading · this page

Hi! I'm the Hebbrix docs assistant. Ask me anything about this page: setup, code examples, endpoints, pricing, or integrations.