Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

MemCoder Beta 2.6 — local, evidence-gated cognition for coding agents

PyPI Python 3.10+ MIT license Beta 2.6

Persistent cognition for agents that need to be right twice.

MemCoder is a local, provider-independent trust layer for coding agents. It retrieves verified context only when it can change a decision, then learns only after the host supplies proof.

Local-first · evidence-gated · fail-open · token-aware · host-agnostic


Start here  ·  Why MemCoder  ·  Beta 2.6  ·  Connect a host  ·  Evidence


Most agent memory systems remember text. MemCoder remembers what was verified, why it mattered, and when it should stay silent.

Why MemCoder

Coding agents lose the thread across long projects. They repeat known mistakes, re-read too much context, and can mistake a plausible answer for a proven one. MemCoder sits beside the host model rather than replacing it:

The host owns MemCoder owns
Reasoning, editing, tools, and final verification Trusted memory, retrieval restraint, reusable procedures, and learning admission
The code change Whether earlier evidence is useful enough to surface
The final answer Whether the outcome has enough proof to become durable memory

This means a host can keep working normally when MemCoder has nothing useful to add—or when MemCoder is temporarily unavailable.

The loop

Task to utility gate to guidance to verification to learning

Moment MemCoder does Result
Before work Retrieves only decision-useful, trusted evidence No transcript dump or advice flood
Before risk Names the likely failure mechanism and cheapest proof Known mistakes become preventable
During work Preserves bounded decisions, constraints, and next actions Long projects resume without replaying chat
After proof Runs QA before it admits learning A claim without evidence does not become memory
Between tasks Reuses Skills and creates sandboxed Dream candidates Learning compounds without silently mutating trust

Start here

Install the published package

python -m pip install --pre memcoder
python -m memcoder --help
python -m memcoder storage status

MemCoder requires Python 3.10+. Its core does not require Ollama, CUDA, or a generation-model API key. The first semantic-index use may download a local embedding model.

Use the current Beta 2.6 source

git clone https://github.com/Shikhar-code/memcoder.git
cd memcoder
python -m pip install --no-build-isolation .
python -m memcoder --help

Give a host one automatic entry point

Create task.json:

{
  "event": "task_started",
  "task_id": "billing-validation-42",
  "problem": "Fix request validation without changing successful responses.",
  "agent_id": "billing-api",
  "environment": {
    "branch": "main",
    "available_checks": ["python tests/test_validation.py"]
  }
}
memcoder autopilot --input task.json

The response is deliberately small: none, risk, brief, or plan, plus the cheapest verification requirement. The host remains in control.

What is in the current core

Useful memory, not more memory

The Utility Engine ranks trusted evidence by relevance, risk, provenance, and decision value. Related-but-unhelpful records are withheld.

Skills with boundaries

Promoted Skills carry preconditions, expected observations, verification, failure handling, rollback, version history, and influence evidence.

Autopilot and Failure Radar

Lifecycle events deduplicate unchanged work, flag preventable risk, recommend the cheapest check, and fail open when the adapter cannot help.

Project Cortex

MemCoder keeps bounded project state: decisions, rationale, risks, drift, resurrection, and safe handoff—never a raw chat archive.

What MemCoder stores
Layer Purpose Never treated as
Experience Verified task, solution, files, and evidence A raw conversation
Reflection A concise investigation observation A fix disguised as insight
Principle Transferable, evidence-backed guidance Generic motivation
Skill A test-carrying reusable procedure Open-ended autonomy
Project Cortex Decisions, constraints, risks, and next actions A transcript dump

What's new in Beta 2.6

Beta 2.6 turns verified failures and competing ideas into inspectable, reversible cognition. It stays local and provider-free: the host still reasons, edits, and verifies while MemCoder supplies bounded evidence and proof gates.

Failure Frontiers

Record a failure's trigger, risk, warning, smallest verification, and counterexamples. Autopilot surfaces only applicable active warnings, and harmful feedback moves a frontier out of automatic guidance.

Causal calibration

Intervention outcomes are counted separately from memory content. Helpful, ignored, misleading, and harmful feedback produces an explicit calibration summary instead of silently rewriting trusted records.

Cognitive Branches

Try an alternative plan in an owner-scoped branch. Changes, hypotheses, and supporting memory IDs remain isolated until proof obligations pass.

Cognitive Diff + merge gates

Compare branch decisions deterministically, detect conflicts and environment drift, then merge or roll back without deleting the audit trail.

failure evidence -> Failure Frontier -> warning + smallest check
alternative idea -> Cognitive Branch -> proof obligations -> diff -> merge/rollback
intervention outcome -> calibration summary -> safer future ranking
Beta 2.6 controls
Surface Use it for
memcoder frontier --input request.json Record, match, update, or calibrate a failure boundary
memcoder branch --input request.json Create, change, prove, diff, merge, or roll back a cognitive branch
memcoder utility-summary --input request.json Inspect causal feedback calibration
memcoder storage status Count records, frontiers, branches, and Dream candidates

What's new in Beta 2.5

Beta 2.5 is the preceding foundation release. It adds a controlled way for memory to improve between verified tasks without turning “self-improvement” into silent, unreviewable behavior.

Automatic Dreaming

After a QA-approved outcome, MemCoder compares related trusted Experiences and creates a compact candidate pattern. Candidates include source evidence and counterexamples, stay local, and are excluded from trusted retrieval.

Sandbox before promotion

A Dream candidate needs structured, passed sandbox evidence before it can be promoted. Promotion is inspectable and reversible; failed or incomplete candidates remain quarantined.

