Skip to main content

Most AI agents get dumber over time. March doesn't.

Project description

March

Most AI agents get dumber the longer you use them. March doesn't.

Agent frameworks love to dump everything into the LLM context window โ€” your entire conversation history, vector DB search results from six months ago, every sub-agent's internal monologue. You pay for every token, and the LLM drowns in noise.

March takes a different approach: structured compression, isolated memory, and selective recall. The result is an agent that stays sharp after hundreds of turns, not one that slowly forgets what you told it ten minutes ago.

pip install march-ai
march start

Two commands. You're running.


Why March?

๐Ÿง  Memory That Actually Works

Most frameworks either truncate history (losing critical decisions) or shove everything into a vector DB (retrieving outdated garbage). March uses rolling context compaction โ€” a two-step process that compresses conversation history while preserving every decision, requirement, and code snippet that matters.

How it works:

  1. When context fills up, March summarizes the conversation (keeping facts, dropping filler)
  2. Then deduplicates against your static files โ€” no redundant information in context
  3. Session memory (facts.md, plan.md) is folded in and survives every compaction cycle

The result: after 100 turns, March still knows your project uses PostgreSQL, deploys to Lambda, and has a March 15 deadline. Other frameworks forgot that at turn 30.

๐Ÿ”’ Sub-Agent Isolation

When March spawns a sub-agent, it gets its own process, its own memory, its own LLM connection. A sub-agent can crash, OOM, or go rogue โ€” the parent agent is unaffected.

mtAgent (lightweight) mpAgent (isolated)
Runs as asyncio task Separate OS process
Memory Shared with parent Fully independent
Best for I/O-bound work, API calls GPU compute, simulations, risky ops
Crash impact Could affect parent Contained โ€” parent continues

Sub-agents communicate via IPC (Unix socketpair + msgpack). Results are pushed to the parent โ€” no polling, no shared state corruption.

๐Ÿ“ Selective Memory (/rmb)

Vector databases remember everything. That sounds good until your agent retrieves a "relevant" decision from three months ago that was superseded last week.

March uses explicit, human-like memory:

  • /rmb saves what you tell it to save โ€” decisions, preferences, key facts
  • Session memory auto-captures facts and plans during work
  • Compaction deduplicates and keeps only the latest version of evolved facts
  • Nothing stale sneaks back in through similarity search

๐Ÿ”Œ Plugin Pipeline

Before/after hooks on every agent step. Write a plugin in 10 lines:

from march.plugins import hook

@hook("before_llm_call")
async def log_tokens(context):
    print(f"Sending {context.token_count} tokens")

๐Ÿ“ก Multi-Channel, Single Codebase

One march start gives you:

  • Terminal โ€” interactive or one-shot mode
  • Matrix โ€” encrypted chat with E2EE support
  • WebSocket โ€” connect March Deck or any custom frontend
  • ACP โ€” IDE integration (VS Code, Cursor, any editor with agent protocol support)

All channels share the same agent, same memory, same session state.


How Rolling Context Works

Turn 1-30: Full messages in context
           โ†“ context window fills up
Turn 31:   Compaction triggers
           โ”œโ”€ Step 1: Summarize (keep decisions, drop filler)
           โ”œโ”€ Step 2: Dedup against static files
           โ””โ”€ Session memory folded in
           โ†“
Turn 31+:  [Compact rolling summary] + [Recent messages]
           โ†“ context fills again
Turn 60:   Compaction triggers again
           โ””โ”€ Builds on previous summary (accumulative)
           โ†“
Turn 100:  Still knows your project constraints from Turn 3

Key properties:

  • Accumulative โ€” each compaction builds on the last, so early context is never fully lost
  • Lossless for decisions โ€” identifiers, code, URLs, action items always preserved
  • Self-contained โ€” after compaction, the rolling summary contains everything the LLM needs
  • Configurable โ€” tune compaction threshold, summary budget, and dedup ratio

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Channels (Pure I/O)                  โ”‚
โ”‚  Terminal  ยท  Matrix  ยท  WebSocket  ยท  ACP       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
                   โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Orchestrator                         โ”‚
