Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e0971de
chore(deps): add tinylinference as a git submodule
senamakel Aug 30, 2026
98d60ba
refactor(core, module): replace tinyagents dependency with tinyinference
senamakel Aug 30, 2026
4325680
chore: files changed crates/tinymemory-core/src/embedding_adapter.rs,…
senamakel Aug 30, 2026
bb202f8
feat(embedding_adapter): add test module declaration
senamakel Aug 30, 2026
244cb69
feat(core): replace tinyagents dependency with tinyinference
senamakel Aug 30, 2026
1fae896
chore(tinymemory-module): update Cargo.lock for new dependencies
senamakel Aug 30, 2026
503a5f0
fix(chat): remove cache_identity from BusChatModel
senamakel Aug 30, 2026
7f27e36
chore(gitmodules): remove pinned branch from tinyagents submodule
senamakel Aug 30, 2026
367bd44
chore(deps): replace tinyagents submodule with tinyinference
senamakel Aug 30, 2026
a6f8e48
Remove TinyAgents from TinyMemory dependency graph
senamakel Aug 30, 2026
22c7b93
chore(license): relicense all crates from MIT to GPL-3.0-only
senamakel Aug 30, 2026
48a48e5
chore(deps): update vendor/tinycortex subproject commit
senamakel Aug 30, 2026
62c0d56
chore(deps): update vendor/tinyinference subproject commit
senamakel Aug 30, 2026
f63ab5e
chore(tinymemory-core): remove embedding adapter and its tests
senamakel Aug 30, 2026
b5e1a7c
feat(embedding, chat): switch to tinyinference Ollama model and add c…
senamakel Aug 30, 2026
1ee953c
test(chat): verify cache identity for cross-bridge chat model
senamakel Aug 30, 2026
3242147
chore(deps): update tinycortex subproject commit
senamakel Aug 30, 2026
2cddb5e
refactor(reconcile): move short_id helper into test module
senamakel Aug 30, 2026
9f46803
fix(import): reorder import to satisfy style convention
senamakel Aug 30, 2026
c77b04f
chore(tinymemory-core): remove unused test seam for ComposioHost
senamakel Aug 30, 2026
ee5e131
chore(deps): update tinycortex subproject commit
senamakel Aug 30, 2026
e0a6e30
Merge remote-tracking branch 'upstream/main' into audit-remove-tinyag…
senamakel Aug 30, 2026
eb3a47d
chore: reorder imports to follow project convention
senamakel Aug 30, 2026
6e3cf6b
chore(deps): update tinycortex subproject commit
senamakel Aug 30, 2026
8141bab
chore: update references from TinyAgents to TinyInference
senamakel Aug 30, 2026
139d6a4
chore(deps): update tinycortex subproject commit
senamakel Aug 30, 2026
e2e7538
docs(readme): update patch count from four to five in configuration g…
senamakel Aug 30, 2026
313763d
refactor(sources): move test helper short_id into the test module
senamakel Aug 30, 2026
43cd22f
docs(specs): mark tinybus-module dependency data as historical
senamakel Aug 30, 2026
f4474d1
docs(specs): reflow long lines in tinybus-module.md
senamakel Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
path = vendor/tinycortex
url = https://github.com/tinyhumansai/tinycortex.git
branch = main
[submodule "vendor/tinyagents"]
path = vendor/tinyagents
url = https://github.com/tinyhumansai/tinyagents
branch = main
[submodule "vendor/tinyinference"]
path = vendor/tinyinference
url = https://github.com/tinyhumansai/tinyinference.git
38 changes: 18 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 12 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ default-members = [
"crates/tinymemory-sync",
"crates/tinymemory-tinycortex",
]
# `vendor/` holds engine submodules (tinycortex, tinybus, tinyagents), each of
# `vendor/` holds pinned source submodules (tinycortex, tinybus,
# tinyinference), each of
# which is its own workspace with its own lockfile. Same exclusion
# `vendor/tinycortex` uses for its own nested vendor directory.
#
Expand Down Expand Up @@ -73,24 +74,19 @@ exclude = ["vendor", "crates/tinymemory-module", "worktrees"]
[patch."https://github.com/tinyhumansai/tinymemory"]
tinymemory-api = { path = "crates/tinymemory-api" }

