-
Notifications
You must be signed in to change notification settings - Fork 0
Request: Embedded Prime RecallEngine documentation + integration guide #127
Description
Context
We're building Longhand, a Tauri 2 desktop app that uses allsource-core (currently 0.13.1) with embedded + embedded-projections features for all persistence. We want to upgrade to 0.17.1 and adopt Prime for agent memory.
Current Pain
Our cross-project context retrieval does O(n) brute-force cosine similarity over all workflow outputs on every skill execution:
- Generates embedding via external OpenAI API call
- Loads all outputs from an AllSource projection
- Computes cosine similarity against every one
- Returns top 5
This works at small scale but degrades at thousands of outputs, and depends on an external embedding API.
What We Want From Prime
- Embedded RecallEngine — use
prime-fullorprime-recallfeature to get tiered retrieval (L0/L1/L2) without running a separate MCP server - Replace O(n) cosine search with HNSW via
VectorIndexProjection - Local embeddings via
fastembedto eliminate external API dependency - Cross-execution learning via graph projections
Requests
-
Documentation for embedded Prime usage — the current docs focus on the MCP server (
allsource-primecrate). We need a guide for usingPrime::open()+RecallEngineas an embedded library within a Tauri app. -
Migration guide from EmbeddedCore to Prime — can
Prime::from_core()wrap an existingEmbeddedCoreinstance? Or do we need to initializePrimeseparately and register its projections alongside our existing 39 domain projections? -
VectorIndexProjection usage example — how to ingest embeddings, query by similarity, and integrate with the existing projection system.
-
fastembed model selection — which model is recommended for short-form content (skill outputs, 100-500 chars)? What's the cache size impact?
-
Tiered recall configuration — how to configure L0/L1/L2 token budgets and what
IndexConfigoptions are available?
Environment
allsource-core0.13.1 → upgrading to 0.17.1allframe-core0.1.25 /allframe-tauri0.1.25- Rust 1.94.0, edition 2021
- 39 domain-specific projections registered on
EmbeddedCore - macOS desktop app (Tauri 2)
Relevant Code
Our current brute-force search (~70 lines we want to replace with a single RecallEngine call):
pub(crate) async fn retrieve_cross_project_context(
skill_prompt: &str,
project_scope: Option<&[String]>,
) -> Option<String> {
let all_outputs = workflow_outputs_store::list_all_outputs();
if all_outputs.is_empty() { return None; }
let embed_config = embedding::EmbeddingConfig::from_env_async().await;
let query_embedding = embedding::generate_embedding(skill_prompt, &embed_config).await?;
// O(n) cosine similarity over ALL outputs
let mut candidates: Vec<(f64, String)> = Vec::new();
for output in all_outputs {
if output.embedding.is_empty() { continue; }
let similarity = cosine_similarity(&query_embedding, &output.embedding);
candidates.push((similarity, output.content));
}
candidates.sort_by(|a, b| b.0.partial_cmp(&a.0).unwrap());
candidates.truncate(5);
// ... format as context string
}We'd love to replace this with:
let context = recall.context(skill_prompt, ContextTier::L2).await?;