Support managed and self-hosted Cognee and Supermemory - #17
Conversation
The tinycortex vendored dependency is advanced to commit be7b395, incorporating upstream fixes and improvements. No local changes are required. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Warning Review limit reached
Next review available in: 44 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
tinysweeper found nothing blocking. Approving.
$0.1392 · 238,420 in / 50,770 out · 20,224 cached (8%) · openrouter/openai/text-embedding-3-small, deepseek/deepseek-v4-pro-0813 · 738 embedded
critique: $0.0729 · 119,035 in / 29,569 out · 10,624 cached (9%) · deepseek/deepseek-v4-pro-0813
security: $0.0433 · 87,763 in / 8,961 out · 6,272 cached (7%) · deepseek/deepseek-v4-pro-0813
tests: $0.0122 · 20,067 in / 4,779 out · 1,664 cached (8%) · deepseek/deepseek-v4-pro-0813
description: $0.0108 · 11,555 in / 7,461 out · 1,664 cached (14%) · deepseek/deepseek-v4-pro-0813
| supermemory https://api.supermemory.ai "$SUPERMEMORY_API_KEY" | ||
|
|
||
| cargo run -p tinymemory-remote --example conformance -- \ | ||
| cognee-api https://api.cognee.ai "$COGNEE_API_KEY" |
There was a problem hiding this comment.
Use the correct cognee driver identifier, not cognee-api
The earlier self-hosted example on line 24 invokes -- cognee http://localhost:8001. The managed-service example uses cognee-api, which is a different driver identifier and will cause the conformance command to reject the unknown driver. The Cognée adapter exposes a single driver (cognee); there is no separate cognee-api variant. Change cognee-api to cognee so the command works.
[RULE] incorrect-driver-identifier ·
| use tinymemory_remote::{SupermemoryMemory, supermemory_provider}; | ||
|
|
||
| let memory = SupermemoryMemory::new("http://localhost:6767", Some("sm_..."))?; | ||
| let memory = SupermemoryMemory::self_hosted("http://localhost:6767", "sm_...")?; |
There was a problem hiding this comment.
Restore new or add the new constructors before documenting them
The README example changes the constructor from SupermemoryMemory::new to SupermemoryMemory::self_hosted, and adds cloud and api constructors for both adapters. However, the repository context shows existing code calling SupermemoryMemory::new and CogneeMemory::new, and no evidence of self_hosted, cloud, or api methods. These examples will not compile for users following them. Update the README after the corresponding Rust code is added or revert the example to use the existing new constructor.
[RULE] doc-example-mismatch ·
| /// Encodes a TinyMemory namespace as a collision-free Cognee dataset name. | ||
| fn dataset_name(namespace: &str) -> String { | ||
| format!("tinymemory__{}", encode(namespace)) | ||
| format!("tinymemory__{}", stable_id("dataset", namespace)) |
There was a problem hiding this comment.
Preserve existing dataset names when switching ID encoding
Changing the dataset name from format!("tinymemory__{}", encode(namespace)) to format!("tinymemory__{}", stable_id("dataset", namespace)) alters the generated dataset identifiers. Existing Cognee deployments that stored data under the old naming scheme will no longer match datasets, causing stored records to be invisible and possibly duplicated on re-upload. Consider a migration strategy or keep the previous encoding for existing namespaces.
[RULE] backward-compat ·
How this change flows5 changed behaviours across 14 relationships. 6 surrounding behaviours are shown (60 graph nodes walked). 45 further behaviours left out to keep the diagram readable. flowchart LR
n0["main<br/>changed"]:::changed
n1["CogneeDialect<br/>changed<br/>1 finding"]:::flagged
n2["CogneeMemory<br/>changed<br/>1 finding"]:::flagged
n3["Dataset<br/>changed<br/>1 finding"]:::flagged
n4["...ognee_round_trips_the_tinymemory_contract<br/>changed"]:::changed
n5["json"]:::impacted
n6["audit_provider"]:::impacted
n7["Memory"]:::impacted
n8["..._mem0_round_trips_the_tinymemory_contract"]:::impacted
n9["serve"]:::impacted
n10["dataset_entries"]:::impacted
n0 -->|calls| n6
n2 -->|uses| n1
n2 -->|implements| n7
n4 -->|uses| n2
n4 -->|calls| n6
n4 -->|tests| n6
n4 -->|calls| n9
n4 -->|tests| n9
n8 -->|calls| n6
n8 -->|tests| n6
n8 -->|calls| n9
n8 -->|tests| n9
n10 -->|uses| n3
n10 -->|calls| n5
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge. |
Summary
Add production-ready Cognee and Supermemory adapters that conform to the standard
Memoryinterface. Both adapters now support managed APIs with credentials and self-hosted endpoints, translate arbitrary TinyMemory namespaces into provider-safe identifiers, and use each provider’s documented create, search, update, list, and delete behavior.Related issue
None.
API or behavior changes
Additive public API changes:
api,cloud, andself_hostedconstructors plusCOGNEE_API_ENDPOINT; managed authentication usesX-Api-Keyand self-hosted authentication supports an optional bearer token.api,cloud, andself_hostedconstructors plusSUPERMEMORY_API_ENDPOINT; both deployment modes support bearer credentials.newconstructors remain available as self-hosted aliases.No breaking changes.
Validation
Commands actually run, with their outcome:
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo build --all-targets --all-featurescargo test --all-featuresAll passed locally.
Tests
Expanded deterministic mock-server coverage for both adapters, including managed and self-hosted authentication, credential redaction, blank-key rejection, arbitrary Unicode and long namespace/key mapping, update/upsert behavior, search translation, interface conformance, and full memory round trips. Live provider calls remain intentionally outside the default test suite because repository tests must be network-independent.
Documentation
Updated the root README, remote-engine integration guide, and conformance example with managed and self-hosted setup for both providers.
Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description