Skip to main content

Wrong-answer vaccine system for AI agents — learns error patterns and prevents repeated mistakes via MCP

Project description

OdabNote — Wrong-Answer Vaccine System for AI Agents

Sponsor License

Teach AI agents to never repeat the same coding mistake twice.

OdabNote is a local MCP (Model Context Protocol) server that captures error patterns, stores verified solutions, and automatically matches future errors against its database — acting as an immune system for AI coding agents.


The Story Behind OdabNote

In Korea, students keep a notebook called 오답노트 (odab-note) — a "wrong-answer notebook." Every time they get a question wrong on an exam, they write it down: what they got wrong, why it was wrong, and the correct answer. Over time, this notebook becomes their most powerful study tool. They stop making the same mistakes.

We built the same thing for AI agents.

Working daily with Claude, Gemini, Codex, and other models, a pattern became obvious: AI agents forget. They make the same mistakes across sessions — using wrong paths, breaking naming conventions, ignoring project rules. Every new conversation starts from zero.

We tried the usual fixes:

  • System prompts and harnesses — they work, but agents hit context limits and forget rules buried 50k tokens ago
  • Gate checks and linting — they catch syntax, not logic errors or project-specific anti-patterns
  • Documentation — agents skim it, miss details, and repeat mistakes anyway

None of these solutions learn. They're static. So we asked: what if agents could build their own wrong-answer notebook?

OdabNote is that notebook — a local MCP server that captures error patterns, stores verified fixes, and matches future errors against its database. It acts as an immune system for AI coding agents. Once a mistake is recorded, no agent repeats it.


Quick Start

Prerequisites

  • Python 3.10+
  • pip

Installation

pip install odab-note

Or install from source:

git clone https://github.com/hacker3699-max/OdabNote.git
cd OdabNote
pip install -e .

Verify Installation

.venv/bin/odab --help

Expected output:

Usage: odab [OPTIONS] COMMAND [ARGS]...

  OdabNote CLI - Manage wrong-answer notes for AI Agents.

Commands:
  add         Add a new wrong-answer note manually (auto-verified).
  approve     Approve a wrong-answer note (Veto Pass).
  decay       Manually apply time-decay to decrease weights of obsolete notes.
  delete      Delete a wrong-answer note.
  graph       Visualize relations and conflicts of wrong-answer notes.
  link        Link two notes with relation (triggers or conflict).
  list        List all wrong-answer notes.
  resolve     Interactively resolve conflict between Note A and Note B.
  run-server  Run the OdabNote MCP server.
  show        Show details of a specific wrong-answer note.

Usage Guide

How It Works (Natural Language)

You don't need to type CLI commands. Just talk to your AI agent in natural language.

Step 1 — Agent makes a mistake. You say: 오답 넣어 or odab pull

You asked the agent to modify config.yaml, but it created a new config_new.yaml instead.

You:  Why did you create a new file? I said modify the existing one. odab pull

Agent: ✅ Recorded (ID: 13, Model: claude-opus-4.6)
         Keyword: Created_New_File_Instead_Modifying
         Mistake: User asked to modify existing file but agent created a new file instead
         Fix: When user says 'modify', always edit the existing file in place.
              Never create a new file unless explicitly asked.

Step 2 — Not happy with the note? Say: 오답 수정 or odab fix

You:  odab fix I meant you should always back up config files before editing them

Agent: 📝 Revised note (ID: 13)
         Keyword: Config_File_Backup_First
         Mistake: Modified config file without creating a backup first
         Fix: Always create a backup copy before modifying any config file

Step 3 — Want to remove it entirely? Say: 오답 삭제 or odab del

You:  odab del

Agent: 🗑️ Deleted note (ID: 13)
         Keyword: Config_File_Backup_First
         Was: Modified config file without creating a backup first

That's it. Three phrases to remember:

Korean English What it does
오답 넣어 odab pull Record the last mistake
오답 수정 odab fix Revise the note
오답 삭제 odab del Delete the note

CLI Reference

1. Record a Mistake

When you encounter an error and fix it, record it:

odab add \
  -k "ZeroDivisionPrevention" \
  -e "ZeroDivisionError: division by zero" \
  -f "Check if denominator == 0 before dividing and return a safe default value" \
  -m "all"
Flag Description
-k Keyword name for this mistake (unique identifier)
-e Error pattern (supports regex)
-f The correct fix / solution
-m Target model (all, gemini-3.5-flash, claude-3.5-sonnet, etc.)

2. List All Mistakes

odab list
ID   | Keyword              | Model            | Count | Verified | Error Pattern
-----------------------------------------------------------------------------------------------
1    | ZeroDivisionPrev...  | all              | 1     | Yes      | ZeroDivisionError: division by...
2    | Surface_Only_Fix     | gemini-3.5-flash | 1     | Yes      | Fixed surface only, left old refs...

3. View Details

odab show 1

4. Visualize Relations

odab graph
[ Odab-Note Dependency & Conflict Graph 🕸️ ]

● [ID: 1] ZeroDivisionPrevention (Count: 1, Verified: ✓)
  └── (No active relations)

● [ID: 2] Surface_Only_Fix (Count: 1, Verified: ✓)
  └── 🔗 [Triggers] -> [ID: 3] No_Full_Audit_Before_Done

5. Link Related Mistakes

odab link 2 3 --type triggers

6. Resolve Conflicts

When two notes contradict each other:

odab resolve 1 2 --solution-c "Merged solution that combines both approaches"

7. Apply Time Decay

Decrease weight of notes not triggered in N days:

odab decay --days 30

MCP Server Integration

After pip install odab-note, add to your MCP config:

For Gemini (Antigravity)

Add to ~/.gemini/antigravity/mcp_config.json:

{
  "odab-note": {
    "command": "odab-note"
  }
}

For Claude Code / Cursor / Cline

Add to your MCP settings (e.g. .cursor/mcp.json or claude_desktop_config.json):

{
  "mcpServers": {
    "odab-note": {
      "command": "odab-note"
    }
  }
}

Available MCP Tools

Tool Trigger Description
auto_record 오답 넣어 / odab pull Quick-record a mistake from plain language
revise_last 오답 수정 / odab fix Revise the most recent note
delete_last 오답 삭제 / odab del Delete the most recent note
query_notes Search past mistakes by keyword
match_error_trace Match a stack trace to find a known fix
record_mistake Record with full control (keyword, regex, solution)
propose_conflict_resolution Propose resolution for conflicting notes
resolve_conflict_merge Execute a conflict merge
register_skill Save a verified workflow command for reuse

Testing

Run the E2E Verification Script

cd OdabNote
.venv/bin/python tests/test_mcp.py

Expected output:

🔍 [TEST 1] Query Notes with keyword 'SMC'...
Result:
Found 2 wrong-answer notes:
...

🔍 [TEST 2] Match Error Trace for SMC Timeout...
Result:
Found 1 matching wrong-answer notes:
...

🔍 [TEST 3] Match ZeroDivisionError Trace...
Result:
Found 1 matching wrong-answer notes:
  - Target Keyword: ZeroDivisionPrevention
  - Correct Solution: Check if denominator == 0 before dividing...

Manual End-to-End Test

  1. Create a bug:

    echo 'print(1/0)' > /tmp/bad.py
    python3 /tmp/bad.py  # ZeroDivisionError
    
  2. Record it:

    odab add -k "DivByZero" -e "ZeroDivisionError" -f "Guard with if x != 0" -m "all"
    
  3. Verify it matches:

    .venv/bin/python -c "
    from odab_note.server import match_error_trace
    print(match_error_trace('ZeroDivisionError: division by zero'))
    "
    
  4. Confirm the vaccine is prescribed — the output should show the fix you recorded.


Project Structure

OdabNote/
├── src/odab_note/
│   ├── __init__.py
│   ├── server.py      # FastMCP server with 6 tools
│   ├── database.py    # SQLite DB with regex matching, decay, relations
│   └── cli.py         # Click CLI with 10 subcommands
├── tests/
│   ├── test_mcp.py    # E2E MCP tool verification
│   └── buggy_script.py # Intentional bug for testing
├── docs/              # PRD, philosophy, tier matrix
├── SKILL.md           # Agent instruction file (for Claude Code, Codex, etc.)
├── pyproject.toml
└── README.md

Database Location

The SQLite database is stored at:

~/.gemini/antigravity/odab_note.db

Privacy & Security

OdabNote is 100% local. Your database lives on your machine. No data leaves your system unless you explicitly opt in.

~/.gemini/antigravity/odab_note.db  ← yours, offline, private

Community Sharing (Opt-in)

Harness engineering was the first generation — static rules to constrain AI agents. Odab engineering is the next — collective intelligence that teaches agents what not to do.

When you opt in, your anonymized mistake patterns are contributed to a shared research pool. We use this data to:

  1. Analyze which models make which mistakes, and how often
  2. Build curated preset databases per model (GPT, Claude, Gemini, Codex, etc.)
  3. Distribute those presets back to Pro/Enterprise users

You're not just sharing — you're helping build the next generation of AI agent guardrails.

What we collect:

  • The behavioral pattern (e.g. "agent renamed a directory but didn't update imports")
  • The verified fix
  • Which model produced the mistake

What we never collect:

  • ❌ Your source code, file paths, or project names
  • ❌ Stack traces or error logs
  • ❌ Any personally identifiable information

The data is strictly about how models reason and fail — not what you're building.

odab config --share on    # opt in once, auto-collect from then on
odab config --share off   # opt out anytime

Roadmap

Tier What you get Price
Free Empty database. Build your own from scratch. Full CLI + MCP. Free forever
Pro Pre-built mistake databases per model — curated from community research and systematic simulations. Coming soon
Enterprise Custom model profiles, team-shared databases, priority pattern updates. Coming soon

We are currently running large-scale simulations across major AI models to catalog their most common failure patterns. Combined with community-contributed data, these will form the foundation of Odab Engineering — a new discipline for teaching AI agents through collective mistake intelligence.


License

© Logan's Company. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odab_note-0.2.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odab_note-0.2.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file odab_note-0.2.0.tar.gz.

File metadata

  • Download URL: odab_note-0.2.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for odab_note-0.2.0.tar.gz
Algorithm Hash digest
SHA256 15cd1029beca6221c712ff64ce34bad75f40f2f5127b701bc48dcd0249c5f7cc
MD5 52f98ed390672d635b8ff8dcc842619c
BLAKE2b-256 77367840952b4320795fa70e82d2ccd7ca63d52239f3a14cea58ed14d40a7be4

See more details on using hashes here.

File details

Details for the file odab_note-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: odab_note-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for odab_note-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b6632e12f79bdcaf719815116412ec05e9d9183aa2efb6f53725f67e6c6367
MD5 94a823c36affa136c16dea2a9a0255c8
BLAKE2b-256 5661c7a2ae8c0871b7df1cbffa5bc1ad44a50d7430ea1b29edc8d6f63d9b0fa6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page