MCPcopy Create free account
hub / github.com/clockworknowledge/menome_processor / add_chunk

Function add_chunk

app/routers/utils.py:187–195  ·  view source on GitHub ↗
(tx, parent_uuid, properties)

Source from the content-addressed store, hash-verified

185 return tx.run(query, {"doc_uuid": doc_uuid, **properties}).single()["p"]
186
187def add_chunk(tx, parent_uuid, properties):
188 query = (
189 "MATCH (p {uuid: $parent_uuid}) "
190 "CREATE (cu:Child {uuid: $uuid, name: $name, text: $text}) "
191 "MERGE (p)-[:HAS_CHILD]->(cu) "
192 "with cu CALL db.create.setVectorProperty(cu, 'embedding', $embedding) YIELD node as c "
193 "RETURN c"
194 )
195 return tx.run(query, {"parent_uuid": parent_uuid, **properties}).single()["c"]
196
197def setupSourceChunks(tx):
198 query1="""match (c:Chunk)-[]-(p:Page)-[]-(d:Document) where c.source is null

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected