Expand description
Markdown rendering of Engine result types.
Shared by memstead-mcp (wraps output in MCP CallToolResult) and
memstead-cli (prints directly to stdout).
Structs§
- List
Result Envelope - Envelope for a full
ListResult. The engine-meta counters carry the same_-prefixed wire keys asSearchResultEnvelope(and as both surfaces’ markdown form) so an agent moving betweenmemstead list --jsonandmemstead search --jsonparses one envelope-meta convention. The_prefix reads as “engine-meta, not entity content”. - Search
HitEnvelope - Envelope wrapping a
SearchHitwith precomputed summary fields. - Search
Result Envelope - Envelope for a full
SearchResult:_-prefixedengine-emitted counters at the top level,facetsas a structured object (not a markdown blob), and the full per-hit shape (score, score_breakdown, matched_terms, expansion) inherited verbatim fromSearchHitso the structured envelope is the branching surface — agents readingstructured_contentdon’t have to parse the text channel’s rendered prose to recover scores or score components. CLI--jsonand MCPstructured_contentshare this shape.
Enums§
- Origin
Class - Trust origin of a schema (or the mem that pins it), decided at adopt/write time and reported — never re-derived — on the read path.
- Schema
Verbosity - Verbosity selector for
build_schema_payload.
Functions§
- build_
entity_ envelope - Build the structured
memstead_entityenvelope. Identity fields (_hash,id,mem,type,_stub_kind) come from the parsedEntityand live at the top level. Every schema-declared frontmatter key surfaces under a nestedmetadata: {...}map — its single home. Read a metadata value asenvelope.metadata.<key>; generic consumers iterate the map without per-type branching. The prior shape additionally hoistedlevel/stability/created_date/last_modifiedto the top level, serialising those fields twice; that hoist is gone. The read-only identity triple (mem/id/type) is excluded from the nested map — it appears only top-level — and underscore-prefixed internal keys (_hash,_tokens*,_mem_schema,_stub_*) live in dedicated top-level slots and never appear inside the nested map.sectionsandrelationshipsround-trip the engine’s internal IndexMap / Vec shapes verbatim._tokensis computed from the rendered body (filter and opt-in inserts applied) so agents can pre-size before a follow-uptoken_budget-bounded read._mem_schemarides when the workspace pinned a schema for the mem. - build_
list_ envelope - Build a
ListResultEnvelopeborrowing fromresult. - build_
schema_ payload - Build the transport-neutral, rmcp-free JSON payload for a schema read
(
memstead_schema). Shared by the MCP server, the HTTP surface, and the filesystem-mem MCP flavour so every surface emits identical schema-read bytes from one source.used_bylists the writable mems whose pinned schema resolves to this one;verbositytoggles the full payload versus the lightweight skeleton (seeSchemaVerbosity). - build_
search_ envelope - Build a
SearchResultEnvelopeborrowing fromresult. - manual_
authoring_ str - Stable wire string for the
manual_authoringposture. - per_
edge_ description_ str - Render a
PerEdgeDescriptionto its wire literal — bit-identical to what the schema YAML accepts so consumers can echo the value back without case fiddling.forbidden(the default) is emitted explicitly rather than omitted so a schema without an explicit declaration still surfaces the resolved posture on the wire. - render_
community_ context_ section - Render a
## Community Contextsection — cluster id + neighbor list — appended tomemstead_entityoutput wheninclude_context: true. No frontmatter; the entity body owns that. - render_
context_ markdown - Render context (community cluster) as markdown.
- render_
entity_ markdown - Render a single entity as markdown with frontmatter metadata.
- render_
list_ markdown - Render list results as markdown.
- render_
overview_ markdown - Render overview (all clusters) as markdown.
storeprovides entity titles for the on-the-fly auto-summary (title-join) — there is no stored summary. - render_
relations_ json - Render outgoing/incoming relations as a JSON envelope. Consumed by
memstead-cli relations --json; no MCP path uses it. - render_
relations_ markdown - Render a
## Relationssection as markdown — typed edges grouped by direction. Appended tomemstead_entityoutput wheninclude_relations: true. A JSON-shaped version is available viarender_relations_jsonfor thememstead-cli relations --jsonconsumer. - render_
search_ markdown - Render search results as markdown.
- render_
type_ catalog_ markdown - Render the full schema catalog as markdown — built-in default types.
- render_
type_ catalog_ markdown_ for - Render the type catalog for an arbitrary loaded
Schema. Same shape asrender_type_catalog_markdown; iterates the schema’s own types in name order so multi-mem workspaces can describe the schema pinned by the writable mem, not the engine’s hard-coded built-in. - render_
type_ info_ markdown - Render a single type’s definition as agent-friendly markdown.
- rendered_
body_ tokens - Token estimate for an entity’s rendered body (title + sections +
relationships, filter applied) — the exact number
render_entity_markdownembeds as its frontmatter_tokens. Use this when building a structured envelope so the envelope’s_tokensand the markdown channel’s frontmatter_tokensdescribe the same thing for a given_hash: the rendered body, not the full markdown document (which would additionally count frontmatter).