Projects / Infrastructure / ContextAA
Infrastructure · AMI-Lab

ContextAA

Context-Driven Autonomous Agent Architecture

A distributed multi-agent platform for the open intelligent space — where autonomous agents migrate across nodes, coordinate through Context, and remain operational even in the face of network instability, resource constraints, and device mobility.

Distributed Multi-Agent Context-Driven Agent Migration 17 000+ lines · C++17 IoT · Smart Home · Smart City
See AmI-DEU on ContextAA ↗
Platform Snapshot
TrackInfrastructure
Core abstractionContext
Primary languageC++17 (portable)
Codebase17 000+ lines · 275+ files
3rd-party libsNone
Memory (full host)< 1 MB RAM
Validated inSmart Home · Smart City
01 / What ContextAA Solves

Smart environments are distributed, mobile, and resource-constrained.
ContextAA is designed for exactly that.

Traditional middleware assumes stable networks, fixed nodes, and developers who manage concurrency. In the open intelligent space — where devices are heterogeneous, connectivity is intermittent, and expertise is domain-specific — those assumptions fail. ContextAA replaces them with a context-driven, agent-based architecture where the Context is both the data model and the programming interface.

"L'architecture, c'est une tournure d'esprit et non un métier. ContextAA extends this idea to software: an architectural mindset for intelligent spaces, where Context guides everything — deployment, coordination, and cognition."

— Le Corbusier / Lettre · adapted for ContextAA · AMI-Lab · Université de Sherbrooke
🧩 Context as the Universal Interface

Every piece of information — sensor readings, agent state, queries, responses — is represented as Context. One abstraction to rule them all.

📡 Designed for Mobility

Agents can migrate from Host to Host as resources shift, carrying their contextual state with them. Continuity of service is a first-class design goal.

🔒 Concurrency — Abstracted Away

Domain agents never manage threads or locks. Isolation from network and concurrency concerns lets domain experts reason about logic alone.

Ultralight Footprint

A fully loaded Host with all standard agents and a dozen domain agents consumes under 1 MB of RAM — less than a "Hello World" in most modern runtimes.


02 / Core Architecture

Four Building Blocks of ContextAA

ContextAA's distributed architecture is built from four principal elements that together handle deployment, execution, communication, and context management across fixed and mobile nodes in an open network.

EXECUTION CYCLE — HOST · AGENT MANAGER · AGENTS

INIT 01 🏗️ Load Standard Agents Core services bootstrapped before domain agents
INIT 02 📦 Load Domain Agents Application logic deployed from Context or binary
RUNTIME 🔄 Normal Operation Cycle Each agent: Consume → Act → Publish, in sequence
ASYNC 🛰️ Autonomous Objects Communicator, Discoverer, Emitter, Receiver run in parallel
TEARDOWN 💾 Persist & Suspend Agents contextified and serialized for migration or restart
ELEMENT 01 Host (Hôte)

A process deployed on a node — fixed or mobile. The Host acts as deployment unit, agent container, agent lifecycle manager, and isolation layer between agents, the network, and concurrency. Comparable to an OSGi Bundle, but fully context-guided.

ELEMENT 02 Agents

Two categories: Standard Agents (privileged, platform-specific, manage host services) and Domain Agents (contextified, portable, express mission logic). All share the same lifecycle interface. Domain agents are strictly isolated from concurrency and network concerns.

ELEMENT 03 Autonomous Objects

Concurrent satellites of a Host that handle blocking or asynchronous operations: the Communicator, Discoverers (network topology), Emitters (outbound context), and Receivers (inbound context). They interact with agents exclusively through Context Channels.

ELEMENT 04 Context & Context Channels

Context is the fundamental data unit — a self-describing, named, hierarchical structure. Context Channels are synchronized, unidirectional links between autonomous objects and standard agents, ensuring non-blocking, race-free data exchange at the periphery of the Host.

ELEMENT 05 Contextual Spaces

Each agent a has a contextual space Sa; each Host h has Sh ⊃ ∪Sa. Domain agents interact only with their own Sa. Standard agents may access Sh. This layering provides both isolation (domain-level privacy) and coordination (host-level sharing).

ELEMENT 06 Network Neighborhood Nh

Each Host maintains Nh — a contextified description of neighboring Hosts. Discoverers update Nh asynchronously; agents operate on this near-current snapshot, enabling robust operation without requiring global consistency or synchronized clocks.


03 / The Context Language

Context Is Both Data and Program

In ContextAA, Context is not merely a data format — it is the programming interface. Queries, responses, agent behavior, and transformations are all expressed as Context. This "contextification" enables agents to be fully serializable, migratable, and reasoned about without any language-specific runtime.

Hierarchical Tree Pattern Matching Context Criteria Transformations XML / JSON Bridge

Context matching operates at three levels: name equivalence (fast, surface-level equality), model matching (pattern-based with criteria and transformations), and equivalence providers (semantic bridging for vocabulary or unit-of-measure differences). Together they enable agents to find and consume Context even when vocabularies diverge.

Access qualification — public, local, private — governs the scope of each published Context: world-visible, Host-visible, or agent-only. Standard agents enforce this scoping during query resolution.

