IAF v1.0 — Four-Layer Architecture Complete

What changed since v0.9

v0.9 shipped the Agent Layer and UI Layer. Dispatch and Scheduler were architecture-only. v1.0 completes the entire four-layer stack:


Four-Layer Architecture

The framework now consists of four fully independent layers. Units within each layer are also isolated from each other. The four layers communicate through Flask APIs and the filesystem — no layer invades another.

LayerWhat It DoesUnit GranularitySelf-Containment
AgentComplete runtime for a single intelligent agentOne folder = one agentCopy the folder to deploy
DispatchMulti-agent collaboration orchestrationOne folder = one collaboration strategyCopy the folder to deploy
TubeSignal topology — wiring between building blocksOne JSON entry = one signal pathwayEdit JSON to activate
UIHuman-machine interaction interfacesOne HTML file = one feature pageDrop the file to use

Agent Layer

The core of IAF: the Fundamental Loop. Each agent is a self-contained runtime (~267 lines of engine code):

Five-Layer Message Assembly

LayerSourceWhen LoadedPurpose
1All files in context_filesEvery callAgent's identity, knowledge, routing
2Skill .md files matched by triggerOn keyword matchScenario-specific task instructions
3history.jsonlChat mode onlyConversation memory
4Current user messageEvery callThis turn's input
5Trim passEvery callEnsure context fits the window

Agent Toolset

FileToolsCapabilityDefault
file_tools.pyread_file, write_file, list_dirRead/write files, list directoriesYes
shell_tools.pyrun_shellExecute terminal commandsNo
tube_tools.pytrigger_tube, list_tubes, tube_logTrigger tubes, check status, read logsNo
dispatch_tools.pyrun_dispatch, list_dispatch_strategiesInitiate multi-agent collaborationNo

Drop a tool file into agents/xxx/tools/ — auto-discovered, zero code changes.


Dispatch Layer

The Dispatch Layer implements multi-agent collaboration. It calls lib/llm_client.call_llm() directly — it does not go through the Agent engine. Agent folders are treated as "asset libraries + model config", not as executors.

Analogy: Agents are actors, Dispatch is the director. The director has actors read their own persona (SOUL.md) but can also hand them an entirely new script. The performance records on set belong to the director (sessions/), not the actor's personal diary (history.jsonl).

Dispatch Folder Structure

FileRole
dispatch.pyOrchestration logic: round control, agent call order, termination conditions
dispatch_base.pyInfrastructure: tool loop, LLM parsing, staging
context_injector.pyContext assembly: reads agent files per config
session_manager.pySession CRUD
dispatch_config.jsonParticipating agents, context_files, round limits
rules/*.mdAgent role definitions within the collaboration
sessions/Complete records of collaboration processes
*.html(Optional) Dedicated UI page

Three-Layer Context Isolation

Context TypeOwned ByStorage LocationPurpose
Agent chat historyAgentagents/xxx/history.jsonlUser-agent interaction memory
Dispatch collaborationDispatchdispatch/xxx/sessions/*.jsonlMulti-agent collaboration process
Per-call contextcontext_injectorIn memory (not persisted)Assembly result for a single LLM call

Agents are unaware they participated in a Dispatch. Dispatch never touches an agent's history.jsonl. Isolation is an architectural guarantee.


Tube Layer

Tube is the framework's third dimension — the signal topology layer. It describes signal pathways between building blocks: when a condition is met, trigger a target to execute.

Same three agents plus two dispatches — different Tube configurations produce entirely different system behaviour: serial pipelines, parallel fan-out, feedback loops. The blocks haven't changed; the wiring has, and so the system behaves completely differently.

Tube Anatomy

ElementDescription
TriggersWhat condition activates it (pluggable: cron, manual, API, file watch, etc.)
StepsWhat to do sequentially after activation (Agent, Dispatch, another Tube)
PayloadData passed from trigger source to target (prompt, file path, upstream output)

tubes.json Example

[
  {
    "id": "doc_analysis_pipeline",
    "enabled": true,
    "triggers": [
      { "type": "cron", "config": { "expr": "30 9 * * *" } },
      { "type": "manual" }
    ],
    "steps": [
      { "type": "agent", "id": "doc_processor", "mode": "batch",
        "payload": { "prompt": "Process and analyse documents" } },
      { "type": "dispatch", "id": "roundtable",
        "payload": { "message": "Brainstorm based on analysis results" } },
      { "type": "tube", "id": "send_report" }
    ]
  }
]

Execution Model

Tube API Endpoints

MethodPathFunction
GET/api/tubesList all tubes + real-time status
GET/api/tube/statusLightweight status query
POST/api/tube/triggerManual trigger
GET/api/tube/logQuery logs (supports filtering)
GET/api/tube/log/groupedLogs grouped by tube
DELETE/api/tube/logClear logs

UI Layer

A browser-based interface following the yellow-pages architecture. Every HTML page is fully self-contained. Zero coupling between pages. No unified SPA shell, no shared router.

TypeLocationRoute
Yellow pagesindex.htmlGET /
Basic chatchat.htmlGET /chat
User pagespages/*.htmlGET /pages/<name>
Dispatch UIdispatch/xxx/*.htmlGET /dispatch/<name>
Tube dashboardpages/tube-dashboard.htmlGET /pages/tube-dashboard

The Tube Dashboard provides: tube list with live status, manual trigger buttons, expandable config details and step payloads, real-time scrolling execution logs, and per-tube log clearing. Auto-polls every 10 seconds.


AI Operability

IAF is not just "an AI framework for humans" — it is an AI framework that AI can also operate. A top-tier AI agent taking over a framework must pass four gates:

GateIAFTraditional Frameworks
Understand~2000 lines, fits in one context window10,000+ lines, requires modular comprehension
ModifyEdit JSON and Markdown filesWrite Python/SDK code conforming to framework constraints
Deploypython3 chat_server.py — one commanddocker compose / kubernetes
Monitorcat tube_log.jsonl — plain textDedicated dashboards / monitoring APIs

Four Orthogonal Extension Dimensions

OperationHowCode Changes
Add new agentcp -r template/ agents/xxx/0 lines
Add tool to agentDrop .py in agents/xxx/tools/0 lines
Add knowledgeAdd .md file, update context_files0 lines
Add skillDrop .md in agents/xxx/skills/0 lines
Change trimmingSwap .py in agents/xxx/context/0 lines
Add collaborationAdd folder in dispatch/0 lines
Add signal pathwayAdd entry in tube/tubes.json0 lines
Add trigger typeDrop .py in tube/triggers/0 lines
Add drive targetDrop .py in tube/targets/0 lines
Add LLM providerAdd entry in config.json0 lines
Add UI pageDrop .html in pages/0 lines

Status Summary


Tech Stack

Pure Python + HTML. No Node.js, no npm, no frontend build tools.

pip install flask requests croniter — that is the entire dependency list.


Get the Code

# Clone the repo
git clone https://github.com/IntelligenismCommercialDevelopment-LLC/intelligenism-agent-framework.git
cd intelligenism-agent-framework

# Set up virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install flask requests croniter

# Configure your LLM provider in config.json

# Start the server
python3 chat_server.py

# Open http://localhost:5000

Links