Skip to main content

An autonomous coding agent that manages its own context across sessions

Project description

Kadmon

An autonomous coding agent that manages its own context, asks clarifying questions, and hands off between sessions without human intervention. Scores 100% on Aider Polyglot (Python) benchmark.

Install

npm install -g kadmon

Or with pip:

pip install kadmon

Getting Started

kadmon init

This walks you through provider setup interactively. Then just:

cd your-project
kadmon

Type your task, kadmon works, streams output as it goes. Ctrl+C to exit.

Provider Setup (manual alternative to kadmon init)

Anthropic:

export ANTHROPIC_API_KEY=sk-ant-...
kadmon --provider anthropic

OpenAI:

export OPENAI_API_KEY=sk-...
kadmon --provider openai

Google Gemini:

export GOOGLE_API_KEY=...
kadmon --provider gemini

AWS Bedrock:

export AWS_PROFILE=your-profile
export AWS_REGION=us-east-1
kadmon --provider bedrock

Config is saved to .kadmon/config.toml after kadmon init — you only set this up once per project.

What Makes Kadmon Different

Most coding agents are "very talented junior engineers" — they need constant supervision and context management. Kadmon is designed to be piloted like a team lead manages a senior engineer:

  1. No guessing — asks clarifying questions when requirements are ambiguous (not for permission — for correctness)
  2. Rock climbing — verifies each step before moving to the next, never sprints into the void
  3. Self-managing context — detects when its context is degrading, writes a handoff doc, and continues in a fresh session automatically

Autonomous Context Management

.kadmon/
├── config.toml          # Provider config, preferences
├── library/             # Persistent knowledge (survives across sessions)
│   ├── architecture.md  # Project structure notes
│   ├── conventions.md   # Patterns, gotchas
│   └── tasks/current.md # Active task state
├── session.json         # What's in flight right now
├── handoffs/            # Handoff docs (context continuity)
└── symbols.db           # Code structure index (tree-sitter)

The agent automatically:

  • Loads relevant library context on startup (cold start)
  • Saves learnings after each completed step
  • Detects context degradation (token budget, loops, quality drop)
  • Writes a structured handoff and resets — no human intervention needed

Local Development

git clone https://github.com/ayuan153/kadmon.git
cd kadmon
./dev

That's it. ./dev handles everything: creates a venv, installs dependencies, and launches kadmon from your local source. First run takes ~30s for setup, subsequent runs are instant.

./dev              # Launch interactive kadmon (local build)
./dev bench        # 5 Python exercises
./dev bench 20     # 20 exercises
./dev bench-full   # All 225 exercises, 6 languages
./dev run "task"   # One-shot mode
./dev test         # Run tests
./dev lint         # Run linter
./dev setup        # Force reinstall deps

The global kadmon command (from npm install -g kadmon) runs the published release. ./dev always runs your local source. No conflicts.

Benchmarking

Aider Polyglot

225 Exercism exercises across Python, JavaScript, Go, Rust, Java, C++.

# Quick smoke test (~$1)
kadmon bench --languages python --limit 5

# Full Python
kadmon bench --languages python

# All languages, 10 parallel workers
kadmon bench -j 10

# Sequential (live timer, good for debugging)
kadmon bench --limit 5 -j 1

Results: eval_results/polyglot/summary.json

SWE-bench

kadmon eval --dataset swe_bench_verified_mini.json --limit 10

Architecture

kadmon/
├── agent/       # ReAct loop, planning, backtracking, handoff, pruner
├── providers/   # LLM providers (Bedrock, Anthropic, OpenAI)
├── tools/       # file I/O, search, shell, skeleton, references, plan, ask_human
├── human/       # Question batching, CLI/webhook channels
├── eval/        # Benchmark harnesses (Aider Polyglot, SWE-bench)
├── index/       # Tree-sitter symbol index (SQLite)
└── memory/      # Librarian, session tracker, read cache

Key design:

  • Single-threaded ReAct loop with architect/editor phase separation
  • No frameworks — provider SDKs directly, minimal core
  • Autonomous handoff — detects context degradation, resets with continuity
  • File-based memory.kadmon/library/ persists knowledge across sessions
  • Ambiguity resolutionask_human tool for genuine uncertainty (not permission)

Configuration

All defaults in kadmon/config.py:

DEFAULT_MODEL = "us.anthropic.claude-sonnet-4-6"
DEFAULT_PROVIDER = "bedrock"
DEFAULT_REGION = "us-east-1"

Per-project config at .kadmon/config.toml (created by kadmon init).

Contributing

See AGENTS.md for AI contribution guidelines. Key rules:

  • Build → Lint → Test → Commit (no skipping)
  • Conventional commits with scopes
  • One concern per commit

Publishing

./publish          # patch: 0.1.0 → 0.1.1
./publish minor    # minor: 0.1.1 → 0.2.0
./publish major    # major: 0.2.0 → 1.0.0

Bumps version, commits, tags, pushes. CI publishes to PyPI + npm automatically.

License

MIT

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

kadmon-0.4.0.tar.gz (96.6 kB view details)

Uploaded Source

Built Distribution

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

kadmon-0.4.0-py3-none-any.whl (81.8 kB view details)

Uploaded Python 3

File details

Details for the file kadmon-0.4.0.tar.gz.

File metadata

  • Download URL: kadmon-0.4.0.tar.gz
  • Upload date:
  • Size: 96.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kadmon-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e7bfd0ae4f3ab9de6460eeea2f7dec3272a5864eb0e9427d5d5b9ce592c204b7
MD5 542d050968f0c600b9e13fface9307ac
BLAKE2b-256 6b1f76f401b670d2509ee62ba48a25a86b9d1f3e4bb8d30ea62febbb7482e143

See more details on using hashes here.

Provenance

The following attestation bundles were made for kadmon-0.4.0.tar.gz:

Publisher: release.yml on ayuan153/kadmon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kadmon-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: kadmon-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 81.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kadmon-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b79f0ee358d55c9ec8a30488a8b4b0a1765e576a215dc64cc50423ad2b3c5f1
MD5 05234824bf79058e1c337d81fc015b2b
BLAKE2b-256 26d5d04e169bafe8e2f7a5b302f7dc1f5c77b480583f5dea0595cc14150fa572

See more details on using hashes here.

Provenance

The following attestation bundles were made for kadmon-0.4.0-py3-none-any.whl:

Publisher: release.yml on ayuan153/kadmon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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