Building an Ontology-Driven Agent Knowledge Graph for Billions of Events
How to turn massive telemetry into explainable evidence chains: a seven-layer architecture combining an ontology-driven knowledge graph with specialized agents for root cause analysis in high-scale observability systems.
Building an Ontology-Driven Agent Knowledge Graph for Billions of Events
The Problem: Massive Events Don’t Equal Explainability
Large-scale streaming and high-concurrency online systems push observability platforms to handle two extremes simultaneously: enormous instantaneous concurrency and extremely high event ingestion rates. In a publicly documented case, a large streaming platform reached roughly 65 million concurrent streams while recording more than 38 million events per second. At this scale, the hard part is not storing logs, metrics, and traces — it’s answering, within a short time, questions like: which component changed when homepage rendering suddenly slowed by 1.5 seconds? Which evidence proves it? Why did multiple monitoring tools reach different conclusions?
A common dilemma is that alerts fire, but remediation still takes hours. The cause is usually not a lack of data, but a lack of shared semantics across data sources. One tool calls an entity an application, another calls it a service; one dashboard aggregates by host, another by service instance; node names in traces don’t match names in the configuration system. Engineers end up spending huge amounts of time rebuilding “facts the tools already knew.” Ontology-driven observability exists to solve exactly this semantic misalignment. Rather than adding another chart on top of existing tools, it establishes a shared contract that organizes events, entities, relationships, evidence, and the query process into a reasoning-ready, verifiable knowledge graph.
The “agent knowledge graph” discussed here is not a static asset. It is a runtime system in which multiple specialized agents query, validate against, and coordinate around the graph. The graph provides unified semantics and evidence chains; the agents decompose questions, invoke typed tools, verify evidence, and produce explainable conclusions.
Overall Architecture: Seven Parts Forming a Closed Loop
A practical rebuild can be decomposed into seven layers. They are not simply stacked; they form a closed loop from data to semantics, from semantics to reasoning, and from reasoning to evaluation.
- Telemetry data lake: Stores massive raw events as a replayable foundation of facts. Example scale: 1.922 billion rows and 15.24 GB of columnar storage. The key to the lake is not size, but preserving traceable fields such as timestamps, sources, entity identifiers, and run batches.
- Identity and ontology: Defines entity types, attributes, relationships, and unique identifier rules. Each machine has exactly one authoritative name; constraint shapes reject erroneous facts, such as the same host identifier mapping to multiple service names.
- Evidence provenance store: Every ingestion or inference run writes to an independent named graph, recording “who, at what time, based on which raw facts, reached which conclusion.” This supports point-in-time questions and prevents post-hoc overwrites that make results unreproducible.
- Enrichers and the coverage ladder: Perform entity normalization, label completion, and relationship completion on raw events while recording coverage. Models and rules may only use closed vocabularies, preventing the invention of nonexistent entity types.
- Correlation layer: Traces request chains along the call graph, linking services, instances, hosts, dependencies, and metrics. Correlation is not a simple join — it’s a directed graph traversal with time and confidence.
- Root cause agents: Includes domain expert agents, an evidence verification agent, and a coordination agent. Expert agents propose hypotheses using typed tools; the verification agent checks whether evidence is sufficient and temporally consistent; the coordination agent merges conflicting conclusions.
- Evaluation and replay: Assesses root cause quality through dual-reader labeling, precise tests, and replay mechanisms, and supports capacity planning on a single laptop. In the rebuild experiment, the call graph chain ranked the faulty component in the top three 26.8% of the time, and a single laptop sustained 26.1 million events per second. These figures show that the semantic and agent layers can form an effective closed loop under controlled resources.
Identity and Ontology: Unify Naming Before Reasoning
The first step in an ontology-driven approach is not building a complex model — it’s solving identity. The most common errors in observability data are “one entity, many names” and “many entities, one name.” For example, the configuration system calls an instance svc-a-01, the monitoring system calls it service_a, and the call graph uses an internal ID. Without normalization at the entrance, all downstream correlation drifts.
An effective approach combines authoritative identifiers, alias mapping, and constraint validation:
Constraint Host ID Uniqueness:Subject type: hostRule: each host identifier must be uniqueReject: same host identifier mapped to multiple service namesReject: facts missing run batch or timestampConstraint Service Instance Ownership:Subject type: service instanceRule: must belong to exactly one serviceEvidence: configuration snapshot or deployment record
Constraint shapes exist to reject erroneous facts, not to clean them up afterward. Once bad facts enter the graph, agents may reason from false premises and produce conclusions that look plausible but can’t be trusted. Closed vocabularies matter equally: entity types, relationship types, and metric names must all come from a controlled set. The model must not invent unqueryable types like “suspected dependency” or “mystery component” on the fly.
Evidence Provenance: Making Every Conclusion Traceable to a Moment and a Batch
Facts in a knowledge graph are not eternal truths; they are assertions with time and source attached. Each run uses an independent named graph, enabling point-in-time questions. For example, if the homepage slowdown occurred at 10:15:30, the system should query deployment changes, instance scaling, dependency latency, and alert states between 10:15:00 and 10:16:00 — not explain the past with the current snapshot.
An illustrative query:
Query Incident-Time Evidence(point-in-time T, run batch B):FROM named graph[B]SELECT component, relationship, metric, evidence source, confidenceWHERE timestamp <= TAND coverage = confirmedAND evidence source IN controlled source setORDER BY timestamp ASC
Provenance should also distinguish three tiers: raw facts (from the telemetry lake), enriched facts (from normalization and completion), and inferred conclusions (from agents). These should be stored in separate layers so that inference results cannot pollute raw facts in reverse. For conflicting evidence, keep the conflict itself and let the verification agent assign priority — never silently overwrite.
Enrichers and the Coverage Ladder: Knowing What You Don’t Know
The goal of enrichers is to convert raw events into graph-ready entities and relationships — but coverage must be recorded. The coverage ladder can be understood as graduated states from “raw event ingested” to “entity normalized,” “relationship completed,” and “evidence confirmed.” Only evidence that reaches the confirmed level should enter high-confidence root cause chains.
At minimum, coverage should answer three questions: Which services have call graphs? Which hosts have configuration snapshots? Which time windows have ingestion gaps? If a service has no call graph, the agent should not assume “no dependencies” — it should output “correlation evidence missing.” This dramatically reduces hallucinated root causes.
Correlation and Root Cause Agents: From Graph Traversal to Verifiable Conclusions
The correlation layer traces chains along the call graph, connecting entry requests, services, instances, hosts, and dependency metrics. Root cause agents should not simply “read the graph and give an answer.” Instead, they should work in steps:
- Expert agents select candidate components based on symptoms, invoking typed tools to fetch subgraphs, time series, and change records;
- The evidence verification agent checks each candidate for temporal consistency, directional consistency, and coverage completeness;
- The coordination agent ranks conflicting candidates and outputs an evidence chain with an uncertainty statement.
For example, with a symptom of homepage rendering slowing by 1.5 seconds, candidates might include the entry service, a cache dependency, configuration rollout, and host resources. The verification agent should check: did the latency rise precede the alert? Does the call graph direction support that dependency? Did the change occur in the same time window? If evidence is insufficient, the conclusion should be downgraded to “suspected” rather than forcing a single root cause.
Evaluation, Replay, and Capacity Planning
An agent system without evaluation should not go to production. One approach is dual-reader labeling: one reader examines the raw telemetry, another examines the graph’s conclusions, and each labels the root cause independently; agreement is then compared. Precise tests check whether specific fault injections are ranked in the top three. Replay mechanisms feed historical time windows back through the graph and agents to verify that conclusions remain stable.
Capacity planning should focus on event throughput, graph query latency, and agent invocation cost. In the rebuild experiment, a single laptop sustained 26.1 million events per second — showing that with columnar storage, combined batch and stream processing, and restricted queries, scale is not out of reach. Production deployment, however, still requires accounting for peak amplification, replay concurrency, and evidence retention periods.
Implementation Tips and Common Pitfalls
First, don’t build a large, all-encompassing ontology upfront. Start with the ten entity and relationship types most used in incident triage and expand gradually. Second, identity normalization must come first, or downstream correlation costs grow exponentially. Third, record coverage explicitly — missing evidence is more insidious than wrong evidence. Fourth, agent tools must be typed, restricting queryable entities and relationships; free-text queries lead to unreproducible results. Fifth, make replay and evaluation a release gate, not an afterthought.
Overall, the value of an ontology-driven agent knowledge graph lies in converting “massive events” into “explainable evidence chains.” By unifying identity, constraining facts, recording provenance, correlating call graphs, and organizing root cause agents, it moves observability from “alert dashboards” toward “verifiable reasoning.” For teams facing high concurrency, inconsistent tool semantics, and long remediation cycles, this seven-layer architecture offers an engineering path that can be rolled out in stages.
