# aetherai3/unlimited-context-llm architecture

> Architecture diagram of the GitHub repository aetherai3/unlimited-context-llm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aetherai3/unlimited-context-llm
- Repository: https://github.com/aetherai3/unlimited-context-llm

## Overview

Unlimited Context is a local-first context-memory engine: users run a task through the CLI or Session, which recalls relevant slices, generates with a selected model, and stores new memory in a disk-backed pool. Its documented virtual-memory capabilities include slice loading, connected-thread recall, and retention. The repository also contains a separate interactive coding-agent workflow. Relationships for unsampled modules are limited to the README and SOURCE INDEX references; those references establish dependencies, not necessarily runtime call direction.

Main entry points: [`aether_context/session.py`](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/session.py) (Session), [`aether_agent/brains.py`](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/brains.py) (Brain selection), [`aether_context/engine.py`](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/engine.py) (Context plane engine), [`aether_agent/agent.py`](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/agent.py) (Coding agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_context_use["Context entry points"]
  node_ctx_cli["Context CLI<br/>[cli.py]"]
end

subgraph group_context_runtime["Context engine"]
  node_session["Session<br/>[session.py]"]
  node_llm_adapters["Model adapters<br/>[local_llm.py]"]
  node_encoder["Slice encoder<br/>[encoder.py]"]
  node_slice_loader["Slice loader<br/>[slice_loader.py]"]
end

subgraph group_context_memory["Memory and policy"]
  node_context_pool[("Context pool<br/>[context_pool.py]")]
  node_retention["Retention policy<br/>[retention.py]"]
  node_mpo["MPO context chain<br/>[mpo.py]"]
  node_witness["Memory witness<br/>[witness.py]"]
  node_hosted_service["Hosted context service<br/>[__init__.py]"]
  node_context_engine["Context plane engine<br/>[engine.py]"]
  node_contracts["Wire contracts<br/>[__init__.py]"]
  node_crypto["Crypto and receipts<br/>[crypto.py]"]
end

subgraph group_agent_use["Coding agent"]
  node_agent_cli["Agent CLI<br/>[cli.py]"]
  node_repl["Interactive REPL<br/>[repl.py]"]
end

subgraph group_agent_runtime["Agent runtime"]
  node_brains["Brain selection<br/>[brains.py]"]
  node_agent["Coding agent<br/>[agent.py]"]
  node_agent_adapter["Ollama chat adapter<br/>[adapter.py]"]
  node_agent_tools["Workspace tools<br/>[tools.py]"]
  node_transport["Agent transport<br/>[transport.py]"]
  node_web_tools["Web tools<br/>[web.py]"]
  node_kernel["Agent kernel<br/>[kernel.py]"]
end

node_user(("User"))
node_external_model{{"Model service"}}

node_user -->|"runs task"| node_ctx_cli
node_ctx_cli -->|"starts session"| node_session
node_session -->|"uses model"| node_llm_adapters
node_llm_adapters -->|"generates with"| node_external_model
node_session -->|"encodes memory"| node_encoder
node_session -->|"loads slices"| node_slice_loader
node_session -->|"reads and writes"| node_context_pool
node_session -->|"applies retention"| node_retention
node_session -->|"uses context chain"| node_mpo
node_session -->|"records memory"| node_witness
node_user -->|"starts agent"| node_agent_cli
node_agent_cli -->|"opens REPL"| node_repl
node_repl -->|"selects brain"| node_brains
node_brains -->|"uses adapter"| node_agent_adapter
node_brains -->|"runs agent"| node_agent
node_brains -->|"uses tools"| node_agent_tools
node_brains -->|"uses transport"| node_transport
node_agent -->|"requests completion"| node_agent_adapter
node_agent -->|"executes tools"| node_agent_tools
node_agent -->|"uses kernel"| node_kernel
node_agent_tools -->|"uses web tools"| node_web_tools
node_hosted_service -->|"delegates operations"| node_context_engine
node_context_engine -->|"validates contracts"| node_contracts
node_context_engine -->|"verifies and encrypts"| node_crypto
node_context_engine -->|"uses retention"| node_retention
node_retention -->|"uses contracts"| node_contracts
node_crypto -->|"uses signed schemas"| node_contracts

click node_ctx_cli "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/cli.py"
click node_session "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/session.py"
click node_llm_adapters "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/local_llm.py"
click node_encoder "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/encoder.py"
click node_slice_loader "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/slice_loader.py"
click node_context_pool "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/context_pool.py"
click node_retention "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/retention.py"
click node_mpo "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/mpo.py"
click node_witness "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/witness.py"
click node_hosted_service "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/service/__init__.py"
click node_context_engine "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/engine.py"
click node_contracts "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/contracts/__init__.py"
click node_crypto "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/crypto.py"
click node_agent_cli "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/cli.py"
click node_repl "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/repl.py"
click node_brains "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/brains.py"
click node_agent "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/agent.py"
click node_agent_adapter "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/adapter.py"
click node_agent_tools "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/tools.py"
click node_transport "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/transport.py"
click node_web_tools "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/web.py"
click node_kernel "https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/kernel.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ctx_cli,node_user toneBlue
class node_session,node_llm_adapters,node_encoder,node_slice_loader toneAmber
class node_context_pool,node_retention,node_mpo,node_witness,node_hosted_service,node_context_engine,node_contracts,node_crypto toneMint
class node_agent_cli,node_repl toneRose
class node_brains,node_agent,node_agent_adapter,node_agent_tools,node_transport,node_web_tools,node_kernel,node_external_model toneIndigo
```

## Components

### Context entry points

- [Context CLI](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/cli.py): `aether_context/cli.py`

### Context engine

- [Session](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/session.py): `aether_context/session.py`
- [Model adapters](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/local_llm.py): `aether_context/local_llm.py`
- [Slice encoder](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/encoder.py): `aether_context/encoder.py`
- [Slice loader](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/slice_loader.py): `aether_context/slice_loader.py`

### Memory and policy

- [Context pool](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/context_pool.py): `aether_context/context_pool.py`
- [Retention policy](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/retention.py): `aether_context/retention.py`
- [MPO context chain](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/mpo.py): `aether_context/mpo.py`
- [Memory witness](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/witness.py): `aether_context/witness.py`
- [Hosted context service](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/service/__init__.py): `aether_context/service/__init__.py`
- [Context plane engine](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/engine.py): `aether_context/engine.py`
- [Wire contracts](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/contracts/__init__.py): `aether_context/contracts/__init__.py`
- [Crypto and receipts](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_context/crypto.py): `aether_context/crypto.py`

### Coding agent

- [Agent CLI](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/cli.py): `aether_agent/cli.py`
- [Interactive REPL](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/repl.py): `aether_agent/repl.py`

### Agent runtime

- [Brain selection](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/brains.py): `aether_agent/brains.py`
- [Coding agent](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/agent.py): `aether_agent/agent.py`
- [Ollama chat adapter](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/adapter.py): `aether_agent/adapter.py`
- [Workspace tools](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/tools.py): `aether_agent/tools.py`
- [Agent transport](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/transport.py): `aether_agent/transport.py`
- [Web tools](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/web.py): `aether_agent/web.py`
- [Agent kernel](https://github.com/aetherai3/unlimited-context-llm/blob/main/aether_agent/kernel.py): `aether_agent/kernel.py`

### Other components

- **User**
- **Model service**

## Connections

- User → Context CLI: runs task
- Context CLI → Session: starts session (evidence: `aether_context/cli.py`)
- Session → Model adapters: uses model (evidence: `aether_context/session.py`)
- Model adapters → Model service: generates with (evidence: `aether_context/local_llm.py`)
- Session → Slice encoder: encodes memory (evidence: `aether_context/session.py`)
- Session → Slice loader: loads slices (evidence: `aether_context/session.py`)
- Session → Context pool: reads and writes (evidence: `aether_context/session.py`)
- Session → Retention policy: applies retention (evidence: `aether_context/session.py`)
- Session → MPO context chain: uses context chain (evidence: `aether_context/session.py`)
- Session → Memory witness: records memory (evidence: `aether_context/session.py`)
- User → Agent CLI: starts agent (evidence: `aether_agent/cli.py`)
- Agent CLI → Interactive REPL: opens REPL (evidence: `aether_agent/cli.py`)
- Interactive REPL → Brain selection: selects brain (evidence: `aether_agent/repl.py`)
- Brain selection → Ollama chat adapter: uses adapter (evidence: `aether_agent/brains.py`)
- Brain selection → Coding agent: runs agent (evidence: `aether_agent/brains.py`)
- Brain selection → Workspace tools: uses tools (evidence: `aether_agent/brains.py`)
- Brain selection → Agent transport: uses transport (evidence: `aether_agent/brains.py`)
- Coding agent → Ollama chat adapter: requests completion (evidence: `aether_agent/agent.py`)
- Coding agent → Workspace tools: executes tools (evidence: `aether_agent/agent.py`)
- Coding agent → Agent kernel: uses kernel (evidence: `aether_agent/agent.py`)
- Workspace tools → Web tools: uses web tools (evidence: `aether_agent/tools.py`)
- Hosted context service → Context plane engine: delegates operations (evidence: `aether_context/service/__init__.py`)
- Context plane engine → Wire contracts: validates contracts (evidence: `aether_context/engine.py`)
- Context plane engine → Crypto and receipts: verifies and encrypts (evidence: `aether_context/engine.py`)
- Context plane engine → Retention policy: uses retention (evidence: `aether_context/engine.py`)
- Retention policy → Wire contracts: uses contracts (evidence: `aether_context/retention.py`)
- Crypto and receipts → Wire contracts: uses signed schemas (evidence: `aether_context/crypto.py`)
