MCPcopy Create free account
hub / github.com/NanGePlus/LightRAGTest / query

Method query

LightRAG/lightrag/storage.py:115–126  ·  view source on GitHub ↗
(self, query: str, top_k=5)

Source from the content-addressed store, hash-verified

113 return results
114
115 async def query(self, query: str, top_k=5):
116 embedding = await self.embedding_func([query])
117 embedding = embedding[0]
118 results = self._client.query(
119 query=embedding,
120 top_k=top_k,
121 better_than_threshold=self.cosine_better_than_threshold,
122 )
123 results = [
124 {**dp, "id": dp["__id__"], "distance": dp["__metrics__"]} for dp in results
125 ]
126 return results
127
128 @property
129 def client_storage(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected