DecisionGraph: AI Learns from Engineering Corrections

Краткое содержание

Pixel’s announcement features DecisionGraph, a HydraDB project that follows links between architecture decision records to find the decision that still stands. Built with about 130 public ADRs, it learns from corrections and returns answers in about 130 tokens, compared with 590 for the baseline—helping AI coding agents avoid outdated engineering choices.

DEV Community

I built a decision graph on HydraDB that learns from corrections. Here's what broke.

Agents keep acting on engineering decisions that were reversed years ago. A 48-hour HydraDB build, the bugs I hit, and an honest baseline. Every engineering team writes its decisions down. Then it changes its mind and writes another one. Two years later, search finds the old decision as easily as the new one, and an AI coding agent will happily build on a choice the team reversed long ago. For the HydraDB hackathon I built DecisionGraph to fix that. It links each architecture decision record (ADR) to the records that replaced it. When an agent asks "what did we decide about X?", it walks those links to the decision that still stands and hands back that decision and its history, in about 130 tokens instead of 590. When someone corrects an answer, the correction is written into the graph, so the next question on that topic lands right even in different words. Live app: https://decisiongraph-latest.onrender.com Code: https://github.com/0xNexuz/decisiongraph Video walkthrough: https://youtu.be/ChWL-frv5v8 The problem in one picture Asked "Does each business unit get its own Cloud Platform cluster now?", vector search returns the closest text: a 2019 decision to run one shared cluster, which has been replaced three times since. DecisionGraph starts at the same record, then follows the "replaced by" links to the decision that stands today. The data is about 130 real, public ADRs from three UK government engineering teams: MoJ Cloud Platform, MoJ Modernisation Platform and GOV.UK on AWS (all MIT licensed). The test set is 50 questions I wrote, scored before each correction is applied. How it works Find the decision. Vector similarity, distinctive terms and hints from past corrections each vote for where the question starts. Walk to what replaced it. One HydraDB path query follows trusted "replaced by" links until it reaches a decision nothing has replaced. Learn from the correction. The links on the right path are confirmed, the wrong ones rejected, and the question is stored as a node so the next one like it starts in the right place. Where HydraDB earned its place Trust lives in the path cost Every REPLACED_BY link has a cost: 1 if trusted, 100 if not. Walking only trusted links is then a single algo.MSpaths call with maxCost set to the path length, so one untrusted hop rules the path out: CALL algo.MSpaths({
sourceLabel: 'Decision', sourceProperty: 'key',
sourceValues: ['cloud-platform:12'], targetValues: [...],
relTypes: ['REPLACED_BY'], relDirection: 'outgoing',
maxLen: 5, pathCount: 1, pairwise: false,
weightProp: 'cost', costProp: 'cost', maxCost: 5
}) YIELD path RETURN path
"Follow only what we trust" stopped being a loop in my Python and became one query inside the database. Learning is a write, not a retrain Links come from rules: an ADR's status line naming its replacement, a body that cites an older ADR next to "replace" or "migrate", and so on. Each rule has a trust score (a Beta count). When a correction proves a rule right or wrong, the new trust flows to every link that rule proposed that nobody has judged yet, in one statement: MATCH (x:Decision)-[r:REPLACED_BY]->(y)
WHERE r.rule = $rule AND r.state = 'candidate'
SET r.w = $w, r.cost = $c
The graph that answers the next question is already the corrected one. Memory is part of the graph Every corrected question becomes a Question node with a RESOLVED_TO edge to the right decision, an ABOUT edge to the topic and IN_QUESTION edges from its distinctive terms. "Has someone asked this before?" is a two-hop walk from the new question's terms, not a separate cache. Two cells, two worlds The public demo runs on one HydraDB cell. The "replay all 50 corrections" demo runs on a second cell, so a visitor pressing replay never resets anyone else's graph. Self-hosted for $0 HydraDB is built from source into one Docker image with the app. GitHub Actions builds the image and pushes it to GitHub's container registry, and it runs on Render's free tier. What broke, and h...
DecisionGraph: AI Learns from Engineering Corrections
Powered by Readybot.io

Последнее от Pixel

Stop Paying for AI Renders in Test Orders

Pixel’s announcement explains how internal test orders were accidentally triggering paid AI video renders costing just over $1 each. It details a server-side dry-run guard …

Sandblasting Grit Guide: 120 vs 220 vs 320

Pixel’s announcement explains how 120, 220, and 320 grit affect aluminium’s matte finish and reveal die-cast porosity. It also covers how pressure, blast distance, and …

NVIDIA Cosmos 3 Edge: Physical AI on Jetson

Pixel shares the first article in CAVEDU's Cosmos series, introducing NVIDIA Cosmos 3 Edge, an approximately 4-billion-parameter world model for Jetson devices. It explores multimodal …

Laravel Semantic Search with OpenAI and Pinecone

Pixel shares a practical guide to building semantic search in Laravel using OpenAI embeddings and Pinecone. It covers 1536-dimensional vectors, cosine similarity, index setup, environment …