Inspiration We've all been there: staring at a legacy codebase or a complex Merge Request, wondering why a specific caching layer was chosen or why a component was refactored. The "what" and "how" are in the code, but the "why" is lost in ephemeral Slack messages or developer brains. We wanted to capture these fleeting architectural decisions effortlessly without burdening developers with heavy documentation processes. We realized that the best time to capture this context is during the code review phase, right inside GitLab.

What it does Decision Memory AI acts as a silent team member that hooks directly into your GitLab repository.

Listens: It monitors Merge Request webhooks (opens, updates, and comments). Understands: It uses Cohere's command-r-plus model to analyze the MR description, commits, and the Discussion Thread. Interacts: If the developer didn't provide enough context, the AI dynamically generates a context-aware question based on the files changed and posts it back into the GitLab MR comments! Remembers: Once the decision is extracted, it stores the summary, reasoning, and a confidence score in a pgvector database. Retrieves: Developers can use the companion UI to perform semantic searches (e.g., "Why did we use Redis?") and instantly get a generated answer with citations pointing to the exact MRs. How we built it

Backend: Python, FastAPI, and SQLAlchemy. AI/LLM: Cohere command-r-plus for intelligent decision extraction and follow-up question generation. Database: PostgreSQL with pgvector for storing semantic embeddings of decisions. Integration: GitLab Webhooks (push & notes events) tunneled via Ngrok for real-time reactivity. Frontend: React + Vite + TailwindCSS for the semantic search dashboard. Challenges we ran into

Infinite Webhook Loops: Initially, the AI would read its own comments and trigger another webhook! We had to build signature detection to ensure it ignored its own "🤖 Decision Memory AI" messages. Double Posting: GitLab fires concurrent webhooks for certain actions. We had to implement a scanner that reads the discussion thread in real-time and aborts if the AI has already posted a question. Model Tuning: Lighter models struggled to differentiate between generic commit messages and actual architectural reasoning. Upgrading to command-r-plus and heavily tuning the system prompt fixed our extraction quality. Accomplishments that we're proud of We successfully built a system that feels like a natural, helpful team member. Instead of forcing developers to write external documentation, Decision Memory AI engages with them where they already work (Merge Requests) and builds an organizational brain in the background. We are especially proud of the dynamic question generation—the AI actually understands which files you changed and asks specific, highly relevant questions rather than generic templates.

What we learned Building stateful agents on top of stateless webhooks requires careful thread management and deduplication logic. We also learned how incredibly powerful the GitLab Notes API is for building interactive developer experiences, and how semantic vector databases (pgvector) can turn scattered MR comments into a unified knowledge graph.

What's next for Decision Memory AI

GitLab Orbit Integration: We plan to integrate with GitLab Orbit's Knowledge Graph to cross-reference architectural decisions with deep AST code dependencies. Slack/Discord Integration: Adding chat integrations so the AI can answer architectural questions directly in team channels. Automated ADR Generation: Automatically generating and committing Architecture Decision Records (ADRs) in markdown format back into the repository once a decision is finalized.

Built With

Share this project:

Updates