Semantic Search
Production - Vector-based semantic search with multiple search modes
The Semantic Search system provides multiple search modes for discovering entities, relationships, and patterns within the context graph.
12.5.1.1Search Modes
| Mode | Description | Use Case |
|---|---|---|
| Unified | Searches across all entity types | General discovery |
| Semantic | Vector similarity search | "Find concepts related to revenue" |
| Structural | Graph topology search | "Find all entities connected to orders table" |
| Precedent | Historical pattern search | "Find similar past queries" |
| Discovery | Exploratory search | "What data is available about customers?" |
# Semantic search
curl -X POST http://localhost:8000/api/v1/context-graph/search \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme-corp" \
-d '{
"query": "customer purchase patterns and lifetime value",
"mode": "semantic",
"top_k": 10,
"entity_types": ["concept", "metric", "table"]
}'{
"results": [
{
"entity_id": "ent-uuid-1",
"type": "metric",
"name": "Customer Lifetime Value",
"description": "Total revenue attributed to a customer over their lifetime",
"score": 0.94,
"relationships": [
{"type": "derived_from", "target": "orders.revenue"},
{"type": "belongs_to", "target": "Customer Analytics Domain"}
]
}
],
"total_results": 8,
"search_time_ms": 45
}