MATIH Platform is in active MVP development. Documentation reflects current implementation status.
12. AI Service
Context Graph
Semantic Search

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

ModeDescriptionUse Case
UnifiedSearches across all entity typesGeneral discovery
SemanticVector similarity search"Find concepts related to revenue"
StructuralGraph topology search"Find all entities connected to orders table"
PrecedentHistorical pattern search"Find similar past queries"
DiscoveryExploratory 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
}