About this project
Project Memory is a portfolio piece, and it's also live.
It's a real multi-tenant SaaS — anyone can sign up, plug it into Cursor or Claude Code via OAuth, and use the shared memory / task / code layer. It's also a dogfooded portfolio piece by Amar Gupta to demonstrate end-to-end ownership of a non-trivial MCP-driven system: schema + RLS, embeddings, OAuth 2.1 broker, remote MCP server, and a desktop code-sync client.
About the builder
Amar Gupta
AI-powered full-stack engineer · 7+ years · building agent-native software
Project Memory is part of a seven-product portfolio of dogfooded apps that share infrastructure: a custom MCP fabric, Supabase with RLS, channel-based wakes, and a desktop Electron relay. I built every layer — protocol, schema, embeddings pipeline, OAuth broker, code-sync, and the Claude Code / Cursor MCP integration that makes the agents share context across sessions.
Currently building
Project Memory (knowledge layer), Setu (chat relay), Sandesh (publishing), Sankalp (job autopilot), Swayam (automation), Sathi (personal manager), Sutra (desktop relay)
Open to
Senior / staff full-stack · AI eng · MCP and agent infra roles
What Project Memory demonstrates
Six skills, one running system.
01
Multi-tenant Postgres with RLS
Every pmd_* table is user_id + project_id scoped. JWTs are short-lived (5 min HS256), with an `app_actor` claim that the audit trigger reads via current_setting. Service-role access is wall-gated to /api/admin and enforced by a custom ESLint rule.
02
Remote MCP over Streamable HTTP
Stateless POST /api/mcp using @modelcontextprotocol/sdk's WebStandardStreamableHTTPServerTransport with enableJsonResponse=true. 14 pm_* tools registered. Idempotent writes via (user_id, client_id, client_payload_hash) — replays return the same row id; payload mismatches return idempotency_conflict.
03
pgvector + HNSW semantic search
OpenAI text-embedding-3-small (1536d) over memories, tasks, and code chunks. HNSW indexes with m=16, ef_construction=64, ef_search=100 per RPC. Memories support trigram + tsvector hybrid; code-chunks are vector-only with a 500-token sliding-window chunker.
04
OAuth 2.1 + Dynamic Client Registration
Cursor / Claude Code auto-discover via RFC 9728 Protected Resource Metadata, self-register via RFC 7591 DCR, run PKCE S256, and bind tokens to the MCP audience via RFC 8707. Long-lived pm_* user tokens are sha256-looked-up against pmd_long_lived_tokens.
05
Desktop code-sync via Electron
Sutra (Electron 33) watches git commits, runs a 10-pattern secret scrubber, chunks files into 500-token sliding windows (line-aligned, 6-line overlap), and upserts to /api/sync. Dedup key is (path, start_line, end_line, content_hash) so unchanged chunks skip re-embedding.
06
Next.js 16 App Router discipline
RSC by default. Every API route declares `export const runtime = 'nodejs'` so jose + pgvector + OpenAI never get edge-bundled. The proxy.ts (renamed middleware) stays on the edge runtime. No middleware-level auth gating — that's per-layout.
Sibling products
Project Memory is one of seven.
Project Memory, Setu, Sandesh, Sankalp, Swayam, Sathi, and Sutra share the same Supabase project, the same MCP fabric, and the same Postgres tenant model. Each lives at its own subdomain and demonstrates a different end-to-end use case.
Setu
Real-time relay between browser, mobile, WhatsApp, Telegram and Claude Code
Sandesh
Content publishing — LinkedIn, Threads, Instagram, YouTube
Sankalp
Job-application autopilot — scrape, store, auto-apply
Swayam
Automation routines — scheduled Claude Code wakes
Sathi
Personal manager — daily routines, briefings, life ops
Sutra
Desktop relay (Electron) — local MCP, code-sync, push fan-out
ai-chat-devfrend
Multi-tenant RAG chatbot platform with an embeddable widget
Hiring?
I'm open to senior / staff roles.
Full-stack, AI eng, MCP / agent infra. Happy to walk a hiring panel through any layer of this system live — protocol, embeddings, OAuth broker, code-sync, or the Claude Code / Cursor integration that makes it actually do work.