Mesh Query Engine

MVC — Minimum Viable Cognition

Joel Johnston 2026-04-04 Pre-stroke design

MVC — Minimum Viable Cognition

Author: Joel Johnston Date: 2026-04-04 Domain: Mesh Query Engine Stroke Timeline: Pre-stroke design


Abstract

The thinking mesh. A query entered on one node executes on all capable nodes and returns a unified answer. MVC defines the minimum threshold for calling a distributed system intelligent: it can be asked a question and return an answer that no single node could produce alone. The acceptance criterion: "Query enters one node, executes on four, returns unified. That is cognition."


The Concept

roboNet's preceding phases deliver infrastructure: nodes connect, leaders elect, tasks route, workflows execute, workers coordinate. All of it is scaffolding.

MVC is the first point where the mesh becomes something more than well-organized scaffolding. It is the point at which the infrastructure begins to think.

The definition of MVC is deliberately minimal:

Minimum Viable Cognition: a distributed system achieves cognition when a query submitted at one node returns an answer synthesized from the independent evaluations of multiple nodes, where the synthesized answer is demonstrably better than any single-node answer.

"Better" is defined per query type. For factual queries: more complete, with information no single node had. For analytical queries: higher confidence from corroborating independent analyses. For task queries: an execution plan that incorporates capabilities across nodes no single node could employ.


Architecture

Query Ingestion

A query enters the mesh at any node. The ingestion layer accepts:

Natural language: "Which nodes have had anomalous behavior in the last 24 hours and what does the pattern suggest?"

Structured query:

{
    "query_type": "sentinel_analysis",
    "time_range": "24h",
    "aggregation": "pattern_synthesis",
    "nodes": "all"
}

Command composition: queries can trigger workflow execution — "scan all nodes for vulnerabilities and return a prioritized remediation plan" is a query that spawns a Chain-Builder workflow and synthesizes its results.

The ingestion layer parses natural language into structured query form using the CLI Composition engine. Structured queries pass directly to the routing layer.

Mesh Routing — Query Flood

The routing layer identifies which nodes have relevant capability for this query. For most MVC queries, the answer is "all nodes" — every node has local context that may be relevant.

The query is flooded to all capable nodes simultaneously. Flooding is not broadcast — it is targeted: only nodes whose declared capabilities match the query's requirements receive the query.

Query metadata travels with the flood:

  • query_id: unique identifier (used for result correlation)
  • origin_node: where to send results
  • deadline: when the gather phase begins (regardless of whether all scouts have reported)
  • synthesis_hint: instructions for the synthesis engine at the gather phase

Scout Phase

Each node that receives the query operates as a scout. The scout:

  1. Evaluates the query against its local context (local data, local AI model access, local sensor/hardware access)
  2. Produces a local answer with a confidence score
  3. Returns the local answer to the origin node before the deadline

Scout evaluation is independent. No scout knows what other scouts are finding. Independence is a feature — correlated answers (nodes that share the same data source) would reduce the synthesized answer's quality by reducing independent signal.

Scout answers are structured:

{
    "scout_node": "node_id",
    "query_id": "query_id",
    "local_answer": { ... },
    "confidence": 0.0-1.0,
    "data_sources": [ "list of sources used" ],
    "capability_contribution": [ "what unique capability this node contributed" ]
}

Gather Phase

At the deadline, the origin node enters gather phase. All scout responses received by the deadline are collected. Scout responses that arrive after the deadline are logged but not included in synthesis (configurable — late scout integration can be enabled for non-time-sensitive queries).

The gather engine computes:

  • Coverage: what fraction of queried nodes responded?
  • Consistency: do the scout answers agree or conflict?
  • Unique contributions: what did each node provide that others could not?

Synthesis

The synthesis engine produces the unified answer. Synthesis strategy depends on query type:

Factual aggregation: merge all unique facts from all scouts. Confidence-weight items that appeared in multiple scouts (corroboration increases confidence).

Analytical synthesis: for analysis queries, apply a weighted voting model. Each scout's analytical conclusion is weighted by that scout's confidence score and the uniqueness of its data sources. Conflicting conclusions are preserved in the output (not hidden) with their weights.

