The

Aegis

Experience

TAKE FULL CONTROL OF YOUR AGENTS

Never Suffer From Agent Amnesia Again

Close your terminal, reboot, come back tomorrow. Normal AI agents forget everything. They burn minutes re-reading old logs, hit rate limits, and freeze up right when you need them.

AegisBrain keeps a permanent notebook. Say “pick up where I left off” and it pulls your exact rules, past fixes, and project decisions in under 25ms. No re-reading. No wasted tokens.

✳ claude•~/vault/aegis-brain
╭─────────────────────────────────────────────────────────────────╮
│ Claude Code research preview (v0.2.29) │
│ Welcome to Claude Code! │
│ Connected to AegisBrain Persistence Engine (SQLite WAL FTS5) │
╰─────────────────────────────────────────────────────────────────╯
>Continue working on the authentication middleware we started yesterday.
● Querying AegisBrain neural index (brain.db)...
● Retrieved 4 auth symbols & invariants in 21ms (FTS5 BM25 match)
● Injected 380 tokens into active context (-99.3% token footprint savings)
[200 OK] INSTANT CONTEXT RESTORED (21MS)

Claude: “Context restored from snapshot #042 in 21ms. Continuing authentication middleware: all 286/286 pytest invariants passing. Ready to edit.”

Cost: $0.001•Tokens: 380•Latency: 21ms
esc to cancel • /help for commands
HOST HEADROOM: 19.8 MB VS 1.35 GB

Aegis runs directly in SQLite WAL mode. Your RAM overhead stays negligible, eliminating CPU throttling and host machine freezes.

ZERO SESSION BOUNDARY CRASHES

When terminal sessions terminate, restore points guarantee 100% context survival on your next prompt.

Real-Time Memory Retrieval Trace (516x Faster FTS5 Indexing)

Slash Your AI API Bill by 92%

Why pay $20 per million tokens for boilerplate? The expensive model thinks. Free local models on your machine do the typing. You keep the savings.

Active Tier 3 Local Worker Invocations100% Free Hardware Tokens
hermes chat
21 ms
aegis recall
18 ms
scan_ast_taint
4 ms
TRI-TIER ARCHITECTURE SPECIFICATION

Tri-Tier Token Arbitrage Flow

Hover over any tier layer to inspect the division of labor and real-time laser signal paths.

92.4% Token Cost Reduction
TIER 1BRAIN ONLY

Senior Boss (Strategic Brain)

System Architecture & High Cognition Review
Engine Models:
Gemini 4 / Claude Opus / Fable
Premium Frontier Tokens (Minimal Calls)
Invariants:
Zero direct boilerplate / implementation writing
Defines mathematical invariants & test criteria
Performs AST diff audit and final sign-off
Active ChannelSub-25ms Latency
TIER 2ORCHESTRATOR

Junior Bosses (Domain Subagents)

QA, Backend, Security & Frontend Leads
Engine Models:
Gemini Flash / Claude Sonnet / Subagents
Balanced Tokens (Task Orchestration)
Invariants:
Formats strict prompt contracts for Tier 3 workers
Executes 4-Stage Quality Gate on raw worker output
Coaches workers in continuous error-reduction loops
Active ChannelSub-25ms Latency
TIER 3100% FREE

Execution Workers (Local Muscle)

Fast Implementation & Boilerplate Generation
Engine Models:
Hermes CLI / Ollama Qwen2.5-Coder / OpenCode
$0.00 (100% Free Local Hardware Tokens)
Invariants:
Writes 100% of candidate code drafts & test suites
Runs locally on host hardware with 0 API tokens
Iterates until all AST and pytest gates pass 100%
Active ChannelSub-25ms Latency
>>DETERMINISTIC INVARIANT: Tier 1 & Tier 2 NEVER burn frontier tokens on implementation boilerplate.
ZERO FRONTIER TOKEN WASTE
TOKEN ARBITRAGE CALCULATOR

Dynamic Token Arbitrage Calculator

Offload 92% of verbose boilerplate to free local workers. Reserve precious frontier cognition exclusively for architecture.

