@@ -84,23 +84,15 @@ export class MemoryManager {
84
84
}
85
85
86
86
async getMemoryByContent ( content : string ) : Promise < SimilaritySearch [ ] > {
87
- const opts = {
88
- query_table_name : this . tableName ,
89
- query_threshold : 2 ,
90
- query_input : content ,
91
- query_field_name : 'content' ,
92
- query_field_sub_name : 'content' ,
93
- query_match_count : 10 ,
94
- } ;
95
-
96
- if ( ! this . runtime || 'undefined' === typeof this . runtime . supabase ) {
97
- return [ ] ;
98
- }
99
- const result = await this . runtime . supabase . rpc ( "get_embedding_list" , opts ) ;
100
- if ( result . error ) {
101
- throw new Error ( JSON . stringify ( result . error ) ) ;
102
- }
103
- return result . data ;
87
+ const result = await this . runtime . databaseAdapter . getMemoryByContent ( {
88
+ query_table_name : this . tableName ,
89
+ query_threshold : 2 ,
90
+ query_input : content ,
91
+ query_field_name : "content" ,
92
+ query_field_sub_name : "content" ,
93
+ query_match_count : 10 ,
94
+ } ) ;
95
+ return result ;
104
96
}
105
97
106
98
/**
@@ -129,6 +121,11 @@ export class MemoryManager {
129
121
unique,
130
122
} = opts ;
131
123
124
+ console . log ( "embedding length to search is" , embedding . length ) ;
125
+
126
+ console . log ( "opts are" , opts ) ;
127
+ console . log ( opts ) ;
128
+
132
129
const result = await this . runtime . databaseAdapter . searchMemories ( {
133
130
tableName : this . tableName ,
134
131
userIds : userIds ,
@@ -138,6 +135,8 @@ export class MemoryManager {
138
135
unique : ! ! unique ,
139
136
} ) ;
140
137
138
+ console . log ( "result.embedding.length" , result [ 0 ] ?. embedding ?. length ) ;
139
+
141
140
return result ;
142
141
}
143
142
0 commit comments