MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / search

Method search

javascript/src/lib.rs:249–263  ·  view source on GitHub ↗
(
        &self,
        query: String,
        scope: Option<JsScope>,
        top_k: Option<u32>,
    )

Source from the content-addressed store, hash-verified

247 /// Search for memories similar to a query.
248 #[napi]
249 pub async fn search(
250 &self,
251 query: String,
252 scope: Option<JsScope>,
253 top_k: Option<u32>,
254 ) -> Result<Vec<JsScoredMemory>> {
255 let core_scope = js_scope_to_core(scope);
256 let results = self
257 .service
258 .search(&query, &core_scope, top_k.unwrap_or(10) as usize)
259 .await
260 .map_err(to_napi_error)?;
261
262 Ok(results.into_iter().map(core_scored_to_js).collect())
263 }
264
265 /// Get a single memory by ID.
266 #[napi]

Callers 9

categorize_commitMethod · 0.45
extract_pr_numberMethod · 0.45
get_current_versionsFunction · 0.45
get_current_versionsFunction · 0.45
extract_first_json_arrayFunction · 0.45
search_faiss_indexFunction · 0.45

Calls 1

js_scope_to_coreFunction · 0.85

Tested by 2