ContextAA — Agent Contextual Space (Sa) · Example
// Agent "abcd" — contextual space S_a (tree + textual representation) abcd { public { 388 { query:388 { // outbound context request local { ** { celsius } // wildcard: any path leading to "celsius" } } } } local { agent-info { id { abcd } name { "tiny agent" } } } } // Pattern query — retrieve full subtree of agent "abcd", local branch only: abcd { local } // Compose operation — check if local branch contains text "tiny agent": compose { #1{abcd{local}} #2{has{**{"tiny agent"}}} } // → [true] // Equivalence provider: pressure in hPa requested, kPa available — auto-bridged 431{public{pression{unite{kPa} valeur{101.325} precision{0.001}}}}

04 / Agent Operation & Time

Every Agent Operates on Its Own Discrete Present

ContextAA does not seek global consistency. Instead, each agent operates on a stable, locally coherent snapshot of the world during its cycle. This design choice — pragmatic and philosophical — makes agents robust to partial connectivity, clock drift, and distributed non-determinism.

The Three-Step Agent Cycle

Each agent executes a deterministic, isolated cycle managed by the Agent Manager: ConsumeActPublish. During Act, the agent's contextual space Sa is frozen — no asynchronous events can alter it mid-execution. This eliminates the need for locks, monitors, or any form of explicit synchronization in domain agent code.

Context requests published by an agent are fulfilled between cycles — these are deferred actions. An agent must always be written assuming its requests may not be answered for one or more additional cycles, potentially never (in the case of disconnected neighborhoods).

Time Without Global Clocks

ContextAA contextifies time itself. No global synchronized clock is assumed. An agent's "moment" is an iteration in its own execution cycle — discrete, monotonic, and local. Two consecutive moments ti, tj are ordered only within the same agent's history.

Between hosts, only a partial order is possible: sending a Context c precedes its receipt, and agent migration start precedes arrival. Beyond that, ContextAA favors subjective coherence per agent over global consistency — a principled stance aligned with the realities of open distributed systems.

Consume

Agent reads from its contextual space Sa — all previously received responses to prior queries, plus any context produced by the agent itself. The world is stable during this step.

Act

Agent applies its mission logic — evaluates conditions, produces new context values, commands actuators — strictly based on current Sa. No I/O, no blocking, no concurrency. Bounded execution per cycle.

Publish

Agent writes new context and outbound requests into Sa. Standard agents then propagate public context to neighbors and fulfill local requests — between this cycle and the next.

Deferred Reply

Context requests for remote hosts may require multiple cycles to resolve — or may never be fulfilled. Agents are designed to plan for the future but act on the present: always gracefully functional on stale context.

Conflict Resolution

When two agents publish antagonistic demands (e.g., thermostat at 20°C vs. 23°C), ContextAA provides the structural framework — but resolution strategy is the domain expert's responsibility, encoded in the actuator agent's ontological frame.


05 / Agent Mobility

Agents Move. Context Moves With Them.

Agent migration is a first-class feature of ContextAA. When resources on a Host fall below an agent's declared minimum requirements (Ra), the agent initiates migration to a neighboring Host that can support its mission — carrying its full contextual state along the way.

AGENT MIGRATION SEQUENCE — ha→h'

STEP 01 ⏸️ Suspend Agent Agent suspended on source Host h
STEP 02 🗜️ Contextify & Persist Agent serialized to Context form; persisted locally as fallback
STEP 03 📤 Transmit to h' Contextified agent sent to target Host h' via Emitter
STEP 04 💾 Persist on h' Received agent persisted on h' for safety; ACK sent to h
STEP 05 🔁 Reify & Activate Agent reconstructed from Context and activated on h'
RESOURCE MODEL 📊 Ra — Resource Requirements Minimum · Pessimistic · Mission-aligned

Each agent declares Ra: the minimum resources a Host must provide to support its mission. Ra is expressed pessimistically to trigger migration before service degrades, not after. The best-supported neighbor in Ξa ⊆ Nh is selected as destination.

CPUMemoryConnectivityPlatform
CONTEXT PORTABILITY 🌍 Pure Context Agents Contextified · Platform-independent · Serializable

Domain agents expressed entirely in Context are platform-independent by nature — their migration is as lightweight as transmitting a structured data object. Binary deployment is also supported for cases where contextification is not yet feasible, with platform constraints declared in Ra.

IaaCBinary FallbackDLL / .so
ISOLATION DESIGN 🛡️ Network Transparency Domain agents · No network awareness · Graceful degradation

A domain agent cannot distinguish a well-connected Host from an isolated one. It operates on the Context in Sa, which may lag behind physical reality. This is intentional: the agent remains operational at all times, trading potential staleness for uninterrupted service.

IsolationContinuityGraceful Degradation

Want to build on ContextAA?

Whether you are deploying a smart home application, researching distributed agent systems, or extending the platform — ContextAA is open for collaboration. Contact us or explore the full AMI-Lab infrastructure documentation.

Project Team

Bessam Abdulrazak

Professor, Department of Computer Science, Université de Sherbrooke

Director of the AMI-Lab

Patrice Roy

Ph.D. Student

Supervisor: Prof. Bessam Abdulrazak

Period: until july 2019

Publications

Coming Soon

We are working on this section. Please check back soon!