MCPcopy Index your code
hub / github.com/CaviraOSS/OpenMemory / query

Method query

sdk-js/src/index.ts:200–221  ·  view source on GitHub ↗
(query: string, options: {
        k?: number;
        userId?: string;
        filters?: {
            sectors?: string[];
            minSalience?: number;
            user_id?: string;
            startTime?: number;
            endTime?: number;
        };
    } = {})

Source from the content-addressed store, hash-verified

198 }
199
200 async query(query: string, options: {
201 k?: number;
202 userId?: string;
203 filters?: {
204 sectors?: string[];
205 minSalience?: number;
206 user_id?: string;
207 startTime?: number;
208 endTime?: number;
209 };
210 } = {}): Promise<any[]> {
211 if (this.mode === 'remote') {
212 return this._remoteQuery(query, options);
213 }
214
215 const filters = {
216 ...options.filters,
217 user_id: options.filters?.user_id || options.userId
218 };
219
220 return await hsg_query(query, options.k || 10, filters);
221 }
222
223 async delete(id: string): Promise<void> {
224 if (this.mode === 'remote') {

Callers 15

test_memory_operationsFunction · 0.95
testMemoryOperationsFunction · 0.95
sector_exampleFunction · 0.95
basic_exampleFunction · 0.95
advanced_exampleFunction · 0.95
benchmarkFunction · 0.95
sectorExampleFunction · 0.95
basicExampleFunction · 0.95
advancedExampleFunction · 0.95
execFunction · 0.45
db.tsFile · 0.45
initFunction · 0.45

Calls 2

_remoteQueryMethod · 0.95
hsg_queryFunction · 0.90

Tested by 2

test_memory_operationsFunction · 0.76
testMemoryOperationsFunction · 0.76