# Make Your AI Agents Predictable With Graph Engineering - Zachary Blumenfeld, Neo4j

## Executive summary

Graph engineering is defined as the practice of designing agent work as an explicit graph, where nodes perform work and edges route state. This approach moves beyond simple prompt or context engineering by providing agents with a structured map of logic. The core benefits—predictability, governance, and portability—are achieved by compiling procedural knowledge (skills) and past decision traces into graph-shaped artifacts. This allows agents to execute complex, multi-step processes in a deterministic, auditable manner, significantly improving performance and reducing costs compared to unstructured methods.

## Key takeaways

- Definition and Types of Graphs: Graph engineering involves designing agent work as an explicit graph (nodes do work, edges route state). Three types are discussed: general execution graphs (workflow graphs), context graphs (decision traces connecting data), and procedural graphs (skills or procedures modeled as graphs).
- Core Benefits of Graph Engineering: Graph structures provide three key benefits for agents: 1) Predictability (constraining the agent's path for accurate results); 2) Governance (allowing control, auditing, and understanding of agent actions); and 3) Portability (storing the graph structure in a knowledge layer for use across different runtimes).
- Compiling Skills and Memory: Procedural knowledge (skills) can be compiled into a graph structure by taking written material (e.g., a skill MD file), scripts, and references, and mapping them into nodes and routing points. Similarly, context graphs (past decision traces) can be distilled into a skill, retaining provenance and governance over time.
- Demo: Loan Approval Process Improvement: The speaker demonstrated compiling a complex, poorly governed loan approval task into a graph-shaped skill. This process, which involved multiple policy checks and decision models (like Jev or TypeSafe), drastically reduced execution time (from 7.5 minutes to under 2 minutes) and cost by enforcing a deterministic, auditable path.

## Technical details

- Graph Structure and Components: Graph engineering uses nodes to represent work and edges to route state. The architecture involves a knowledge layer (e.g., Neo4j) sitting between systems of record (DataStax, BigQuery, Snowflake) and the agentic brain/memory tools.
- Agent Memory and Context Graphs: Context graphs manage different types of memory: short-term (conversation history), long-term (extracted entities), and reasoning/decision trees. This allows agents to maintain a comprehensive, traceable record of decisions.
- Skill Compilation and Determinism: A skill is compiled into a graph-shaped artifact (YAML format) that contains scripts, assets, and source documentation. This deterministic format allows the skill to be ported across various agent harnesses and runtimes, ensuring the agent follows an exact, predefined path.
- Observability and Governance: By persisting runs within the graph, users gain observability. It is possible to track all steps, identify which decision branches were taken or skipped, and audit the entire process history, which is crucial for compliance and governance.

## Practical implications

- Implementing graph engineering allows organizations to automate complex, policy-driven processes (like loan approvals or compliance reporting) in a highly governed and trustworthy manner.
- The ability to compile procedural knowledge into portable graph skills standardizes agent behavior, making agents less prone to unpredictable failures.
- Graph-based observability provides a complete audit trail of an agent's reasoning and tool usage, which is critical for regulated industries.

## Topics

Graph Databases, AI Agents, Workflow Automation, Knowledge Graphs, Procedural AI, Neo4j Agent Memory Service, Aura

Source: https://www.youtube.com/watch?v=g_NgCLTibiM
