Skip to content

Measure hosted memory's per-turn cost and stability: ingest paths, pack budget, prompt cache, PII, soak #7023

Description

@CodeGhost21

Summary

Measure what hosted memory costs each turn, and prove it stays stable: every ingest path, re-ingest without duplicates, the per-turn pack's budget and prompt-cache behaviour, the effect of PII redaction on recall, and a soak run. Record the numbers on this issue.

Problem / Context

Split out of #6718 (Phase 3). Memory v2 (#6949, #6993) changed the shape of several of these criteria:

Scope

Acceptance criteria

  • Ingest paths: each path writes to hosted memory and is recalled afterwards: brain documents (memory_brain_ingest, including PDF and image conversion), each synced source kind (folder, file, link, GitHub, RSS, Composio), conversation turns, learnings, and the v1 import (Free memory migration from local TinyCortex storage to hosted CortexDB for current subscribers #7005 / fix(memory): stop a v1 import on credits or outage instead of skipping every item #7011).
  • Re-ingest: re-syncing a source, re-running backfill and resuming an import never silently duplicate or drop records, checked by counting items before and after.
  • Pack budget: against a large store, the pack stays within [memory.recall]'s token budget. The measured size is recorded.
  • Prompt-cache stability: captured request bodies across consecutive turns of one thread show the prefix up to the last committed message unchanged, with the pack only at the tail. Verified on a default model and on DeepSeek.
  • Cost per turn: pre-turn recall latency (p50 / p95), tokens the pack adds, and cache hit rate with memory on vs off, all recorded.
  • PII redaction: recall quality on a fixture with PII-bearing notes, measured with scrubbing as shipped. The loss, if any, is recorded.
  • Soak: a long conversation over a realistic store size shows no unbounded growth in pack size, recall latency or cost per turn.
  • Diff coverage ≥ 80%: any fix this turns up meets the changed-lines coverage gate.

Related

Activity

  1. added
    taskWork item that is not primarily a bug or a feature.
    priority: p2Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.
    on Oct 6, 2026
  2. added theissue type on Oct 6, 2026
  3. CodeGhost21 commented on Oct 6, 2026

    @CodeGhost21
    ContributorAuthor

    Live ingest paths and re-ingest on production, 2026-10-06

    The real openhuman-core from main, headless in a throwaway HOME, bound to hosted memory (tinyhumans, status ok) with a memory-scoped test key. Every write was forgotten afterwards; a follow-up listing confirmed 0 stray documents. Core logs contained 0 key occurrences.

    Path Result Re-ingest / re-sync
    Learning (memory_learn) ✅ stored ✅ the same text again returns the same id
    Brain text (memory_brain_ingest text) ✅ filed under markdown ✅ the second call returns replayed: true, same id
    Brain file: markdown ✅ listed in 15 s, text extracted n/a
    Brain file: PDF ❌ refused: "the native converter does not handle pdf" → fixed in #7034 (office converter: PDF/DOCX/PPTX/XLSX) n/a
    Brain file: image (PNG) ❌ refused: no converter for images. Open; CortexDB has server-side image extraction (CORTEX_IMAGE_*) as a possible route n/a
    Folder source ⚠️ both files read, second write lost to HTTP 502 Bad Gateway from memory/events ~65 s in (see tinyhumansai/cortexdb-saas#14) ✅ no duplicates
    File source ✅ 1 document ✅ no duplicates
    Link source ✅ 1 document (64 s) ✅ no duplicates
    RSS source ✅ a 3-item text feed: all read, 2 visible within 150 s, the third still syncing (hosted latency). An image-only feed (xkcd) correctly stores nothing: "has no text to store" n/a

    Pinned by tests in #7034 (in-memory reference engine; no behaviour change needed):

    • Prompt-cache stability: turn two's request reuses all of turn one's messages as the cached prefix, and turn one's pack never reaches turn two. On hoisting models (DeepSeek, native Anthropic), only the previous tail message drops out of the cache.
    • Pack budget: with 1,500 learnings, a turn pack stays within budget_tokens and repeats nothing.

    Bug found and fixed upstream: a turn resumed after compaction pasted start_session's pack beside pre_turn's. That is two budgets, with every learning injected twice (19 repeated lines in a test). The fix is tinyhumansai/tinymemory#206 (PreTurn::resumed, one pack); the OpenHuman side follows once it is pinned.

    Still open here: cost per turn, PII-redaction recall, soak, conversation-turn and v1-import ingest live. Most need recall latency fixed first (cortexdb-saas#14; likely tinyhumansai/tinymemory#204).

  4. added 2 commits that reference this issue on Oct 6, 2026
  5. senamakel commented on Oct 9, 2026

    @senamakel
    Member

    Triage: valid — Current review confirms this is a concrete, in-scope engineering issue or request: “Measure hosted memory's per-turn cost and stability: ingest paths, pack budget, prompt cache, PII, soak”. No complete resolution is evident in current main.

  6. senamakel commented on Oct 9, 2026

    @senamakel
    Member

    Triage: needs opinion — “Measure hosted memory's per-turn cost and stability: ingest paths, pack budget, prompt cache, PII, soak” needs a maintainer decision on product scope/priority or fresh reproduction evidence before its status can be settled. Please advise whether to pursue, narrow, or close it.

  7. added
    triage: needs-opinionValid issue awaiting a maintainer product or priority decision
    and removed
    triage: needs-opinionValid issue awaiting a maintainer product or priority decision
    on Oct 9, 2026
  8. senamakel commented on Oct 9, 2026

    @senamakel
    Member

    Triage correction: valid — Current review confirms “Measure hosted memory's per-turn cost and stability: ingest paths, pack budget, prompt cache, PII, soak” is an actionable, in-scope gap; no complete resolution is evident in current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.source: teamIssue opened by a repository membertaskWork item that is not primarily a bug or a feature.triage: validReviewed and confirmed as a valid actionable issue

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions