@tpsdev-ai/flair-client 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +1 -0
- package/dist/client.js +4 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
package/dist/client.js
CHANGED
|
@@ -93,7 +93,9 @@ class MemoryApi {
|
|
|
93
93
|
// is unreliable (e.g., "ok", "thanks" would match each other)
|
|
94
94
|
if (opts.dedup && content.length >= 20) {
|
|
95
95
|
const threshold = opts.dedupThreshold ?? 0.95;
|
|
96
|
-
|
|
96
|
+
// Use raw scoring to avoid retrieval-boost feedback loop where repeated
|
|
97
|
+
// dedup checks inflate scores above the threshold.
|
|
98
|
+
const existing = await this.search(content, { limit: 1, minScore: threshold, scoring: "raw" });
|
|
97
99
|
if (existing.length > 0) {
|
|
98
100
|
// Return the existing memory instead of creating a duplicate
|
|
99
101
|
const match = await this.get(existing[0].id);
|
|
@@ -118,7 +120,7 @@ class MemoryApi {
|
|
|
118
120
|
}
|
|
119
121
|
/** Search memories by meaning. */
|
|
120
122
|
async search(query, opts = {}) {
|
|
121
|
-
const result = await this.client.request("POST", "/SemanticSearch", { agentId: this.client.agentId, q: query, limit: opts.limit ?? 5 });
|
|
123
|
+
const result = await this.client.request("POST", "/SemanticSearch", { agentId: this.client.agentId, q: query, limit: opts.limit ?? 5, scoring: opts.scoring });
|
|
122
124
|
const minScore = opts.minScore ?? 0;
|
|
123
125
|
return (result.results ?? [])
|
|
124
126
|
.map((r) => ({
|
package/package.json
CHANGED