DEV Community

Rishikanth S
Rishikanth S

Posted on

Title: We Built an AI That Remembers Why Your Codebase Is the Way It Is

Every engineering team has tribal knowledge — the unwritten rules that only senior engineers know.
"Don't touch that function."
"That retry limit is there for a reason."
"We tried that exact refactor in 2023 and it took production down for four hours."
When that knowledge isn't documented, junior developers walk straight into landmines that have already exploded before. Standard linters can't catch historical mistakes. Code review helps, but only if the reviewer remembers the history.
We built Shadow Architect to solve this. It's an AI agent that acts as a Digital Tribal Historian — sitting inside your GitHub workflow and firing warnings the moment a PR touches dangerous code, based on your team's actual incident history.
How it works
The moment a developer opens a Pull Request:

GitHub fires a webhook to the Shadow Architect server
The server fetches the full PR diff via GitHub REST API
Changed file paths and function names are extracted from the diff
These are sent to Hindsight (a persistent memory system by Vectorize) as a semantic query
Hindsight recalls the most relevant incidents, architectural decisions, and hotfixes from memory
A Groq-powered LLM generates a natural-language warning citing the specific historical context
The warning is posted directly as a GitHub PR Review Comment

What makes it different from a basic RAG wrapper
Most AI code review tools do simple retrieval — find similar text, inject it into a prompt. Shadow Architect goes further using Hindsight's agentic reasoning:
Disposition-driven reviews. The agent has a defined personality — high skepticism and high literalism on critical paths like auth and payments. It doesn't get swayed by benign-looking variable renames.
Enforceable directives. Hard rules like "Never remove or weaken authentication mechanisms" are injected as directives evaluated by Hindsight before the LLM sees anything. These aren't soft prompt instructions — they're enforced constraints.
Memory citations. Every warning includes a Based_On citation linking the exact incident and directive that triggered it. This is explainable AI, not a black box.
Graceful degradation. If the Hindsight API is unavailable, the system falls back to a scored local relevance algorithm. CI/CD pipelines are never blocked.
The moment that makes it real
In our demo, a junior developer opens a PR that removes the expiresIn parameter from a jwt.sign() call — a seemingly innocent change to fix a login timeout bug.
Shadow Architect responds within 15 seconds:

Risk level: CRITICAL
In February 2024, this exact change caused JWT sessions to accumulate in Redis cache at 2GB/hour. Production was down for four hours (Incident #41). The login timeout is caused by the broken refresh token flow — not the expiry. Removing expiry creates a far worse problem.
Safer path: Implement the refresh token pattern from PR #88.

Without Shadow Architect, this would have sailed through code review. The fix looked reasonable. Nobody on today's team was there in 2024.
Tech stack
Hindsight Cloud by Vectorize handles all persistent memory — storing incidents using retain, recalling them semantically using recall, and performing agentic reasoning using reflect. Groq provides fast LLM inference using openai/gpt-oss-120b. GitHub Webhooks trigger the agent on every PR. Node.js and Express handle the server. A plain HTML dashboard makes the agent's reasoning visible to the team.

Try it yourself
GitHub: https://github.com/Rishikanth-S007/Hindsight-Prj
The README has full setup instructions. You can seed 12 synthetic incidents into your own Hindsight memory bank and test it against a live GitHub repo in under 20 minutes.
"Stop breaking production the same way twice."

Top comments (0)