Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUvaac9f6b8d93a
diff --git a/.claude/helpers/context-persistence-hook.mjs b/.claude/helpers/context-persistence-hook.mjs
index 9198e8bc65..e6c655b552 100644
--- a/.claude/helpers/context-persistence-hook.mjs
+++ b/.claude/helpers/context-persistence-hook.mjs
@@ -275,6 +275,7 @@ class SQLiteBackend {
/**
* Cosine similarity search across all entries with embeddings.
+ * Handles both 384-dim (ONNX) and 768-dim (legacy hash) embeddings.
* Returns top-k entries ranked by similarity to the query embedding.
*/
semanticSearch(queryEmbedding, k = 10, namespace) {
@@ -282,12 +283,15 @@ class SQLiteBackend {
'SELECT id, embedding, summary, session_id, chunk_index, confidence, access_count FROM transcript_entries WHERE namespace = ? AND embedding IS NOT NULL'
).all(namespace || NAMESPACE);
+ const queryDim = queryEmbedding.length;
const scored = [];
for (const row of rows) {
if (!row.embedding) continue;
const stored = new Float32Array(row.embedding.buffer, row.embedding.byteOffset, row.embedding.byteLength / 4);
+ // Only compare if dimensions match
+ if (stored.length !== queryDim) continue;
let dot = 0;
- for (let i = 0; i < queryEmbedding.length && i < stored.length; i++) {
+ for (let i = 0; i < queryDim; i++) {
dot += queryEmbedding[i] * stored[i];
}
// Boost by confidence (self-learning signal)