# TinyCortex pins TinyInference by git until it is published. Collapse that git
# source onto the same checkout `tinymemory-core` resolves through crates.io so
# both crates share one trait identity.
[patch."https://github.com/tinyhumansai/tinyinference"]
tinyinference = { path = "vendor/tinyinference/crates/tinyinference" }

[patch.crates-io]
tinycortex = { path = "vendor/tinycortex" }
tinycortex-api = { path = "vendor/tinycortex/api" }
# `tinymemory-core`'s summariser and embedder factory name tinyagents' chat and
# embedding model traits. It is not published, so a standalone build of this
# workspace has to be told where it is — hence its own submodule alongside
# tinycortex and tinybus.
#
# Deliberately NOT `vendor/tinycortex/vendor/tinyagents`: the engine pins v2.1.0
# there, which predates `RECOMMENDED_OLLAMA_CONTEXT_TOKENS` that the embedder
# factory needs. Reaching through another submodule's pin also makes this
# crate's dependency an accident of the engine's, which is not a relationship
# worth having.
#
# A host that embeds this crate patches tinyagents itself — patch tables only
# apply from the workspace root being built — so this entry affects standalone
# builds and `cargo test` here, and nothing downstream.
tinyagents = { path = "vendor/tinyagents" }
# `tinymemory-core` names the provider-neutral chat and embedding contracts
# from TinyInference. It is not published, so standalone builds resolve the
# version requirement to the pinned checkout here.
tinyinference = { path = "vendor/tinyinference/crates/tinyinference" }

[profile.release]
# Cross-crate optimization and smaller, faster binaries for release builds.
Expand Down
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ crates/
workspace on purpose — see the note in `Cargo.toml`.
vendor/
├── tinycortex/ the engine, pinned as a submodule
├── tinyagents/ pinned TinyAgents submodule
├── tinyinference/ provider-neutral inference APIs, pinned as a submodule
└── tinybus/ pinned TinyBus submodule
```

Expand Down Expand Up @@ -103,8 +103,8 @@ families answer — see the engine table under


Run `git submodule update --init --recursive` after cloning. Nothing in the
workspace builds without it — `tinymemory-core` names `tinyagents` and
`tinycortex` by path through `vendor/`, so an uninitialized checkout fails at
workspace builds without it — `tinymemory-core` names `tinyinference` and
`tinycortex` by path through `vendor/`. An uninitialized checkout therefore fails at
manifest resolution rather than at compile time, which reads as a confusing
error.

Expand Down Expand Up @@ -134,7 +134,7 @@ without any `[patch]` entries.

The remote recipe above works by git because the remote adapter reaches only
published crates. The embedded engine does not: it pulls `tinycortex`,
`tinycortex-api` and `tinyagents`, none of which are published, and
`tinycortex-api` and `tinyinference`, none of which are published, and
`tinycortex-api` takes `tinymemory-api` *by git*, which cargo will resolve as a
second copy of a crate this workspace also provides by path. Patching that away
needs the crates on disk, so the embedded path is a submodule dependency until
Expand All @@ -149,21 +149,25 @@ git -C vendor/tinymemory submodule update --init --recursive
[dependencies]
tinymemory = { path = "vendor/tinymemory", features = ["tinycortex"] }

# All four are required. The first three are unpublished crates the engine
# needs; the fourth collapses `tinycortex-api`'s git dependency on
# `tinymemory-api` onto the copy in this tree — without it two distinct
# All five entries are required. The three crates.io patches resolve unpublished
# crates used by the memory layer and embedded engine. The TinyInference source
# patch collapses TinyCortex's git dependency onto that same crate identity. The
# fifth entry collapses `tinycortex-api`'s git dependency on `tinymemory-api`
# onto the copy in this tree — without it two distinct
# `tinymemory_api::MemoryEntry` types exist and the seam stops type-checking.
[patch.crates-io]
tinycortex = { path = "vendor/tinymemory/vendor/tinycortex" }
tinycortex-api = { path = "vendor/tinymemory/vendor/tinycortex/api" }
tinyagents = { path = "vendor/tinymemory/vendor/tinyagents" }
tinyinference = { path = "vendor/tinymemory/vendor/tinyinference/crates/tinyinference" }
[patch."https://github.com/tinyhumansai/tinyinference"]
tinyinference = { path = "vendor/tinymemory/vendor/tinyinference/crates/tinyinference" }
[patch."https://github.com/tinyhumansai/tinymemory"]
tinymemory-api = { path = "vendor/tinymemory/api" }
```

