Repository navigation
Conversation
Replaced the synchronous `chunk_store::list_chunks` and `chunk_store::get_chunk` calls in the `list_chunks_rpc` and `get_chunk_rpc` handlers with asynchronous calls through the active memory guard. This change allows the chunk family operations to respect the current memory scope and driver abstraction, which is necessary because the module's cdylib cannot read task-local state set by the host. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The ChunkQuery type was moved from the chunks module to the provider module in the tinymemory_api crate, and the chunk_store module was added to support the new import structure. This change updates the import paths to match the refactored API layout, ensuring the RPC module compiles correctly against the latest dependencies. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the memory list is empty, the ranking function now returns an empty result instead of panicking or producing undefined behavior. This ensures the system gracefully handles cases where no memories are available for ranking. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a new test module for the ranking system to ensure correctness of ranking calculations and edge case handling. This establishes the testing infrastructure for future ranking-related changes. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new `ranking` module that provides the re-ranking mathematics used by the two agent search tools, including weighted signal summation, cosine similarity, and a maximal marginal relevance pass. This module lives above the driver by design to keep the ranking logic separate from the execution layer. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…anking module Updated hybrid and vector search tools to import scoring and ranking functions from the local `crate::openhuman::memory::ranking` module instead of the external `tinycortex` crate, consolidating memory ranking logic within the project. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Added the missing import for MemoryProvider in the RPC module to resolve a compilation error caused by an undefined type reference. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a new `memory` feature to Cargo.toml that gates the openhuman::memory family of domains, including recall, ingest, tree, goals, sources, and sync. This feature is added to the default feature set and as a dependency of the `memory-git` feature, providing a compile-time axis for embedding hosts that want a workflow or tool runtime without any memory functionality. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The memory feature family is now explicitly listed in the Tauri Cargo.toml dependencies and in the CI product-features.txt file. This ensures the TinyMemory module and all related memory subsystems are compiled into the shipped application, as the shell uses default-features = false and would otherwise silently omit them. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The memory module now re-exports Memory, MemoryCategory, MemoryEntry, MemoryTaint, NamespaceSummary, and RecallOpts directly from the tinymemory-api contract crate instead of routing them through tinymemory-core's traits module. This ensures these types remain available in agent-harness signatures even when the memory family is compiled out, and prevents the risk of type drift that would occur with a stub twin. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a new specification document covering the memory bus interface for the remaining surface area, which was previously undocumented. This completes the hardware interface documentation for the project. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Wrap all memory behavioural submodules with `#[cfg(feature = "memory")]` so they are only compiled when the feature is enabled, and introduce a `stub` module that re-exports the always-available surface with disabled bodies for the disabled-build case. This allows the `pub mod memory;` declaration in `openhuman/mod.rs` to remain unconditional while the crate compiles without the memory feature, keeping the public API surface stable and avoiding conditional compilation at every call site. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The memory module was missing its stub implementation, causing compilation errors when the full implementation was not available. This change adds the stub module to provide the necessary type and function placeholders for the memory subsystem. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds the `memory` feature row to the feature table in AGENTS.md, documenting the `openhuman::memory` family and its implications when enabled or disabled. This entry was missing from the table despite the feature being implemented. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…s` with `tinymemory_core::sync: The composio provider module has been extracted into the `tinymemory_core` crate, so all internal references to the old path are updated to point to the new location. This is a pure path migration with no behavioural change. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The import path for `ControllerSchema` was outdated, pointing to a submodule that no longer contains the type. This change updates the import to the correct location in `crate::core`. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The four files that previously imported types and functions from the internal `crate::openhuman::memory` module now import them from the external `tinymemory_core` crate instead. This change extracts the in-memory store into a standalone library so it can be reused across projects and tested independently. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…rs,src/openhuman/integrations/c Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…memory feature Add `#[cfg(feature = "memory")]` attributes to several modules, re-exports, and one import so that the memory subsystem is only compiled when the feature is enabled, preventing unused-code warnings and reducing binary size when memory support is not needed. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add conditional compilation attributes to the archivist, agent_memory, remember_preference, and save_preference modules so they are only compiled when the "memory" feature is enabled. This prevents unused code from being included in builds that do not require memory functionality. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The learning module is now conditionally compiled with the `#[cfg(feature = "memory")]` attribute, as its entire domain depends on memory-backed storage that is absent when the memory feature is disabled. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The flow memory tools were previously gated only on the flows feature, but they also depend on the memory feature, so their cfg attributes have been updated to require both. Additionally, many tools that were unconditionally registered are now correctly gated behind the memory feature, ensuring they are only available when the memory subsystem is enabled. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The goals directory tool and the ToolStatsTool were being registered unconditionally, causing compilation errors when the memory feature is disabled. Both registrations are now wrapped with the appropriate feature gate to match the conditional compilation of their underlying implementations. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
All push_cap and push calls that register memory-related controllers in build_registered_controllers are now conditionally compiled with #[cfg(feature = "memory")], ensuring these controllers are only registered when the memory feature is enabled. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ller registration Removed the `#[cfg(feature = "memory")]` attributes from all memory-related controller registrations in the build_registered_controllers function, making these controllers always available regardless of the feature flag. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Guard the memory-related methods on CoreContext behind the "memory" feature flag so that builds without that feature do not expose the memory API. A new fallback implementation of current_memory_capabilities returns the empty capabilities set when the feature is absent, ensuring that any future ungated caller sees a closed default rather than an open one. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `set_modules_policy` call is now gated on both the `modules` and `memory` features, and the `tinymemory_core::global::init` and `for_workspace` calls are gated on the `memory` feature alone. This prevents compilation errors when the `modules` feature is enabled without `memory`, and ensures memory subsystem initialization only runs when the memory feature is active. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Three conditional blocks that depend on the memory subsystem were previously compiled unconditionally, causing build failures when the memory feature is disabled. Each block is now guarded with a cfg attribute so the code compiles cleanly regardless of the feature flag. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Added `#[cfg(feature = "memory")]` guards to three code paths that depend on memory functionality, ensuring the agent compiles and runs correctly when the memory feature is disabled. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `ToolMemoryCaptureHook` and the `archivist_hook` registration were unconditionally compiled, causing build failures when the `memory` feature is disabled. These dependencies are now conditionally compiled with `#[cfg(feature = "memory")]` to match the existing feature-gating pattern used elsewhere in the codebase. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the earlier five-revision analysis of the memory-bus migration with a six-revision table that correctly identifies the `IngestOutcome` narrowing as the actual blocker, and document the test-side work that is already complete. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The previous entry for A9 incorrectly stated that the document and chat paths could start immediately, when in fact A9 requires a single `tinymemory` change that adds both a wider `IngestOutcome` and an email ingest method. The corrected text now accurately reflects that the host-side test fixtures are already in place and that the migration will be a single writer-plus-readers change once the contract widening lands. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the module-level documentation in the RPC handler to reflect the current understanding of what blocks a guarded read path. The earlier analysis identified an injection seam as insufficient and the writer as the blocker, but the real obstacle is the `IngestOutcome` type losing information across the bus, specifically the `already_ingested` flag and `extract_jobs_enqueued` count. The comment now correctly identifies that an upstream change to `IngestOutcome` and an email ingest method are needed before the guarded path can work, and clarifies that the four served methods themselves are already available. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Changed the sort in the chunk retrieval to use `sort_by_key` with `std::cmp::Reverse` instead of the manual `sort_by` with reversed comparison. This makes the intent of sorting by creation date in descending order clearer and more idiomatic. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…surface.md,src/openhuman/memory Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
….github/workflows/ci-lite.yml,. Auto-committed-on: dragonfly
Gate memory-dependent code and tests so builds without the `memory` feature compile cleanly, while returning explicit errors for unavailable tools. Initialize MMR similarity reductions from negative infinity to preserve correct scoring for negative similarities. Auto-committed-on: dragonfly
Feature-disabled builds now expose the memory subsystem as a down null driver with an explanatory reason instead of returning no status. Update the memory bus specification to document the title propagation requirement and testing constraints. Auto-committed-on: dragonfly
…ry/ranking_tests.rs,src/openhum Auto-committed-on: dragonfly
Normalize indentation and line wrapping in feature-gated code without changing behavior. Auto-committed-on: dragonfly
Conditionally compile memory modules, re-exports, tests, and related tools so builds without the memory feature use the stub surface without unavailable dependencies. Auto-committed-on: dragonfly
Guard memory-dependent tool registrations and tracking setup so builds without the memory feature remain valid. Expose the namespaces module independently of the feature gate. Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
Expose the memory modules and re-exports without requiring the `memory` feature, removing the disabled stub path. Compile memory tests whenever tests are enabled so the subsystem remains consistently validated. Auto-committed-on: dragonfly
Register the citation, namespaces, and ranking modules in the memory module so their functionality is publicly accessible. Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
Only register memory-specific tools when the memory feature is enabled, allowing builds without memory support to compile successfully. Auto-committed-on: dragonfly
There was a problem hiding this comment.
Requesting changes: 1 lane(s) blocking, worst finding is high.
Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.
$0.2296 · 2,365,263 in / 44,562 out · 272,288 cached (12%) · openrouter/openai/text-embedding-3-small, deepseek/deepseek-v4-flash, z-ai/glm-5.2 · 749 embedded
critique: $0.1004 · 1,145,959 in / 18,223 out · 51,004 cached (4%) · deepseek/deepseek-v4-flash, z-ai/glm-5.2
security: $0.1053 · 1,095,040 in / 16,160 out · 179,992 cached (16%) · deepseek/deepseek-v4-flash, z-ai/glm-5.2
tests: $0.0054 · 65,825 in / 224 out · 0 cached (0%) · deepseek/deepseek-v4-flash
description: $0.0184 · 58,439 in / 9,955 out · 41,292 cached (71%) · z-ai/glm-5.2
Track a newer tinyagents revision to incorporate the latest upstream changes. Auto-committed-on: dragonfly
Compile the flow digest subscriber only when memory support is enabled and use a shared TinyMemory module identifier when deciding eager loading. This keeps non-memory builds valid and avoids duplicating the registry ID. Auto-committed-on: dragonfly
There was a problem hiding this comment.
The previously-blocking findings are resolved. Clearing the changes request.
$0.0502 · 314,870 in / 19,629 out · 132,276 cached (42%) · openrouter/openai/text-embedding-3-small, deepseek/deepseek-v4-flash, z-ai/glm-5.2 · 754 embedded
critique: $0.0122 · 95,598 in / 4,078 out · 10,095 cached (11%) · deepseek/deepseek-v4-flash, z-ai/glm-5.2
security: $0.0105 · 94,604 in / 2,395 out · 21,192 cached (22%) · deepseek/deepseek-v4-flash, z-ai/glm-5.2
tests: $0.0150 · 65,938 in / 8,105 out · 56,104 cached (85%) · z-ai/glm-5.2
description: $0.0125 · 58,730 in / 5,051 out · 44,885 cached (76%) · z-ai/glm-5.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two deliverables, plus an inventory that says honestly what is left.
1. The
memoryCargo gateDefault-ON, product-ON, forwarded to the shell. Facade + stub, the
voiceshape with
skills' refinement.With
memoryoff: thememory*controllers are unregistered(unknown-method over
/rpc, absent from/schema), every memory agent tool isabsent rather than degraded to an error, the memory subscribers are not
installed, the
agent_memorybuiltin is not advertised — and, the point of thegate for an embedding host, no memory
cdylibis downloaded ordlopened.Recall inside a turn returns nothing, which is what
NullMemoryProvideralready produces at runtime and what
DomainSetalready models withmemory: false.Six carve-outs, each with ONE definition
The work here was not the
#[cfg]s. It was finding the parts of the familythat are not behaviour, and each one is compiled in both builds rather than
given a stub twin — a twin is a second definition free to drift, and nothing
would catch the drift.
memory::apitinymemory-apire-exportmemory::hostMemoryHostConfig for Config+ the bus event sink&Configwheredyn MemoryHostConfigis expected. Gating it makesConfigstop satisfying a bound that has nothing to do with the familymemory::ranking(new)hybrid_score,WeightProfile,cosine_similarity,mmr_selectmemory::citation(new)MemoryCitation,CROSS_CHAT_HEADERlast_turn_citationsfieldmemory::namespaces(new)CONVERSATION_RAW_NAMESPACE,REFLECTIONS_NAMESPACE&'static strcannot fail without a driverflows::namespace(new)flow_namespace,FLOW_MEMORY_NAMESPACE_PREFIXformat!;flows_deleteneeds it with memory offflow_namespacecarries a stated security invariant — "the only place in thecodebase that may construct this namespace string". Moving it kept that
true: there is one definition, not two, and
memory_toolsre-exports it.Three mis-housings fixed rather than stubbed
The Composio provider catalogue, the conversation store
threadsuses, and therpc_modelsrequest types were all always-compiled code reaching the enginethrough a
memory::…shim. They nametinymemory_coredirectly now — thesame move the
channelsgate made for its threetinychannelsimports. Thatremoved ~37 always-on → gated edges without a single stub.
Stubs answer in two shapes, deliberately
all_*_registered_controllersaggregators return empty vectors, so
core/all.rsneeds no#[cfg]forthem. A stub returning a controller that answers "memory disabled" would make
memory.*a known method that fails at run time — the opposite of theintended unknown-method.
mode that looks like success.
The
openhuman memoryandtree-summarizerCLI arms are kept rather thandeleted, answering with the gate name. Falling through to generic namespace
resolution would say "unknown namespace: memory", which reads like a typo.
Same shape as the existing
mcpandtuiarms.CoreContext::current_memory_capabilitiesgets anot(feature)arm answeringclosed — the one place it does. The open default exists because a
capability set is unknowable until a driver answers; with the family compiled
out the state is not "unknown", it is "absent".
2. Handler work: one migration done, one deliberately reverted
Done. The ranking maths moved host-side, ported verbatim, with parity tests
pinned to literal expected values rather than calls back into the engine —
a test written the other way stops compiling on exactly the day it matters.
Both search tools already fetched through the guard, so nothing about this
needed a driver.
Reverted, and this is the interesting half. I migrated
memory_tree_list_chunks/get_chunkontoMemoryChunks. It compiledcleanly and broke four round-trip tests, which turned out to be right.
I migrated
memory_tree_list_chunks/get_chunkontoMemoryChunks. Itcompiled cleanly and broke four
ingest_documentround-trips, which turned outto be right. Getting to why took six attempts; the five wrong ones are in the
spec because each reads as correct.
Why the zero happens.
default_memory_driver()returns"tinycortex",binding::admitaliases it to the module id, no artifact exists in a unit test,so the documented fallback installs the null driver — while the fixtures
write through
ingest_pipelineto the engine's SQLite. Neither theconfigargument (wrong turn 1) nor a
guard_for_confighonouring it (wrong turn 2,built and discarded) changes that.
The writer migration is cheaper than I first wrote, and that correction
matters because the expensive version would deter the work.
TinycortexProvider::ingest_documentcallstinymemory_core::ingest_pipeline::ingest_document_with_scope— the samepipeline the host already calls. Nothing relocates. Its
title: String::new()drops
DocumentInput.title, butcanonicalisereadstitleonly in itsemptiness guard, so the only delta is a document with an empty body and a
non-empty title.
provideris inert.The actual blocker is that
IngestOutcomeis narrower thanIngestResult.This RPC answers six fields; the bus carries three.
IngestResultIngestOutcomechunks_writtenwrittenchunk_idsidssource_idchunks_droppedskippedalready_ingestedskippedextract_jobs_enqueuedThe adapter collapses two facts into one number:
skipped = if already_ingested { 1 } else { chunks_dropped }. That is preciselythe ambiguity
already_ingestedexists to prevent —wipe_all_clears_ingest_gatepins a shipped bug where a wiped source couldnever re-ingest, and "0 chunks written" was distinguishable from a normal no-op
only by that flag. Migrating today would put that back as a public RPC response
narrowing.
So A9 needs one upstream
tinymemorychange carrying two additions: a widerIngestOutcome, and an email ingest method (ingest_rpcdispatchesChat/Email/Document;
MemoryIngesthas no email arm). The four methodsthemselves are already served by the pinned v1.2.0 — verified with
git show v1.2.0:crates/tinymemory-module/src/service/mod.rs, not assumed.The host-side half is done and is in this PR.
InMemoryChunks+guarded_in_memory_chunks()(memory/guard/in_memory.rs) is a storing providerimplementing
MemoryIngestandMemoryChunks, so a write and a read that bothcross a real
MemoryGuardreach the same store.InMemoryProvidercould notserve this — mandatory three only, so
as_chunks()isNoneand the guardanswers
Unsupported. Three tests pin the round trip,source_iddedupe, andscope-applied-before-limit. It is test infrastructure with no production caller
yet, deliberately: it is the piece that turns the next attempt from a research
problem into a seam plus fixtures, and
guard_overis the documented extensionpoint for exactly this.
The handlers stay on the store meanwhile, with the reasoning at the call site.
One line there is load-bearing: do not make those four tests pass by binding a
global client in the fixture. They are the only tests that go red when a
reader moves to the guard while the writer stays on the store.
3. What is left, and why (
docs/specs/2026-08-23-memory-bus-only-remaining-surface.md)The previous round's note concluded that "what blocks the migration is release
lag, not seam width". That was true of v1.2.0's five families and is false in
general. Fully retiring
tinycortexneeds roughly twelve new bus familiesupstream — the ingest queue (36 refs), conversations (~25), the source
registry (~20;
MemorySourceSinkhas onlyaccept_source_itemsandforget_source), the composio sync pipelines (~25), the chat host seam (17),preferences, recency recall, persona compilation — plus a design pass for
read_rpc, which writes raw SQL against the engine's schema with anentity-index join and a total that
ChunkQuerycannot express.Each is a
tinymemoryPR → release → registry re-pin → host change. The specenumerates them with call sites and an order of operations, so the upstream
work is a mechanical read rather than a rediscovery.
A9 needs one upstream change too, but a smaller one than the twelve above:
a wider
IngestOutcomeplus an email ingest method. The methods themselvesalready exist in v1.2.0, so it is a contract widening rather than new plumbing,
and the host-side fixtures for it are already in this PR.
Ratchets
direct_engine_refs_testsgains 19FacadeRevealedentries. No new enginedependency: these are the always-compiled callers that the retarget above
made honest about a dependency they already had. The
ALLOWEDheader nowdocuments both reveals — the facade deletion and this gate — and each entry's
reason says which one it came from.
The ratchet also caught me: a twentieth entry I added
(
flows/tinyflows/caps/tools/composio.rs) names the engine only in a doccomment, and the scanner skips comment lines, so the staleness half rejected it
as stale on arrival. That is the guard working, and the reason to run it rather
than trust a file-level diff.
Testing
cargo checkgreen in both directions: product features, anddefaultminus
memory.cargo fmt --all --checkclean; both ratchets green.--libsuite: the only failures are the seven known pre-existing ones —six git tests that fail because this checkout is a worktree, plus the
multi_batch_volume_builds_full_tree60s seal timeout, all verifiedidentical on untouched
main.lane runs
cargo check, nevercargo test --no-default-features. Runcargo check --no-default-features --features "media,skills,flows,mcp,channels,medulla,http-server,scheduler-gate,file-logging,modules"before touching this surface.
Summary by CodeRabbit
New Features
Bug Fixes