92%
Frontier Cost Reduction
250 turns / day
50 (Solo Dev)250 (Active Engineer)500 (Pair Team)1,000 (Org Swarm)
Active Tier 3 Execution Worker
Token Workload Distribution92% Free Local • 8% Frontier
Tier 3 Free Local Workers Tier 1 Frontier Cognition
Monthly Spend Comparison30-Day Billing Cycle
Traditional (100% Frontier API)$960 / mo
Burning expensive tokens on repetitive boilerplate & raw JSON logs.
AegisBrain 3-Tier Arbitrage$77 / mo
92% generated by free local workers. Only architecture calls frontier APIs.
Total Realized Savings
+$883 / month
Annual Value
+$10,596 / yr

Runs All Night Without Crashing

Leave an AI agent running overnight and wake up to a frozen terminal. AegisBrain fixes that. A silent Windows Scheduled Task checks every 5 minutes and restarts your agent after sleep, reboot, or crash.

Traditional Agent Vulnerability
  • ✕Silent Sleep Freeze: Windows Standby terminates webhook connections and drops long-running tasks.
  • ✕Account Switch Termination: Closing an Antigravity or VSCode window terminates running background jobs.
  • ✕Telegram Bridge Death: Remote polling listeners die unceremoniously with no auto-resurrection.
Aegis 24/7 KeepAlive Shield
  • ✓Win32 Scheduled Task: AegisBrainDaemonKeepAlive triggers every 5 min to ensure daemon (:8765) is running.
  • ✓Self-Healing Watchdog: Reconnects Telegram listener, drains asynchronous inboxes, and holds WAL database lock.
  • ✓Zero Disruption: Persistence across reboots, account switches, and terminal terminations.
Verified Test Suite Parity
All keepalive, remote polling, token guard, and AST security modules verified
286/286 PYTEST TESTS PASSING • 100% CLEAN

Control Your Agent From Your Phone

Walk away from your desk and still run the show. Send voice notes, check code diffs, and get pinged the second tests pass, all through Telegram on your phone.

Sovereign Mobile Telemetry

THE SAINT SPEAKS FROM ANY DEVICE. 45-SECOND RAW AUDIO NOTES ARE INSTANTLY SLICED INTO DETERMINISTIC 25-SECOND CHUNKS, PREVENTING WHISPER HALLUCINATIONS AND INJECTING CODE DIRECTLY IN-FLIGHT.
Daemon Runtime:Win32 Task Scheduler (:8765)
Whisper Latency:480ms (Local C++ binary)
Audio Drop Rate:0.0% (Deterministic Shield)
9:41
5G
AegisBrain Bot✓
bot
Today
/briefing
10:41 AM
⚡ AegisBrain 24/7 Briefing: • Snapshot #042 active (WAL clean) • HackerNews #1: Local MoE token arbitrage • Open PR: 0 defects, 286/286 unit tests passing • Priority: Ready for voice or terminal directives.
10:41 AM
Message

Catch Bad Code Before It Hits Git

Free local models write fast but they cut corners. Four filters run on every output: strip the filler text, block security holes, sandbox the tests, and loop until zero bugs remain.

INSPECTION SPECIFICATION

The Four Quality Architecture Gates

Four automated safety filters catch bad code, strip AI apologies, and test every line in an isolated sandbox before touching your git tree.

4 INSPECTION GATES
Continuous Enforcement

Karpathy Simplicity Doctrine

Every single changed line must directly trace to what you asked. For small edits under 15 lines, changes happen surgically with zero heavy tool overhead. No premature factories, no single-use abstractions, and no speculative flexibility.

Core Invariants Guaranteed:
No abstractions for single-use functions
No speculative flexibility or unused configurability
Surgical edits: never refactor adjacent working code
Fast-path execution: avoid heavy CLI overhead for tiny fixes
Before & After Inspection:
REJECTED DRAFTViolates Gate 01
// ❌ Rejected (Over-engineered wrapper)
class AbstractConnectionPoolManagerFactorySingleton {
  constructor(config: GenericProviderInterface) { ... }
}
APPROVED PRODUCTION CODEVerified
// ✓ Approved (Karpathy Simplicity)
export function connectDb(url: string) {
  return new Database(url);
}

