MiroSharkMiroShark

Graph Memory

Inside MiroShark's Neo4j temporal knowledge graph, entity resolution, hybrid retrieval, and BGE reranking.

MiroShark builds a Neo4j-backed temporal knowledge graph from your seed document before spawning agents.

Ingestion pipeline

Text flows through ontology-guided NER into batched embeddings (text-embedding-3-large via OpenRouter or local Ollama). Entity resolution combines fuzzy matching, vector similarity, and LLM reflection, while a contradiction adjudicator invalidates superseded edges rather than stacking conflicting facts.

text  ->  NER (with ontology)
      ->  batch embed (text-embedding-3-large | Ollama)
      ->  entity resolve (fuzzy + vector + LLM reflection)
      ->  MERGE entities (canonical UUIDs)
      ->  contradiction adjudication (invalidate old)
      ->  CREATE RELATION {valid_at, invalid_at, kind, source_type, source_id}

Hybrid retrieval & reranking

Every agent or report query fans out across three parallel searches, filters by valid_at and kind, and re-ranks the fused top 30 with BGE-reranker-v2-m3:

query
  +- vector edge   (Neo4j HNSW)        -+
  +- BM25 edge     (Neo4j fulltext)    -+- temporal + kind filters -> fused top 30
  +- BFS traversal (from seed entities) +
                                        v
                 BGE-reranker-v2-m3 (MPS / CUDA / CPU)
  • Leiden communities (:Community): Clusters entities with LLM-written summaries, exposed to agents via browse_clusters.
  • Reasoning memory: Persists the report agent's trace as (:Report)-[:HAS_SECTION]->(:ReportSection)-[:HAS_STEP]->(:ReasoningStep).
  • Temporal & epistemic queries: as_of="2026-04-10T14:00Z" returns the world state at that timestamp and separates source facts from agent beliefs.

On this page