โ”‚  LLM calls ยท Tool dispatch ยท Cancel/redirect     โ”‚
โ”‚  Ephemeral turn state (never persisted)          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                    โ”‚
           โ–ผ                    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Sub-Agents     โ”‚  โ”‚     Memory System          โ”‚
โ”‚  mtAgent (async) โ”‚  โ”‚  FileMemory (md files)     โ”‚
โ”‚  mpAgent (proc)  โ”‚  โ”‚  SessionMemory (per-task)  โ”‚
โ”‚  Nested (depth>1)โ”‚  โ”‚  Rolling Context           โ”‚
โ”‚  IPC + heartbeat โ”‚  โ”‚  SQLite persistence        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

23,000 lines of Python. No JavaScript. 6 native LLM providers.


March Deck โ€” PWA App Platform

Want a mobile-friendly UI? March Deck is a PWA platform that turns your agent into a collection of mini-apps you can open on any device.

App What it does
๐Ÿค– March Chat + agent runtime (sessions, cost, providers, logs)
๐Ÿ“ฐ Finviz Financial news with 24h AI summaries
๐Ÿ“„ ArXiv Research paper semantic search
๐Ÿ“Š System Server monitoring (CPU, RAM, GPU, services)
๐Ÿ“ Files File browser
๐Ÿ“ Notes Markdown notes
๐Ÿ“บ Cast Chromecast streaming
๐Ÿฆž OpenClaw OpenClaw agent management

No app store. Add to home screen and go. Works with any WebSocket-compatible agent.


Quick Start

# Install
pip install march-ai

# Or with extras
pip install "march-ai[anthropic]"     # Claude support
pip install "march-ai[bedrock]"       # AWS Bedrock
pip install "march-ai[matrix]"        # Matrix + E2EE
pip install "march-ai[browser]"       # Playwright browser tools
pip install "march-ai[voice]"         # Speech-to-text
pip install "march-ai[all]"           # Everything

# Run
march start                           # Start agent
march chat                            # Interactive terminal
march chat "summarize this repo"      # One-shot mode

Configuration

~/.march/config.yaml โ€” created on first run:

llm:
  default: "openai"
  providers:
    openai:
      model: "${MARCH_MODEL:gpt-4o}"
      api_key: "${OPENAI_API_KEY:}"

channels:
  terminal:
    enabled: true

memory:
  compaction:
    threshold: 0.95
    summary_budget_ratio: 0.15

Supports ${VAR:default} environment variable interpolation.


CLI

march start                  Start agent
march stop                   Stop all services
march restart                Restart
march enable / disable       Systemd service (auto-start on boot)

march chat                   Interactive terminal session
march chat "prompt"          One-shot mode
march status                 Health, version, model, plugins, channels
march log                    Follow log stream

march config show            Show config path
march agent list / show      Sub-agent management
march plugin list / enable   Plugin management

Built-in Tools

March ships with 24 tools out of the box:

Category Tools
Files read, write, edit, glob, diff, apply_patch
Code exec, process (background jobs)
Web web_search, web_fetch, browser (Playwright)
Memory session_memory (facts/plans/checkpoints)
Media screenshot, pdf, voice-to-text, tts
Integration github, huggingface, clipboard, translate
Agent sessions (sub-agent spawn/manage), message

All tools are registered via @tool decorator. Add custom tools by dropping a Python file in your plugin directory.


Comparison

March vs OpenClaw vs LangChain vs CrewAI