This exact patch set is what the reference consumer in
`crates/tinymemory/examples/` and the repository's own root manifest use; a
build missing any of the four fails at resolution, before compiling a line.
build missing any of the five fails at resolution, before compiling a line.

```rust,ignore
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymemory-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false
version = "0.1.1"
edition = "2021"
rust-version = "1.96"
license = "MIT"
license = "GPL-3.0-only"
repository = "https://github.com/tinyhumansai/tinymemory"
description = "Stable public contracts for the TinyMemory memory system"

Expand Down
2 changes: 1 addition & 1 deletion crates/tinymemory-bus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false
version = "0.1.0"
edition = "2021"
rust-version = "1.96"
license = "MIT"
license = "GPL-3.0-only"
repository = "https://github.com/tinyhumansai/tinymemory"
description = "The TinyBus wire contract for the TinyMemory module: member names, payload types, and typed calls"

Expand Down
2 changes: 1 addition & 1 deletion crates/tinymemory-conformance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish = false
version = "0.1.0"
edition = "2021"
rust-version = "1.96"
license = "MIT"
license = "GPL-3.0-only"
description = "Behavioural conformance suite every MemoryProvider driver must pass"
repository = "https://github.com/tinyhumansai/tinymemory"

Expand Down
9 changes: 5 additions & 4 deletions crates/tinymemory-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false
version = "0.1.0"
edition = "2021"
rust-version = "1.96"
license = "MIT"
license = "GPL-3.0-only"
description = "The engine-neutral memory subsystem: store, summary tree, sync pipelines, ingestion and recall"
repository = "https://github.com/tinyhumansai/tinymemory"
readme = "../../README.md"
Expand Down Expand Up @@ -37,9 +37,10 @@ regex = "1.10"
tinycortex = { version = "0.1", features = ["obsidian", "persona", "people", "sync"] }
tinycortex-api = { version = "0.1" }

# Chat-model and embedding primitives used by the tree summarizer and the
# embedding factory.
tinyagents = { version = "2.1", features = ["sqlite"] }
# Provider-neutral chat-model and embedding primitives used by the tree
# summarizer and embedding factory. Agent runtime and session behavior do not
# belong in the memory layer.
tinyinference = "0.2"
Comment thread
senamakel marked this conversation as resolved.
anyhow = "1.0"
async-trait = "0.1"
# NO `git2` HERE, DELIBERATELY — do not add it back. `diff/` holds the ops and
Expand Down
4 changes: 2 additions & 2 deletions crates/tinymemory-core/src/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use async_trait::async_trait;

use crate::chat_host::{create_chat_model_with_model_id, provider_for_role, UsageInfo};
use crate::Config;
use tinyagents::harness::message::Message;
use tinyagents::harness::model::{ChatModel, ModelRequest};
use tinyinference::message::Message;
use tinyinference::model::{ChatModel, ModelRequest};

/// One pair of prompt messages handed to the memory LLM backend.
#[derive(Debug, Clone)]
Expand Down
10 changes: 5 additions & 5 deletions crates/tinymemory-core/src/chat_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
//!
//! # Why this trait is here and not in `tinymemory-api`
//!
//! It names `tinyagents::harness::model::ChatModel`, and the contract crate is
//! deliberately dependency-light — it must not pull in tinyagents. This crate
//! already depends on tinyagents, so it is the one place that can name both the
//! model trait and the config seam. The host implements it here.
//! It names [`tinyinference::model::ChatModel`], and the contract crate is
//! deliberately dependency-light — it must not pull in an inference SDK. This
//! crate already depends on TinyInference, so it is the one place that can name
//! both the model trait and the config seam. The host implements it here.
//!
//! Reached through a process-global for the same reason as
//! [`crate::embedding_host`]; see that module for the rationale, and for why an
Expand All @@ -20,7 +20,7 @@
use std::sync::Arc;

use parking_lot::RwLock;
use tinyagents::harness::model::{ChatModel, ModelResponse};
use tinyinference::model::{ChatModel, ModelResponse};

use crate::Config;

Expand Down
14 changes: 7 additions & 7 deletions crates/tinymemory-core/src/embedding_adapter.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
//! [`TinyAgentsEmbeddingProvider`] — the adapter from tinyagents' own embedding
//! [`TinyInferenceEmbeddingProvider`] — the adapter from TinyInference's embedding
//! model trait onto the seam's [`EmbeddingProvider`].
//!
//! It lives in this crate rather than in `tinymemory-api` because the contract
//! crate must stay dependency-light and cannot name `tinyagents`; and rather
//! crate must stay dependency-light and cannot name `tinyinference`; and rather
//! than in the host because the tree's embedder factory — which is core code —
//! builds Ollama models directly and needs to wrap them. The host re-exports it
//! from `inference::embeddings`, so every existing path there keeps resolving
//! and keeps naming this one type.

use async_trait::async_trait;
use tinyagents::harness::embeddings::EmbeddingModel;
use tinyinference::embeddings::EmbeddingModel;

pub use tinymemory_api::host::{format_embedding_signature, EmbeddingProvider};

/// Compatibility adapter from the canonical tinyagents embedding model.
pub struct TinyAgentsEmbeddingProvider {
/// Compatibility adapter from the canonical TinyInference embedding model.
pub struct TinyInferenceEmbeddingProvider {
model: Box<dyn EmbeddingModel>,
}

impl TinyAgentsEmbeddingProvider {
impl TinyInferenceEmbeddingProvider {
pub fn new(model: impl EmbeddingModel + 'static) -> Self {
Self {
model: Box::new(model),
Expand All @@ -31,7 +31,7 @@ impl TinyAgentsEmbeddingProvider {
}

#[async_trait]
impl EmbeddingProvider for TinyAgentsEmbeddingProvider {
impl EmbeddingProvider for TinyInferenceEmbeddingProvider {
fn name(&self) -> &str {
self.model.name()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymemory-core/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! OpenHuman's memory subsystem migrates onto the `tinycortex` crate (store /
//! chunks / tree / retrieval / queue / ingest / score + the long tail). This
//! module is the **adapter seam**, mirroring `src/openhuman/agent/tinyagents/`: it
//! module is the **adapter seam**, mirroring the host's inference adapters: it
//! implements the crate's engine traits over OpenHuman services and derives the
//! engine's [`tinycortex::memory::MemoryConfig`] from the host `Config`. Nothing here contains
//! engine logic — that lives in the crate.
Expand Down
13 changes: 0 additions & 13 deletions crates/tinymemory-core/src/sources/reconcile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,6 @@ pub async fn apply_composio_source_caps_migration() -> Result<(), String> {
Ok(())
}

#[cfg(test)]
fn short_id(id: &str) -> &str {
// Show only the last 8 Unicode scalar values to keep labels compact.
// Byte-slicing would panic if the cut point isn't a UTF-8 boundary.
let n = id.chars().count();
if n <= 8 {
return id;
}
let skip = n - 8;
let start = id.char_indices().nth(skip).map(|(idx, _)| idx).unwrap_or(0);
&id[start..]
}

#[cfg(test)]
#[path = "reconcile_tests.rs"]
mod tests;
12 changes: 12 additions & 0 deletions crates/tinymemory-core/src/sources/reconcile_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
use super::*;
use crate::sources::types::{MemorySourceEntry, SourceKind};

fn short_id(id: &str) -> &str {
// Show only the last 8 Unicode scalar values to keep labels compact.
// Byte-slicing would panic if the cut point isn't a UTF-8 boundary.
let n = id.chars().count();
if n <= 8 {
return id;
}
let skip = n - 8;
let start = id.char_indices().nth(skip).map(|(idx, _)| idx).unwrap_or(0);
&id[start..]
}

fn make_composio_entry(
id: &str,
toolkit: &str,
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymemory-core/src/store/factories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use rusqlite::Connection;
use crate::embedding_host::require_embedding_host;
use crate::store::namespace_store::UnifiedMemory;
use crate::traits::Memory;
use tinyagents::harness::embeddings::{DEFAULT_OLLAMA_DIMENSIONS, DEFAULT_OLLAMA_MODEL};
use tinyinference::embeddings::{DEFAULT_OLLAMA_DIMENSIONS, DEFAULT_OLLAMA_MODEL};
use tinymemory_api::host::MemoryConfig;
use tinymemory_api::host::{format_embedding_signature, EmbeddingProvider};
use tinymemory_api::host::{EmbeddingRouteConfig, StorageProviderConfig};
Expand Down
Loading