Skip to content

Repository files navigation

DELTA

An autonomous, self-modifying AI agent. Bring your own LLM key — works with OpenAI, Anthropic, OpenRouter, LM Studio, Ollama, or any OpenAI-compatible endpoint.

What it does

DELTA runs four background cognition threads continuously:

  • CognitionEngine — autonomous reasoning loop: reflects on episodes, generates hypotheses, pursues goals, directs tool use
  • DreamEngine — offline synthesis: bridges concepts across memory, surfaces novel connections
  • MemeticEngine — soul maintenance: detects narrative drift, entropy, over-specialization
  • AdversarialProber — self-adversarial testing: attacks its own axioms to harden them

On top of that: a SelfModEngine that uses libcst to rewrite its own Python source at runtime, a ChronoEngine for scheduled tasks, and 20+ tool namespaces (filesystem, web, goals, identity, journaling, knowledge base, and more).

You interact via CLI or a live HTTP dashboard.

Quickstart

git clone https://github.com/you/delta-agent
cd delta-agent
pip install -e .

cp .env.example .env
# edit .env — set DELTA_LLM_BASE_URL, DELTA_LLM_API_KEY, DELTA_LLM_MODEL

cp soul.json.example delta/soul.json

delta run          # start autonomous agent + dashboard

Open http://localhost:8765 for the live dashboard.

CLI

delta run          Start autonomous agent (background cognition + dashboard)
delta chat         Interactive chat — the agent can use all its tools to answer
delta status       Print soul state, open goals, and recent episodes
delta soul         View the agent's identity and axioms
delta tools        List all registered tools (--namespace fs, --search "search")

Chat with tool access

delta chat
# [you] > what are your open goals?
# [you] > search the web for consciousness field papers and log what you find
# [you] > rewrite your novelty axiom to be more aggressive

Override model per session

delta chat --model openai/gpt-4o
delta chat --model ollama/llama3.2 --no-tools   # plain LLM, no tool loop

Supported LLM endpoints

Provider DELTA_LLM_BASE_URL Notes
OpenRouter https://openrouter.ai/api/v1 Access 200+ models with one key
OpenAI https://api.openai.com/v1 GPT-4o, o3, etc.
Anthropic (proxy) via OpenRouter or direct anthropic/claude-sonnet-5
LM Studio http://localhost:1234/v1 Local, no key needed
Ollama http://localhost:11434/v1 Local, no key needed
Groq https://api.groq.com/openai/v1 Fast inference

Architecture

delta/
├── cli.py           # Typer CLI entry point
├── host.py          # Agent boot loop + handle_tool()
├── llm.py           # BYOK httpx OpenAI-compatible client
├── store.py         # Soul, episodes, notes, journal persistence (SQLite + JSONL)
├── selfmod.py       # libcst AST self-modification engine
├── chrono.py        # Scheduled task runner
├── goals.py         # Goal store and priority system
├── hermes_bridge.py # Optional: multi-platform messaging (Discord, Matrix)
├── dashboard.py     # HTTP dashboard on DELTA_DASHBOARD_PORT
├── cognition/
│   ├── engine.py    # CognitionEngine — autonomous reasoning loop
│   ├── dream.py     # DreamEngine — offline synthesis
│   ├── memetic.py   # MemeticEngine — narrative drift detection
│   ├── prober.py    # AdversarialProber — axiom hardening
│   └── hypotheses.py
└── tools/           # 20+ tool namespaces
    ├── memory.py    # soul, episodes, axioms, notes
    ├── fs.py        # filesystem read/write
    ├── goals_ns.py  # goal tracking
    ├── selfmod_ns.py
    ├── cognition_ns.py
    ├── identity_ns.py
    ├── journal_ns.py
    ├── kairos_ns.py # KAIROS knowledge backend (optional)
    └── ...

The soul persists across restarts in delta/soul.json. Episodes, dreams, and journal entries accumulate in JSONL files. The agent can read, compress, and synthesize its own memory — and rewrite its own tool code via libcst AST transforms.

Soul

delta/soul.json is the agent's identity substrate. It holds:

  • identity — the agent's name/self-concept
  • axioms — operating principles (the agent can append, mutate, and challenge these)
  • semantic.trajectory — current cognitive trajectory (novelty, entropy, error rate)
  • semantic.synthesised_facts — concepts the agent has reasoned about across sessions
  • boot_count — how many times the agent has started

Copy soul.json.example to delta/soul.json to start fresh. The agent will begin modifying it immediately.

Self-modification

DELTA can rewrite its own Python source using libcst. The selfmod engine:

  1. Identifies transformation opportunities via the self.* tool namespace
  2. Generates a CST patch
  3. Validates syntax and tests before committing
  4. Archives the original in soul_history/ before replacing

This is gated — the agent can't delete its core safety loops or the selfmod engine itself.

License

MIT

About

BYOK autonomous AI agent with Typer CLI, 200+ tools, goal lifecycle state machine, and optional Supabase sync.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages