Self-Learning Agent Kit: working code for AI agents that learn from your approvals
The free repo explains the pattern. This is the complete, tested code. Download Self-Learning-Agent-Kit-v1.2.zip (the newest version).
The same loop running in the free browser demo:

Your agent drafts. You tap Approve, Edit or Reject on your phone. Every decision is stored in your own Postgres / Supabase database, and the next draft for a similar task reads those corrections first. When the same complaint keeps coming back, the kit proposes a rule, and you decide whether it becomes permanent.
What's inside
- SQL schema (Postgres + pgvector, Supabase-ready): runs, feedback with situation and reason embeddings, rules, and a similarity search function
- Python and TypeScript versions of the library + command line: record decisions, pull feedback from similar past tasks into the prompt, propose rules from repeated reasons, daily health check
- Telegram approval bot: stores the decision before anything is published, ignores duplicate taps, retries a failed update instead of dropping it, and tells you if publishing fails
- End-to-end example: memory → Claude draft → buttons on your phone
- A snippet for AGENTS.md / CLAUDE.md so Claude Code or Codex uses the loop
- New in v1.2: an MCP server for Claude Code, Cursor or Claude Desktop on your own Postgres / Supabase, so every machine and teammate shares one memory, with rule proposals you approve
- 27 tests (13 Python, 14 TypeScript including the MCP server)
You'll need: Python 3.10+ or Node 18+, Postgres with pgvector (the Supabase free tier works), an OpenAI API key for embeddings, and a Telegram bot token. Setup takes about 15 minutes with the README.
Not a developer? The book Just Say "Do It" shows how to have Claude Code or Codex build and run this for you: payhip.com/b/xmZvu
License: use it in your own projects and client projects. Please don't resell or share the kit itself.