Skip to main content

Knowledge Graph internals

The Knowledge Graph (KG) is the foundation of Aucert's test generation intelligence. This page covers the full internal architecture.

Data model (protobuf)

Defined in proto/knowledge-graph.proto:

message KGQuery {
string customer_id = 1;
string app_id = 2;
string query_type = 3;
map<string, string> filters = 4;
}

message KGResponse {
repeated KGNode nodes = 1;
repeated KGEdge edges = 2;
}

message KGNode {
string id = 1;
string type = 2;
string name = 3;
map<string, string> properties = 4;
}

message KGEdge {
string source_id = 1;
string target_id = 2;
string relationship = 3;
}

Storage: PostgreSQL + JSONB

Per ADR-005, the KG uses PostgreSQL with JSONB columns rather than a dedicated graph database (Neo4j). Rationale:

  • Neo4j is operationally heavy for under 20 customers
  • PostgreSQL JSONB provides flexible schema with standard tooling
  • Migration path to Neo4j exists if needed at scale

Ingestion pipeline

The ingestion engine processes multiple source types:

  1. AST Ingestion — Parses application code into an abstract syntax tree, extracting screen definitions, navigation paths, and state management patterns
  2. API Schema Ingestion — Reads OpenAPI/Protobuf specs to map endpoint relationships
  3. UI Map Ingestion — Analyzes layout files and view hierarchies
  4. Historical Data — Imports past test results and bug patterns

Self-healing (Phase 2)

The KG will eventually self-heal when app structure changes break existing graph nodes. When ingestion detects a renamed screen or removed endpoint, it updates the graph rather than creating orphaned nodes.

What's next