Docs · Context Exploration Engine

Inside the exploration engine.

The CEE is not a runtime module. It is a client library, with Python bindings over it, that composes calls to the CAE and the CTE into four operations. This page shows how each operation maps onto the pieces below it.

Core class
ContextInterface
Operations
bundle, query, retrieve, destroy
Agents
iowarp-cei-mcp (MCP server)

The pieces

Python bindingsnanobind module over the interface C++ applicationslink the interface directly Context interface (in the client process)lazy runtime init · bundle · query · retrieve · destroy INSIDE THE RUNTIME CAE corebundle = ParseOmni CTE chain (indexer → core)temporal query · BM25 search · regex query · GetBlob · DelTag Tiers: RAM, NVMe, disk, buckets
Every CEE operation becomes one or more ordinary CAE or CTE tasks. There is no CEE state in the runtime.

The context interface

All logic lives in one C++ class in the caller's process. Constructing it does nothing; the first operation initializes the runtime client, then the CAE client (which brings up the CTE client), and checks that the runtime client is up. A failed runtime initialization is remembered rather than retried in a loop, because repeatedly creating the messaging context corrupted the allocator under Python 3.13.

Operations

Bundle
Builds assimilation contexts from the caller's list and sends them to the CAE core as one ParseOmni task, then waits. Everything the CAE can import, the CEE can bundle.
Query
Returns matching blob names in one of three modes. With a time bound it runs a temporal query. With a text query it runs the CTE's BM25 semantic search, served by the indexer, with a positive top-k (10 if none is given). Otherwise it runs a regular-expression query over tag and blob names.
Retrieve
Resolves names with the same three modes, then fetches the blobs in batches into one shared buffer: for each name it looks up the tag and the size (each a waited round trip), issues the get asynchronously, and waits for a batch's gets together. It returns the packed bytes. A blob that would overflow the buffer ends its batch; later batches still add blobs that fit. Missing and empty blobs are skipped.
Destroy
Deletes each named context's tag through the CTE.

A splice operation is declared but not yet implemented.

How a query finds blobs

Pythonclio_cee modulecontext_query() C++ContextInterfaceContextQuery() MCP server (iowarp-cei-mcp)calls the CTE Python bindings, not the CEE: tag and blobregex query, put, get, size, delete; no BM25 search 1 · time_begin or time_end ≠ 0TemporalSearch, capped at max_results 2 · prompt not emptySemanticSearch, k = max_results or 10 3 · otherwiseBlobQuery, capped at max_results (0 = all) The first test that holds picks the mode. Each mode is one task sent withPoolQuery::Broadcast, so every nodeanswers from the blobs it holds. BM25statistics are therefore per node. EACH NODE · CTE CHAIN: indexer → shm cache → … → cores Indexer containerSemanticSearch ends here; every other verb passes down Pending keysa put goes down first,then marks its blob dirty Forward indexper blob: term counts, lengthterms: a-z 0-9 runs of 2+ A search first drains pending: re-read each dirty blob, tokenize. Then match names, score BM25 (k1 1.5, b 0.75) over the matches. TemporalSearch, BlobQuery, GetBlob CTE core container BlobQuery: tag_re via the trigram tag index (^exact$: hash),then blob_re over each matched tag's own blob-name list TemporalSearch: tag_re over every tag name, then keep blobswhose last_modified falls inside [time_begin, time_end] Back in the client: one merged answer temporal: oldest first, cut to max_results · BM25: highest score first, cut to k · BlobQuery: appended up to max_results context_query returns the blob names; context_retrieve goes on to fetch the bytes (next figure)
A query is one broadcast task, not a scan from the client. BM25 search ends at the indexer, which scores a forward index it keeps current from the puts passing through it, including the puts a bundle's assimilators make. Regex and temporal queries pass the indexer and are answered from the core's tag and blob metadata.

How retrieve packs its buffer

One buffer, allocated onceAllocateBuffer(max_context_size) For each name in the batch 1 GetOrCreateTag and wait; null id: skip 2 GetBlobSize and wait; 0 bytes: skip 3 offset + size > max_context_size:end this batch here 4 AsyncGetBlob into buffer + offset,not waited yet; offset += size Steps 1 and 2 are round trips per name;only the gets overlap. End of the batchwait on every get; a failure is only logged Example: batch_size 3, max_context_size 8 MiB matches in query order: a 3 MiB, b 2, c 4, d 1, e 0, f 2 BATCH 1 a · 3 MiBoffset 0 b · 2 MiBoffset 3 c · 4 MiB5 + 4 > 8: ends batch 1 BATCH 2 (starts with the next name) d · 1 MiBoffset 5 e · 0 Bskipped f · 2 MiBoffset 6, fills the buffer THE BUFFER AFTERWARDS a b d f 03568 MiB c is never fetched; nothing in the bytes marks a boundary Result copy the used bytes into one string, free the buffer, return a one-element list (empty if nothing was read) defaults: max_results 1024 · max_context_size 256 MiB · batch_size 32
Retrieve first resolves names with the same three modes as query, then fills one buffer in batches. A blob that would overflow the buffer ends its batch, but the next batch still adds blobs that fit, so the result is not a prefix of the match list. The blobs are packed back to back with no sizes or separators.

The MCP server

iowarp-cei-mcp is a Python server (FastMCP) that gives AI agents tools over the Model Context Protocol. It wraps the CTE's Python bindings (clio_cte_core_ext), not the context interface: its tools query tags and blobs by regular expression, put, get, size and delete blobs, rescore a blob, and poll the telemetry log.

Costs of this design

DecisionBuysCosts
Client-side compositionNo extra module to compose or operateEach call pays client round trips to the CAE and CTE
Search via the indexerFast keyword search without rescansNeeds the indexer in the chain; lexical matching only
Packed retrieval bufferOne buffer, batched getsResults are bounded by the buffer size