MCP Memory Gateway (rlhf-feedback-loop)

by igorganapolsky

Not rated
GitHub

About

Local-first RLHF feedback loop for AI agents — capture preference signals, promote memories, block repeated mistakes, export DPO/KTO training pairs

Details

Author
igorganapolsky
Categories
Developer Tools, AI, Knowledge Base, Automation, Other

Install scope: machine-wide vs per-project

Both scopes writemcpServers.thumbgateplus PreToolUse / UserPromptSubmit / PostToolUse / SessionStart hooks. Machine-wide is the right default for most developers. Cross-repo blocking is not automatic: a lesson learned in one project only applies elsewhere when you share the store (machine-wide) or export/import lessons.

MCP tools (surface):gate_check(read/evaluate proposed tool call), feedback capture + session tools (write), dashboard/stats (read). Destructive agent actions stay blocked/warned by PreToolUse — ThumbGate does not execute user shell commands for you.

Local-first RLHF feedback loop for AI agents — capture preference signals, promote memories, block repeated mistakes, export DPO/KTO training pairs

Self-improving pre-action firewall for AI coding agents
AI coding agents repeat mistakes — and one wrong tool call can wipe a directory, leak a key, or push broken code.

ThumbGate is the local-firstPre-Action Checksengine for AI coding agents. It runs in the PreToolUse hook to evaluate the proposed tool call before execution — so costly mistakes can be caught before they happen.

Lightweight visuals for how agents fail without a pre-action gate:

Ithard-blocks detected secret leaks and two direct self-disable command classes by default— commands that terminate the ThumbGate gate process or enable its bypass environment override. Other high-risk classes (rm -rf, force-push, fetch-and-run, direct guardrail edits)warn and log by default. SetTHUMBGATE_STRICT_ENFORCEMENT=1for strict enforcement (warnings become hard denies).

Accepted feedback is stored as local lessons.Repeated concrete failures can become prevention rules that promote from warnings to blocking gates. The firewall improves from operations without retraining the model. Prompt evaluation (npx thumbgate eval) turns accepted feedback into reusable eval cases and local proof reports.

Honest disclaimer:ThumbGate does not update model weights. It intercepts tool calls at runtime. Local-first — no cloud required for the enforcement path.

Works withClaude Code, Cursor, Codex, Gemini CLI, Amp, Cline, OpenCode, and other MCP agents.

Agent tries: rm -rf tests/ ThumbGate: 👎 WARN + LOG — "Never delete test directories" Pattern matched: rm.-rf.tests Source: your thumbs-down from last Tuesday Strict mode: ⛔ DENY before tool execution

Agentic development is becoming a loop:Guide → Generate → Verify → Solve. ThumbGate is the pre-action gate / pre-action boundary between generated intent and executed action.

Want a phased walkthrough with a verify step at every stage? Follow theProgressive Setup Guide.

Progressive wiring — prove the pipe before you turn matching on. Empty dashboard is success.

npx thumbgate init # Phase 1: hooks only npx thumbgate doctor # verify: exits 0 only when PreToolUse hook is wired (hidden metric = hook install, not gate count) npx thumbgate dashboard --open # Phase 2: open local HTML; empty stats are OK npx thumbgate capture --feedback=down --context="Never run DROP on production tables" --what-went-wrong="agent proposed DROP" --what-to-change="require review for DROP"

LaterDROPattempts in the same scope surface the check:

⚠️ Check fired: "Never run DROP on production tables" Pattern: DROP.production Verdict: 👎 WARN + LOG (⛔ BLOCK when THUMBGATE_STRICT_ENFORCEMENT=1)

Numbered configs:config/progressive/. Guide:progressive wiring.

Directories and clients that install ThumbGate as an MCP server must startstdio MCP, not the HTTP API:

- Equivalent:npx -y thumbgate mcp
- Donotusenpm startfor MCP — that launches the hosted HTTP API (src/api/server.js), not the agent-facing stdio server.

Per-agent guides:Claude/Codex bridge·Codex profile·Cursor·MCP setup

Install scope: machine-wide vs per-project

Both scopes writemcpServers.thumbgateplus PreToolUse / UserPromptSubmit / PostToolUse / SessionStart hooks. Machine-wide is the right default for most developers. Cross-repo blocking is not automatic: a lesson learned in one project only applies elsewhere when you share the store (machine-wide) or export/import lessons.

MCP tools (surface):gate_check(read/evaluate proposed tool call), feedback capture + session tools (write), dashboard/stats (read). Destructive agent actions stay blocked/warned by PreToolUse — ThumbGate does not execute user shell commands for you.

Discoverable slash-commands — the guardrail layer for spec-driven agents

Spec-driven agent frameworks likeGSD(get-shit-done) andGitHub Spec Kitplan and generate work. ThumbGate is theguardrail layer for spec-driven agents: it sitsafter*the plan, on the boundary between a generated tool call and its execution —alongside GSD / Spec-Kit, not instead of them.

npx thumbgate initinstalls these into your agent palette:

Free tier:2 feedback captures/day (10 total)andup to 3 active auto-promoted prevention rules. Pro ($19/mo or $149/yr) is the individual tier for unlimited rules, history-aware lessons, linked feedback session flow, personal dashboard, and DPO export.Enterprise is custom and scoped after intake; hosted team lesson sync and a hosted org dashboard are not general availability.