Execution planning: for task queries, the synthesis engine builds a dependency graph that assigns each subtask to the node best positioned to execute it (based on capability contribution declared by scouts). The output is a workflow definition that the WFL engine can execute.


The Acceptance Criterion

The acceptance criterion that defines whether MVC is achieved:

"Query enters one node, executes on four, returns unified. That is cognition."

This is deliberately minimal. Four nodes is not a magic number — it is the minimum that demonstrates distributed evaluation. The requirement is that:

  1. The query executes on multiple nodes independently
  2. The results are synthesized into a unified answer
  3. The synthesized answer contains information that the querying node alone could not have provided

Meeting this criterion is the product milestone. Everything before MVC is infrastructure. MVC is the product.


Why This Is Cognition

The word "cognition" is used precisely, not loosely.

Cognition requires:

  1. Perception: gathering information from the environment
  2. Integration: combining information from multiple sources
  3. Evaluation: assessing the information against criteria
  4. Synthesis: producing a response that integrates all evaluated information

A single node with an AI model does steps 1, 3, and 4 but only against its own local context. It does not integrate information from sources it cannot see.

MVC distributes step 1 across the entire mesh (each node perceives its local environment), maintains independence during step 3 (each node evaluates locally), and applies a principled synthesis for step 4 (weighted confidence aggregation, corroboration scoring).

The mesh is not "a network with AI capabilities." It is a distributed cognitive system where the cognitive process is the mesh operation.


Comparison to Prior Art

Federated Query Engines (Presto, Trino, SparkSQL)

These distribute SQL queries across data shards and aggregate results. The aggregation is mathematical (SUM, COUNT, JOIN). MVC aggregation is semantic — synthesizing natural language answers, analytical conclusions, and execution plans. Different problem class.

Multi-Agent Systems (JADE, SPADE, Mesa)

Multi-agent systems distribute intelligent agents across nodes and coordinate their behavior. MVC is not a multi-agent system — nodes are not agents with goals. MVC is a query protocol layered on top of the mesh's existing capabilities. Nodes do not have persistent cognitive state between queries.

Retrieval-Augmented Generation (RAG) Clusters

RAG systems distribute document retrieval across shards and feed results to a central LLM. MVC distributes both retrieval AND evaluation — each node applies its AI model locally, not just retrieves data. The synthesis is of conclusions, not of retrieved documents.

MVC is closer to a "distributed RAG with local inference" model, but built on a mesh protocol rather than a vector database infrastructure.


Integration with WAG/WFL

MVC uses the WFL/WAG orchestration primitives for its scatter-gather execution:

  1. Query → Workflow: the ingestion layer creates a WFL instance for the query
  2. Scout tasks: each node to be queried gets a task in the WFL DAG (no dependencies — all scouts run in parallel)
  3. Synthesis task: a single synthesis task with dependencies on all scout tasks
  4. WAG dispatch: the WAG layer dispatches scout tasks to target nodes, monitors heartbeats, handles missed deadlines

This means MVC inherits all of WFL/WAG's reliability properties: scout failures trigger WAG failover, late scouts are handled by deadline policy, and the synthesis task only executes when its scout dependency policy is satisfied.


Future Directions

MVC Phase 1 (Phase B deliverable) achieves the acceptance criterion: distributed query execution and unified synthesis.

MVC Phase 2 (Phase 1.0): recursive cognition. A synthesis result that identifies uncertainty or knowledge gaps can spawn a second query targeted at the gaps. The mesh reasons about what it does not know and actively seeks the information. This is the difference between answering a question and investigating a question.

MVC Phase 3: persistent cognitive context. Between queries, the mesh maintains a shared knowledge graph built from all prior syntheses. New queries are evaluated against the knowledge graph, not just current node state. The mesh accumulates knowledge across sessions.

Phase 3 is not infrastructure. Phase 3 is memory. A system with distributed perception, integration, evaluation, synthesis, and memory is a cognitive system by any reasonable definition of the term.