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

rUv85e8780c8ea8
diff --git a/v3/@claude-flow/memory/src/hybrid-backend.ts b/v3/@claude-flow/memory/src/hybrid-backend.ts
index eb7c2ee588..0782d36709 100644
--- a/v3/@claude-flow/memory/src/hybrid-backend.ts
+++ b/v3/@claude-flow/memory/src/hybrid-backend.ts
@@ -375,12 +375,31 @@ export class HybridBackend extends EventEmitter implements IMemoryBackend {
}
const searchResults = await this.agentdb.search(embedding, {
- k: query.k || 10,
+ k: (query.k || 10) * 2, // Over-fetch to account for post-filtering
threshold: query.threshold || this.config.semanticThreshold,
filters: query.filters as MemoryQuery | undefined,
});
- return searchResults.map((r) => r.entry);
+ let entries = searchResults.map((r) => r.entry);
+
+ // Apply tag/namespace/type filters that AgentDB may not enforce
+ if (query.filters) {
+ const f = query.filters as Record<string, unknown>;
+ if (f.tags && Array.isArray(f.tags)) {
+ const requiredTags = f.tags as string[];
+ entries = entries.filter((e) =>
+ requiredTags.every((t) => e.tags.includes(t))
+ );
+ }
+ if (f.namespace && typeof f.namespace === 'string') {
+ entries = entries.filter((e) => e.namespace === f.namespace);
+ }
+ if (f.type && typeof f.type === 'string' && f.type !== 'semantic') {
+ entries = entries.filter((e) => e.type === f.type);
+ }
+ }
+
+ return entries.slice(0, query.k || 10);
}
/**