Enterprise intake path:theWorkflow Hardening Sprintscopes one repeated failure before any broader rollout commitment.Start intake →

Local technical path:install the CLI and useinitplus the documented setup so Pre-Action Checks evaluate tool calls where the agent actually runs.

First-dollar activation path:open theThumbGate GPT, paste the risky action, capture typed feedback (thumbs down:/thumbs up:).Native ChatGPT rating buttons are not the ThumbGate capture path.Ask:what repeated AI mistake would be worth catching before the tool executes?

Paid path for individual operators:ThumbGate Prois the self-serve side lane for a personal dashboard and export-ready evidence.

Start free·Pro $19/mo·Live Dashboard·Team Sprint intake·Workflow Hardening Sprint·First Dollar Playbook

Popular buyer questions:AI search topical presence·Relational knowledge and AI recommendations·AI Mode ads for agent governance·MCP tool governance·AI agent pre-action approval gates·Background agent governance·GPT-5.5 model evaluation·Stop repeated AI agent mistakes·Browser automation safety·Native messaging host security·Autoresearch agent safety·Cursor guardrails·Codex CLI guardrails·Gemini CLI memory + enforcement·Google Cloud MCP guardrails·Roo Code alternative: migrate to Cline
- Capture👍/👎 feedback (CLI, MCP, linked feedback session flow /open_feedback_session, or
ThumbGate GPT)
- Promoteconcrete lessons via history-aware lesson distillation into prevention rules
- Evaluatethe next proposed tool call against active rules (literal/AST + local vectors)
- Allow / warn / denybefore the tool runs

npx thumbgate brain --write # → .thumbgate/BRAIN.md (lessons + gates in one artifact)

Pro operators can invokesearch_lessonsthrough MCP and usenpx thumbgate lessonsfrom the CLI. History-aware feedback sessions and lesson search are Pro capabilities; Free does not include recall or search.

flowchart LR A["Agent tool call"] --> B{"Rule match?"} B -- exact --> D["On-device gate"] B -- semantic --> C["Local LanceDB"] C --> D D -- secret/kill --> E["⛔ Hard-block"] D -- known-bad --> G["👎 Warn + log"] D -- safe --> F["👍 Allow"]
⛔ secret-exfiltration → hard-block (default) ⛔ self-protect-kill → hard-block (default) ⛔ self-protect-env → hard-block (default) ⚠️ force-push → warn; hard-block under strict ⚠️ protected-branch → warn; hard-block under strict ⚠️ unresolved-threads → warn; hard-block under strict ⚠️ package-lock-reset → warn; hard-block under strict
npx thumbgate init npx thumbgate doctor npx thumbgate capture up|down "<text>" npx thumbgate lessons npx thumbgate brain --write npx thumbgate dashboard --open npx thumbgate break-glass --reason="ThumbGate over-fired" # 5-min recovery
# Portable lessons curl -X POST http://localhost:3456/v1/lessons/export \ -H "Authorization: Bearer $THUMBGATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"outputPath": "./lessons-export.json"}' # DPO pairs for fine-tuning curl -X POST http://localhost:3456/v1/dpo/export \ -H "Authorization: Bearer $THUMBGATE_API_KEY" \ -o dpo-pairs.jsonl

Every Changeset is tied to the exactmainmerge commit and generates Verification Evidence for Release Confidence.

FAQ (one-liners):Not a fine-tuner (runtime intercept only). Different fromCLAUDE.md/.cursorrules(those are context; ThumbGate is an external allow/warn/deny before tools run).

Igor Ganapolsky— payments (Stripe/Connect), AI agent guardrails/MCP, Android + backends. Small number of contract slots:$120–150/hr, 1099, remote US.LinkedIn·thumbgate.ai

MIT — seeLICENSE. Project policy:SECURITY.md·THREAT_MODEL.md.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Local Work Model for AI agents that learns from real outcomes.

Authenticated MCP and agent gateway for Forge Cascade private AI memory, provenance, graph search, and capsule lineage.

Paid remote MCP for agent memory MCP, structured receipts, usage logs, and audit-ready evidence for agent and CI workflows.

A persistent memory server for Large Language Models, designed to integrate with the Claude desktop application. It supports tiered memory, semantic search, and automatic memory management.

MCP servers for Deephaven to orchestrate data workers and power documentation Q&A with LLMs, enabling AI-driven data workflows.

A server that provides a memory system for LLMs, enabling persistent conversations with various providers like OpenAI, Anthropic, and OpenRouter.

Q-learning memory for Claude Code. Persistent memory that learns which context helps you get work done. Memories that lead to productive sessions (commits, PRs, tests) earn higher retrieval rank automatically. 16 MCP tools, hybrid BM25 + vector + Q-value scoring, local-first with Qdrant + FastEmbed.

AI Agents framework with 64+ built-in MCP tools for search, memory, workflows, code execution, and file operations. Install via uvx praisonai-mcp

Connect your data architecture, create a knowledge graph and serve MCP tools for AI to retrieve precomputed models, connections and context.

A framework for developing LLM applications with capabilities like tool usage, planning, and memory, based on the Qwen model.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.