Skip to main content

Drift

An intent-based language for agentic systems. Write your agent in English-shaped blocks, run it as async Python.

agent GrantChecker {
  model: "claude-haiku"
  budget: $0.10 per run

  step assess(application: string) -> Decision {
    let summary = summarize the application as string
    let score = score eligibility from 1 to 10 as int

    if confident<score> {
      return Decision { approved: score > 7, summary: summary }
    } else {
      escalate to human review
    }
  }
}

That's a full agent — model choice, budget, an intent verb (summarize), confidence-gated branching, structured return. The transpiler turns it into async Python that runs on Drift's thin runtime.

Install

pip install drift-lang

Optional extras:

pip install "drift-lang[mcp]"      # MCP tool support
pip install "drift-lang[dendric]"  # Dendric memory backend
pip install "drift-lang[all]"

30 seconds to your first agent

drift new hello
cd hello
drift run hello.drift --input '{"name":"Riley"}'

No API key required — Drift falls back to a mock provider so you see something work immediately. Drop an ANTHROPIC_API_KEY or OPENAI_API_KEY into .env to use a real model.

CLI

drift new <name>          Scaffold a starter project
drift run <file.drift>    Transpile and execute
drift check <file.drift>  Validate syntax
drift transpile <file>    Emit Python (use -o to write to a file)
drift lex / parse         Debug tooling

What's in the language

  • agent — top-level unit. Has model, budget, state, memory, and steps.
  • step — typed sub-procedure. Body is a sequence of declarative statements.
  • Intent verbssummarize, extract, classify, translate, match, generate, etc. Each one becomes a typed LLM call.
  • confident<T> — confidence-gated branching. Run the cheap path when sure, escalate when not.
  • model { … } — multi-provider routing with prefer, fallback, upgrade when confidence < 0.7, and stream "fast" then "slow".
  • tool name from python|mcp|rest — declare external tools. MCP runs against the official SDK.
  • pipeline — composable flow with ->, =>, ~>, |> operators.
  • for each x in xs parallelasyncio.gather underneath.
  • attempt / recover — structured error handling with retry, fail, and named arms.
  • memory — short-term scratchpad or durable backend (Dendric). remember, recall, deja_vu, forget.
  • define verb — extend the intent vocabulary with your own typed verbs.
  • Cross-agent callsOtherAgent.step(args) just works.

Docs

File For
LLM.md Coding agents (Claude, Cursor, Copilot) — complete reference for one-shot loading
docs/language.md Humans learning Drift
docs/cookbook.md Copy-paste patterns
docs/gotchas.md Common mistakes

Examples

See examples/ for working .drift programs and their generated Python:

  • hello.drift — minimal agent
  • confident_demo.driftconfident<T> branching
  • grant_checker.drift — end-to-end intent + structured return
  • inbox_sorter.driftfor each … parallel triage
  • grant_checker_with_memory.drift — Dendric-backed long-term memory

Status

Alpha — language surface is stable, runtime works, 344/344 tests passing. Voice primitives parse but adapters aren't wired yet. Type system beyond confident<T> is on the roadmap.

License

MIT

Download files

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

Source Distribution

drift_lang-0.1.0.tar.gz (72.6 kB view details)

Uploaded Source

Built Distribution

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

drift_lang-0.1.0-py3-none-any.whl (76.8 kB view details)

Uploaded Python 3

File details

Details for the file drift_lang-0.1.0.tar.gz.

File metadata

  • Download URL: drift_lang-0.1.0.tar.gz
  • Upload date:
  • Size: 72.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for drift_lang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe76a4f166d9f5348885d20e165730e165d73e9453118792e3e8f3cbc0f1fcf2
MD5 834023d40e96e45cf41d36496ea1ec87
BLAKE2b-256 229b64bf0a7cc159531a78b8467b08d4bca3619791db66856f7bf7ed08ba31d9

See more details on using hashes here.

File details

Details for the file drift_lang-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: drift_lang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 76.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for drift_lang-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3db9eb6949a969c04f9b223de155663da9aabb9d7f47674c82a138c302b43ff
MD5 cb16176db800a852c028159aaa7bb6cd
BLAKE2b-256 a5a3af75cbb1745533c9ead5f7e0ff048bc5393bcf7169a0a5f81d1f06c2a53e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

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