Cognition Contracts

Repositories can test the cognitive layer in CI: require verification, abstain without evidence, exclude non-trusted records, and preserve fail-open host behavior.

Host certification

Host receipts can be checked for lifecycle boundaries, QA-gated learning, privacy behavior, and fallback safety before you trust an integration.

verified outcome
  -> automatic Dream candidate
  -> sandbox evidence
  -> promoted Principle or rejected candidate
  -> reversible provenance-backed learning
Beta 2.5 controls
Command Use it for
memcoder dream --input request.json Inspect, verify, promote, or roll back Dream candidates
memcoder contract --input request.json Run deterministic cognition assertions
memcoder host-certify --input request.json Validate a host’s lifecycle and evidence receipts
memcoder evaluate --input runs.json Compare matched host conditions, including dreaming
memcoder storage status Inspect local memory and Dream-candidate storage

Connect a host

Codex Desktop

The included MemCoder Codex plugin invokes the lifecycle automatically for substantive engineering work. You do not need to write a MemCoder-specific prompt every time.

git clone https://github.com/Shikhar-code/memcoder.git
cd memcoder
python -m pip install --no-build-isolation .
python scripts/configure_codex_plugin.py

In Codex, add codex-marketplace as a local marketplace, install MemCoder, then restart Codex. After source updates, refresh/reinstall the MemCoder plugin so Codex loads its latest skill instructions.

AGY / Antigravity

python -m memcoder setup-agy

Restart AGY. The AGY prompt template explains the manual path; the MCP adapter remains provider-free.

Python, MCP, and automation

Every operation is available through structured Python, CLI, and MCP calls.

from memcoder import autopilot_event_cognition

packet = autopilot_event_cognition(
    event="task_started",
    task_id="task-42",
    problem="Fix request validation safely.",
    agent_id="billing-api",
)

Evidence, not hype

MemCoder has a controlled transfer result: three baseline AGY runs passed the visible test but failed private robustness checks; six MemCoder-assisted runs passed the same private checks. That supports a narrow claim that verified validation procedures transferred to unseen variants in that setup.

It does not prove that MemCoder universally improves every model, task, or repository. Beta 2.5’s automatic Dreaming, sandbox, rollback, contract, and host-certification behavior, plus Beta 2.6’s frontier and branch gates, are verified provider-free. A clean real-host baseline-versus-Dreaming comparison is deferred to the 1.0 evidence gate.

Verified now Still being measured
Provider-free local runtime and fail-open host behavior Broad real-project performance improvement
QA-gated learning, retrieval safety, and reversible Dreaming Median token and rework reduction
Skills, Project Cortex, and cognition contracts Production-scale latency and cloud operation

Developer reference

Manual CLI workflow
memcoder intervene --input task.json
memcoder verify --input outcome.json
memcoder record --input outcome.json
memcoder retrieval-debug --input task.json
memcoder storage status

verify is read-only. record reruns the QA gate and stores nothing when evidence is failed or insufficient.

Project continuity commands
memcoder project-update --input project-update.json
memcoder project-resurrect --input project-resurrect.json
memcoder project-handoff --input project-handoff.json
memcoder project-accept --input project-accept.json
Provider-free regression checks
python tests/test_automation_cli.py
python tests/test_mcp_provider_independence.py
python tests/test_retrieval_safety.py
python tests/test_memory_quality.py
python tests/test_qa_admission.py
python tests/test_cognition_brief.py
python tests/test_skill_promotion.py
python tests/test_planning.py
python tests/test_skill_health.py
python tests/test_evaluation.py
python tests/test_dreaming.py
python tests/test_cognition_contracts.py
python tests/test_beta25_cli.py

Explore further

Document Start here when you need
Roadmap Product direction and release gates
Changelog Version-by-version changes
MCP integration Provider-free MCP behavior
AGY prompt template Guarded AGY use
Architecture PDF Component-level design

License

Released under the MIT License.

Retrieve precisely. Decide deliberately. Learn from proof.

Built by Shikhar-code.

Download files

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

Source Distribution

memcoder-0.2.6b1.tar.gz (82.9 kB view details)

Uploaded Source

Built Distribution

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

memcoder-0.2.6b1-py3-none-any.whl (95.3 kB view details)

Uploaded Python 3

File details

Details for the file memcoder-0.2.6b1.tar.gz.

File metadata

  • Download URL: memcoder-0.2.6b1.tar.gz
  • Upload date:
  • Size: 82.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for memcoder-0.2.6b1.tar.gz
Algorithm Hash digest
SHA256 52cf1515bd76fb4743834ea37d679ad41e256f58e82a3718eed988ccc1d02040
MD5 9c0dff413be46e5267794f0c3ae99710
BLAKE2b-256 5f67037201426e6ea7d6dd62537f682a9ef44285130000a8c746322aa29f61c2

See more details on using hashes here.

File details

Details for the file memcoder-0.2.6b1-py3-none-any.whl.

File metadata

  • Download URL: memcoder-0.2.6b1-py3-none-any.whl
  • Upload date:
  • Size: 95.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for memcoder-0.2.6b1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a961fa807277a38ced0ba1d1ed4038a98ed687205d2e61fdb0d917e1ef791b3
MD5 1d4fea85dd80de60eedc9a7894192ab9
BLAKE2b-256 4a4e18784c5835161872ffbaab5b15a7af7e30ff08e002fa181efabde24a1570

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 Sentry Error logging StatusPage Status page