Feature March OpenClaw LangChain CrewAI
Rolling context compaction โœ… Structured 2-step Basic โŒ โŒ
Session memory (survives compaction) โœ… facts/plans/checkpoints โŒ โŒ โŒ
Process-isolated sub-agents โœ… mpAgent โŒ In-process โŒ โŒ
Selective memory (/rmb) โœ… โŒ โŒ โŒ
Native LLM providers โœ… 6 providers 1 (via LiteLLM proxy) Via wrappers Via wrappers
Multi-channel 4 (Matrix, Terminal, WS, ACP) 10+ (Telegram, WhatsApp, Discord, Signalโ€ฆ) โŒ โŒ
Plugin hooks โœ… Lifecycle hooks Skill-based Via callbacks โŒ
Cost tracking โœ… Built-in per-turn Via LiteLLM โŒ โŒ
Browser automation โœ… Playwright (headless) โœ… Playwright (multi-tab, profiles) โŒ โŒ
Mobile device integration โŒ โœ… Node pairing โŒ โŒ
Community ecosystem New โœ… Active + ClawHub โœ… Large Growing
Codebase ~23K lines Python ~145K lines TypeScript ~300K+ ~50K+

Where March wins

  • Memory that doesn't degrade โ€” Rolling context + session memory means your agent remembers decisions from turn 3 at turn 100. OpenClaw and LangChain lose this during compaction.
  • Fault isolation โ€” mpAgent sub-agents run in separate OS processes. A crash stays contained. Every other framework runs sub-agents in-process.
  • No proxy dependency โ€” March talks directly to Bedrock, Anthropic, OpenAI, Ollama, OpenRouter. OpenClaw requires a LiteLLM proxy for all LLM calls.
  • Auditable โ€” 23K lines. You can read the entire codebase in an afternoon.

Where OpenClaw wins

  • Channel breadth โ€” 10+ messaging platforms vs March's 4. If you need Telegram, WhatsApp, or Discord, OpenClaw has it.
  • Browser & device integration โ€” Multi-tab browser profiles, Chrome extension relay, mobile camera/location/notifications.
  • Maturity โ€” Production-tested with an active community and skill marketplace.

Supported LLM Providers

Provider Config key Notes
OpenAI openai GPT-4o, GPT-4, etc.
Anthropic anthropic Claude Opus, Sonnet, Haiku
AWS Bedrock bedrock Claude, Llama, Mistral via AWS
Ollama ollama Local models, no API key
OpenRouter openrouter Multi-provider gateway
LiteLLM litellm Universal proxy

Switch providers per-session or per-sub-agent. No code changes needed.


Development

git clone https://github.com/camopel/March.git
cd March
pip install -e ".[dev]"
pytest                        # 785 tests

Design Philosophy

  1. Memory is curation, not accumulation. The value of memory isn't how much you store โ€” it's how well you filter. March compresses, deduplicates, and preserves only what matters.

  2. Isolation prevents corruption. Sub-agents run in separate processes with their own memory. A rogue sub-agent can't pollute the parent's context or crash the main loop.

  3. Explicit beats implicit. /rmb lets you decide what's worth remembering. No black-box embeddings, no stale vector search results sneaking into your context.

  4. Small is fast. 23K lines means you can read the entire codebase in an afternoon. Every abstraction earns its place.


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

march_ai-0.2.0.tar.gz (294.8 kB view details)

Uploaded Source

Built Distribution

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

march_ai-0.2.0-py3-none-any.whl (250.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for march_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9f91e67e8b3aced28ddf01b4b397517b44d9c53c65e523aa96836d043e2cc861
MD5 c236a7902c8c842ed4e158a04768ca48
BLAKE2b-256 b27f202db87057b366162716a86e76f47bb29dbc7352191fd6b094e1a3939246

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for march_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b6852ff8af7e8b98cb80bdfeca966c28cc3b976a3112b7439fe5b72cfba283f
MD5 2d48c456d3ce397a14e2f633093e2843
BLAKE2b-256 f5a43dc706f42a6d2eaa69c577eb8cb4fdbbc5e5221a89c1e71485611515244d

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