Page
Indexing and Querying
The Three Public Interfaces
Myria’s normal agent interaction surface is:
append_eventquery_event_nodesquery_references
Everything else exists to support or observe those flows.
Append Flow
append_event is deterministic.
The current implementation:
- validates the event
- normalizes participants
- checks
(channel, source_event_key)for idempotency when present - generates
event_id - writes the event
- evaluates the threshold trigger
If the unindexed tail reaches the configured threshold, Myria immediately starts a build.
Query Event Nodes
query_event_nodes is the simple read path.
It:
- reads matching raw events directly from the event log
- filters by participants, context, text query, topic-hint query, and internal visibility
- returns a rooted tree whose children are raw event nodes
No LLM is required.
Query References
query_references is the non-trivial read path.
It combines two lanes:
- snapshot lane Walk the visible TopicIndex forest in the active snapshot.
- fresh-tail lane Read events newer than the active snapshot cutoff.
The response is always one rooted multi-child tree. A shallow list is represented as a root with direct children. A hybrid result can mix leaf-topic branches and fresh event children under the same root.
Build Triggers
Builds start globally through exactly three paths:
- manual trigger
- inactivity timeout
- unindexed-tail threshold
When a build starts, Myria captures the current event_seq high-water mark. Only events at or below that cutoff enter the in-flight build. Newer events remain in the fresh tail.
Build Pipeline
The current build flow is:
- load the active snapshot cutoff
- capture a new cutoff
- load the eligible event slice
- partition events by exact participant set
- build leaf groups
- create leaf-topic nodes
- create one internal root when a participant set has multiple leaves
- validate the snapshot bundle
- publish atomically
LLM vs Deterministic Control
Myria uses an internal LLM for two workflows:
- builder planning
- reference-tree walking
Deterministic Go code still owns:
- snapshot pinning
- participant masking
- SQL execution
- structural validation
- final tree assembly
- snapshot publish
Bounded Inspection
Both LLM workflows use bounded tools. The current system enforces limits on:
- subtree depth
- node count
- ref count
- payload bytes
- tool-call rounds
Raw event payloads are not part of structural inspection by default.
Deterministic Fallback
If an internal LLM workflow fails, Myria falls back to deterministic behavior:
- builder falls back to heuristic leaf grouping
query_referencesfalls back to a bounded deterministic reference tree
Fallback results are marked as degraded in the response metadata when applicable.