MCPcopy Create free account
hub / github.com/KnowledgeXLab/LeanRAG / search_nodes

Function search_nodes

database_utils.py:339–350  ·  view source on GitHub ↗
(entity_set,working_dir)

Source from the content-addressed store, hash-verified

337 res.append(ret[0])
338 return res
339def search_nodes(entity_set,working_dir):
340 db = pymysql.connect(host='localhost',port=4321, user='root',
341 passwd='123', charset='utf8mb4')
342 res=[]
343 db_name=os.path.basename(working_dir)
344 cursor = db.cursor()
345 for entity in entity_set:
346 sql=f"select * from {db_name}.entities where entity_name=%s and level=0"
347 cursor.execute(sql,(entity,))
348 ret=cursor.fetchall()
349 res.append(ret[0])
350 return res
351def get_text_units(working_dir,chunks_set,chunks_file,k=5):
352 db_name=os.path.basename(working_dir)
353 chunks_list=[]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected