AI that learns your judgment. Corrections become behavioral rules that converge on your style.
Project description
Gradata — AI that learns your judgment
Every correction you make teaches your AI something. Gradata captures those corrections, extracts the behavioral instruction behind them, and graduates it into a rule. Over time, your AI stops needing corrections. It converges on your judgment.
Not generally more intelligent. Calibrated to you.
pip install gradata
Works with any LLM. Python 3.11+. Zero required dependencies.
Quick Start
from gradata import Brain
brain = Brain.init("./my-brain")
# Your AI produces output. You fix it. Brain learns.
brain.correct(
draft="We are pleased to inform you of our new product offering.",
final="Hey, check out what we just shipped."
)
# Brain extracts: "Write in a casual, direct tone — avoid formal business language"
# Next session — inject learned rules into the prompt:
rules = brain.apply_brain_rules("write an email")
# > "[RULE:0.92] TONE: Write in a casual, direct tone..."
# Prove the brain is converging:
manifest = brain.manifest()
How It Works
You correct your AI
|
brain.correct(draft, final)
|
Behavioral instruction extracted:
"We are pleased..." → "Hey, check this out"
= "Write in a casual, direct tone"
|
Confidence grows with reinforcement:
INSTINCT (0.40) → PATTERN (0.60) → RULE (0.90)
|
3+ related rules → META-RULE emerges
"Use casual tone" + "No sign-offs" + "Short sentences"
= "Match Oliver's direct communication style"
|
Your AI converges on YOUR judgment
Why This Works
Corrections are signal. Every time you edit an AI's output, you're encoding your expertise. Most systems throw that signal away. Gradata captures it, extracts what you meant, and turns it into a rule.
Meta-rules are personalized intelligence. When individual rules start clustering — your email tone preferences aligning with your code review style aligning with your process preferences — meta-rules emerge. The AI starts predicting your patterns across domains. To you, it just "gets it." That's not general intelligence. That's convergence on your judgment.
Convergence is measurable. Track corrections-per-session over time. When the curve flattens, the brain has learned your style. That curve is the product demo.
Ablation Experiment Results
We ran a controlled experiment: 10 tasks scored with and without brain rules.
| Metric | Without Rules | With Rules | Delta |
|---|---|---|---|
| Overall quality | 6.60 | 7.47 | +13.2% |
| Preference adherence | 5.40 | 6.90 | +1.50 |
| Correctness | 7.50 | 7.80 | +0.30 |
The rules didn't make the AI generally smarter. They made it smarter for that specific user — matching their email style, prospecting workflow, code conventions, and session handoff format.
Behavioral Extraction
Old approach (diff fingerprints — useless):
"Content change (added: getattr)"
New approach (behavioral instructions — rentable):
"Use getattr() for safe attribute access on objects that may lack the attribute"
Every correction now produces an actionable instruction through:
- Cache hit — instant lookup of previously extracted instructions
- Template match — pre-built instructions for common patterns
- LLM extraction — Haiku call for novel corrections (~$0.001 each)
What Makes This Different
Memory systems remember what you said. Gradata learns how you think.
| System | Remembers | Learns from corrections | Graduates rules | Proves convergence |
|---|---|---|---|---|
| Mem0 | Yes | No | No | No |
| Letta (MemGPT) | Yes | No | No | No |
| LangChain Memory | Yes | No | No | No |
| Gradata | Yes | Yes | Yes | Yes |
vs Mem0: Mem0 stores context. Gradata evolves behavior. You could use both.
vs fine-tuning: Fine-tuning is expensive, slow, and loses the original model. Gradata adapts at inference time — every correction takes effect immediately.
vs system prompts: System prompts are static. Gradata's rules are dynamic — they graduate, decay, and evolve based on your corrections.
Features
Core learning loop:
brain.correct(draft, final)— captures corrections, extracts behavioral instructions, creates lessonsbrain.apply_brain_rules(task)— injects graduated rules into promptsbrain.manifest()— mathematical proof the brain is convergingbrain.prove()— paired t-test showing correction rate decreased after graduation
Event Bus (v0.3.0):
brain.bus.on(event, handler)— subscribe to any event in the pipeline- Events:
correction.created,lesson.graduated,meta_rule.created,session.ended
Human-in-the-loop:
brain.review_pending()— list lessons awaiting approvalbrain.approve_lesson(id)/brain.reject_lesson(id)— pre-graduation vetogradata reviewCLI — approve/reject from terminal
Integrations:
- OpenAI, Anthropic, LangChain, CrewAI adapters
- MCP server for Claude Code, Cursor, Windsurf
gradata init --mcpgenerates config automatically
Status
Gradata is in active development (v0.4.0). The SDK is fully functional and free. Cloud features (dashboard, optimization, brain rental) are on the roadmap.
Star the repo to follow progress.
CLI
gradata init # Create a brain
gradata correct --draft "..." --final "..." # Log a correction
gradata review # Approve/reject pending lessons
gradata stats # Brain health + convergence
gradata manifest --json # Quality proof
gradata doctor # Diagnose issues
Architecture
src/gradata/
brain.py # Brain class (public API)
events_bus.py # Central event bus
_core.py # Correction pipeline + behavioral extraction
_events.py # Append-only event log (JSONL + SQLite)
enhancements/
edit_classifier.py # Classification + behavioral instruction extraction
instruction_cache.py # LLM extraction cache
self_improvement.py # Graduation pipeline
diff_engine.py # Edit distance, severity
meta_rules.py # Meta-rule synthesis
rules/
rule_engine.py # Inject rules into prompts
rule_ranker.py # Context-aware ranking
integrations/ # OpenAI, Anthropic, LangChain, CrewAI
contrib/patterns/ # Optional agentic patterns
Community
- GitHub Issues — bugs, features, questions
- GitHub Discussions — ideas, show & tell
Contributing
See CONTRIBUTING.md.
License
AGPL-3.0. Commercial license available.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gradata-0.4.0.tar.gz.
File metadata
- Download URL: gradata-0.4.0.tar.gz
- Upload date:
- Size: 471.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
286eb521dbf4b80167ca460af4db7956befcb4aec6bf237c6fbbe80f912f2258
|
|
| MD5 |
b892d0a2fd4ae319dad49c255ebd3716
|
|
| BLAKE2b-256 |
a697737e27203c4ef70cba240557dfd71474d4937177e8e6148d610acab537ad
|
Provenance
The following attestation bundles were made for gradata-0.4.0.tar.gz:
Publisher:
sdk-release.yml on Gradata/gradata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradata-0.4.0.tar.gz -
Subject digest:
286eb521dbf4b80167ca460af4db7956befcb4aec6bf237c6fbbe80f912f2258 - Sigstore transparency entry: 1246554532
- Sigstore integration time:
-
Permalink:
Gradata/gradata@b55d0c15464b02378c677ed8b7e03412eab9720b -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Gradata
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release.yml@b55d0c15464b02378c677ed8b7e03412eab9720b -
Trigger Event:
push
-
Statement type:
File details
Details for the file gradata-0.4.0-py3-none-any.whl.
File metadata
- Download URL: gradata-0.4.0-py3-none-any.whl
- Upload date:
- Size: 388.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07fb92e8031619189580ec87c5f7c3c383ab57e41029195c7d49afd25d030aab
|
|
| MD5 |
507b79abd26746b044a4f31777a6105a
|
|
| BLAKE2b-256 |
ffc311f95b7d1fb3ae70e6b6a22cd36d2aaadbe1d62ed48670a4af81b3710c25
|
Provenance
The following attestation bundles were made for gradata-0.4.0-py3-none-any.whl:
Publisher:
sdk-release.yml on Gradata/gradata
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradata-0.4.0-py3-none-any.whl -
Subject digest:
07fb92e8031619189580ec87c5f7c3c383ab57e41029195c7d49afd25d030aab - Sigstore transparency entry: 1246554536
- Sigstore integration time:
-
Permalink:
Gradata/gradata@b55d0c15464b02378c677ed8b7e03412eab9720b -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/Gradata
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-release.yml@b55d0c15464b02378c677ed8b7e03412eab9720b -
Trigger Event:
push
-
Statement type: