MATIH Platform is in active MVP development. Documentation reflects current implementation status.
14. Context Graph & Ontology
Search Services
Search Capabilities Overview

Search Capabilities Overview

The Context Graph provides a unified search layer that combines multiple search strategies -- semantic embedding similarity, structural graph traversal, decision precedent matching, and entity discovery. The SemanticSearchService orchestrates these strategies, routing queries to the appropriate backend and merging results with configurable ranking.


Search Modes

ModeDescriptionBackend
SEMANTICPure embedding similarity searchVector Store (Pinecone)
STRUCTURALGraph-based relationship searchGraph Store (Dgraph)
HYBRIDCombined semantic + structural scoringHybrid Store
PRECEDENTDecision-focused precedent searchVector Store + BiTemporal Store
DISCOVERYExplore related entities outwardGraph Traversal Engine

Search Scopes

ScopeDescription
ALLSearch across entities, decisions, and relationships
ENTITIESSearch entities only
DECISIONSSearch decisions only
RELATIONSHIPSSearch relationships only

Subsections

PageDescription
Semantic SearchEmbedding-based similarity search using vector stores
Structural SearchGraph-based search using entity relationships and lineage
Unified SearchCombined multi-strategy search with ranked results
Precedent SearchFinding relevant past decisions for current contexts
Discovery SearchExploring related entities and neighborhoods
Graph TraversalDFS, BFS, path finding, and cycle detection

Quick Start

from context_graph.services.semantic_search_service import (
    SemanticSearchService,
    SearchQuery,
    SearchMode,
)
 
service = get_semantic_search_service()
 
results = await service.search(SearchQuery(
    query="Find datasets similar to sales_data",
    tenant_id="acme",
    mode=SearchMode.HYBRID,
    top_k=10,
))