Skip to content

MNESTRA COMPATIBILITY

Mnestra compatibility contract (Rumen v0.1)

Section titled “Mnestra compatibility contract (Rumen v0.1)”

Rumen v0.1 is tightly coupled to the schema exposed by Mnestra. Future Rumen versions may abstract this behind an adapter layer, but v0.1 reads Mnestra’s tables and calls Mnestra’s SQL functions directly. If your memory store does not follow the Mnestra schema, Rumen v0.1 will not work.

This document is the frozen contract for v0.1. Any change here is a breaking change and requires a minor version bump.

See the Podium lessons referenced in the RUMEN pre-deployment checklist: Rumen is intentionally small (~200 LOC in v0.1) and uses raw pg rather than Prisma. Introducing an adapter layer would roughly double the surface area for no v0.1 benefit. Mnestra is the first and currently only consumer, so we couple now and abstract later if a second memory store needs to plug in.

ColumnTypeRequiredUsed by Rumen
iduuidyesRumen stores these in rumen_insights.source_memory_ids.
contenttextyesRumen falls back to concatenated content when a session has no summary.
source_typetextyesReturned in relate results; reserved for v0.2 weighting.
projecttext (nullable)yesWritten to rumen_insights.projects[].
created_attimestamptzyesUsed for lookback filtering indirectly via session join.
session_iduuid (nullable)yesJoin key from memory_items back to memory_sessions.
embeddingvector(1536)yes (for v0.2)v0.1 does NOT read embeddings directly; it calls memory_hybrid_search which does.

v0.1 never writes to memory_items. Rumen is strictly a reader of Mnestra’s memory tables.

ColumnTypeRequiredUsed by Rumen
iduuidyesStored in rumen_jobs.source_session_ids.
projecttext (nullable)yesCopied into signal metadata.
summarytext (nullable)yesv0.1’s primary search text.
created_attimestamptzyesLookback filter (last 72 hours by default).

v0.1 never writes to memory_sessions.

Signature expected by Rumen v0.1:

memory_hybrid_search(
query_text text,
query_embedding vector(1536),
limit_count int,
project_filter text
) RETURNS TABLE (
id uuid,
content text,
source_type text,
project text,
created_at timestamptz,
similarity numeric
)
  • Rumen calls this with query_embedding := NULL in v0.1. Mnestra’s implementation must fall back to keyword-only (tsvector) matching when the embedding argument is NULL. v0.2 will start passing a real embedding.
  • Rumen passes project_filter := NULL to search across all projects. Cross-project prior art is the core value Rumen delivers.
  • similarity is expected in the range [0, 1]. Rumen thresholds at 0.7 by default.

If your Mnestra fork returns additional columns, Rumen will ignore them — the column list above is the minimum.

Rumen only writes to its own tables (rumen_jobs, rumen_insights, rumen_questions). It never INSERTs, UPDATEs, or DELETEs any row in memory_items or memory_sessions.

This is the core safety rule and every PR to Rumen must preserve it. See CONTRIBUTING.md.

If Mnestra renames a column or changes a signature:

  • Rename a column in memory_items or memory_sessions → Rumen v0.1 extract.ts must be updated; bump Rumen minor.
  • Change memory_hybrid_search signature → Rumen v0.1 relate.ts must be updated; bump Rumen minor.
  • Remove a required column → Rumen cannot run until fixed; treat as major.

v0.5+ is the likely home for an adapter abstraction: RumenMemoryStore interface with fetchRecentSessions, searchRelated, etc. Until then, if you need to run Rumen on top of a non-Mnestra store, fork extract.ts and relate.ts rather than trying to configure around them.