# DriftGuard

- **Event:** [RAISE Summit Hackathon](https://cerebralvalley.ai/e/raise-summit-hackathon)
- **When:** Jul 4 at 9:00 AM – Jul 5 at 7:00 PM (GMT+2)
- **Where:** Paris, France
- **Team:** [Mergim TOPALLI](https://cerebralvalley.ai/u/Mergim), [Khalil Belharir](https://cerebralvalley.ai/u/KhalilB), [Muhammad Ahmad Tariq](https://cerebralvalley.ai/u/engrahmad), [Victor TRAORE](https://cerebralvalley.ai/u/v_traore), [Mourtaza Akil](https://cerebralvalley.ai/u/Taza67)
- **GitHub:** https://github.com/MergimT/RAISE_Hackathon
- **Demo video:** https://drive.google.com/drive/folders/1hJr4v73TGa2490-6iraCKx6Qb9Wr_4zK?usp=share_link
- **Gallery:** https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/82

Cursor helps engineers ship faster. DriftGuard stops coding agents from forgetting your rules, preventing design-system and code-quality drift in real-time.

Slogan : DriftGuard : the memory layer that stops your AI agent from forgetting what you already told it.

Coding agents forget everything between sessions. You correct the same things forever — "buttons are red," "no DB calls in handlers," "we use tabs"  and the agent drifts right back. DriftGuard fixes this by persisting *only what you explicitly validated, recalling it automatically before the agent writes code, and flagging drift when generated output contradicts your validated intent.

It plugs straight into Cursor as an MCP server + extension + hook. Before every request, DriftGuard recalls the most relevant validated facts (semantic search over pgvector) and injects them into context. When you approve or correct a response, an LLM extracts durable knowledge, links it to intents, and stores it per-repo with conflict resolution (new rules supersede old ones) and a personal global graph that follows you across projects. On demand, it runs an AI drift analysis that returns violations with file-level evidence and confidence scores.

The result: fewer repeated corrections, measurable "iterations saved," and an agent that actually remembers your project's conventions.

Stack: Cursor extension + MCP (stdio) · Hono API · Postgres 16 + pgvector · Drizzle · OpenRouter (chat + embeddings) · Vite/React-Flow graph UI. Monorepo, real integration tests, 13-endpoint OpenAPI contract, Cloudflare Workers, 

The Tech Stack :
Backend & APIs: Hono API · Postgres 16 + pgvector · Drizzle ORM · OpenRouter API (Embeddings + Chat).
Frontend & Web Apps: Next.js (App Router) · React · Tailwind CSS · Vite/React-Flow (for relational rule graphs) · Custom Interactive SVG Node Physics (for the web Memory Map).
IDE & Developer Tools: Cursor Extension · VS Code Extension API · Custom Node Git Pre-Commit Engine · Commander CLI package.
Project Workspace: Monorepo managed with npm workspaces, full ESLint compilation and TypeScript checking, and custom edge API configurations.

What We Built From Scratch During the Hackathon
We completed a high-fidelity, production-grade monorepo MVP containing:

Next.js SaaS Billing Dashboard (apps/demo-saas): A beautiful, premium dark-themed template built to demonstrate real-world layout drift.
Next.js Web Report UI (apps/web): A glassmorphic dashboard containing visual diff engines, execution terminal logs, and interactive memory networks.
The Scanner CLI Engine (packages/scanner): Fast deterministic codebase parsing, matching elements, typography, and styles to local Markdown rules.
The AST Patching Engine (packages/patcher): In-place codebase rewriting, unified diff compilation, and intent classification modules.
The Unified Commander CLI (packages/cli): Single-binary entry point wrapping initializations, collect events, audits, and feedback modules.
IDE command palette integration (extension/): Seamlessly binding command actions inside Cursor/VS Code.
The Pre-commit Git Hook Script (scripts/): Intercepting git processes and acting as the repository's final compiler safeguard.
Full Serverless Edge Deployment: Configured and deployed the Web Report App onto Cloudflare Pages at driftguard-dashboard.pages.dev with full edge runtime mock-safeguards.

## More from RAISE Summit Hackathon

- [Redpill Linpro CX](https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/79)
- [CoVibers](https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/80)
- [SHTC](https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/81)
- [HACKCOFFEEBEANS](https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/83)
- [RAID](https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/84)
- [Robinsun](https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/85)

---

Markdown version of https://cerebralvalley.ai/e/raise-summit-hackathon/hackathon/gallery/82. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