The 7 Core System Blueprints

See how AegisBrain wires your terminal, memory database, local models, and phone notifications into one system that actually works.

SYSTEM ARCHITECTURE SPECIFICATION

The 7 Core System Blueprints

Real architectural pipelines detailing how memory, multi-agent orchestration, and production safety gates work together.

7 BLUEPRINTS
Interactive Pipelines

Master Architecture

How Everything Connects
Autonomous Architecture Standard
// The Developer Pain Point

Without a system, coding agents randomly guess, forget decisions, burn through expensive API tokens, and break your repository.

How AegisBrain Solves It

AegisBrain connects your tools into one seamless engine. A senior brain designs the plan, free local models write the heavy code, safety gates test every line, and persistent memory remembers everything tomorrow.

Interactive Execution Pipeline (Click Any Node to Inspect Step)
ACTIVE STAGE 01:Developer PromptINPUT

You ask for a feature in your terminal or via Telegram voice note.

Latency: 0 ms
Core Invariants Guaranteed:
Zero token waste: expensive frontier models never write repetitive boilerplate
Zero amnesia: past decisions and project patterns persist across sessions
Zero blind commits: all code is sandboxed and unit-tested before git commit
Immortal background daemon: self-healing service keeps working while you sleep
Runtime Protocol & Wire Verification:
DEVELOPER WORKFLOW TRACETerminal Event Log
$ aegis dev "Add OAuth2 refresh token rotation"
[T1-BRAIN] Formulated 4 mathematical invariants & test suite
[T2-AGENT] Dispatched boilerplate contract to local worker
[T3-LOCAL] Hermes-3 generated 124 lines of candidate code ($0.00)
[GATE-01] Karpathy simplicity check: PASSED (surgical diff)
[GATE-02] Slop scrubber: Removed AI preambles & apologies
[GATE-03] AST security scan: Zero shell injections or leaks
[GATE-04] Sandboxed pytest: 286/286 passed in 1.4s
[RESULT] Clean commit verified. 0 frontier tokens wasted.
SYSTEM TOPOLOGY SPECIFICATIONConfig Schema
system_topology:
  orchestrator:
    tier1_brain: "Claude-Opus / Gemini-Pro" (Reasoning only)
    tier2_leads: ["backend", "frontend", "security", "qa"]
    tier3_workers: ["hermes-cli", "ollama-qwen2.5", "opencode"]
  storage:
    neural_bus: "brain.db (SQLite WAL mode + FTS5)"
    snapshot_limit: 400 # tokens per bootstrap
  watchdog:
    daemon_port: 8765
    keepalive_interval: "5m (Win32 Scheduled Task)"
Measured Runtime Telemetry:
End-to-End Speed
1.8s
Turnaround Time
API Cost Saved
95.8%
Free Local Muscle
Memory Latency
24ms
FTS5 Indexed Search
Test Reliability
286/286
Automated Suite

Install in Seconds

One command. Pick your OS, paste it, done. The background daemon and CLI are ready to go.

QUICKSTART & INSTALLATION

Install in Seconds

Deploy the 24/7 background daemon and global CLI with a single command across macOS, Linux, or Windows.

V2.4.0
Stable Release
$curl -sSL https://raw.githubusercontent.com/PG300604/aegis-brain/main/install.sh | bash

Build With AegisBrain

AegisBrain is free and open-source under GPL-3.0. Star the repo, file issues, send PRs.

Star the RepositoryGitHub

More stars means more developers find out about it. Takes two seconds.

Clone RepositoryLocal Setup

Get the source code and start hacking immediately.

git clone https://github.com/PG300604/aegis-brain.git
Issues & DiscussionsCommunity

Request a chassis adapter, report an edge case, or propose an invariant.

Contribute CodePull Requests

Submit PRs for new local worker bridges, IDE shims, or benchmark tests.