Skip to content

Add graph DB connection management

What does this MR do and why?

Adds graph DB connection management:

  • allows opening new connections to kuzu DBs
  • keeps connection pool of existing DB connections
  • closes unused DB connections
  • adds query endpoint to webservice (querying itself will be added in a separate MR)

Related to #81 (closed)

How to set up and validate locally

  • build zoekt-indexer with make build-unified and restart gitlab-zoekt-webserver-development-* gdk services
  • on Rails side checkout gitlab!199424 (closed) and use rails console to execute some queries (this example assumes that namespace_id=34 already has kuzu DB, or you can just copy manually any kuzu DB to the expected file location):
[1] pry(main)> ::Gitlab::Ai::KnowledgeGraph::Client.new.query("anything", namespace_id: 34, node_id: 1)
#<HTTParty::Response:0x6dbc8 parsed_response={"error"=>"Querying not implemented."}, @response=#<Net::HTTPInternalServerError 500 Internal Server Error readbody=true>, @headers={"content-type"=>["application/json"], "date"=>["Thu, 07 Aug 2025 06:29:22 GMT"], "content-length"=>["38"], "connection"=>["close"]}>
Edited by Jan Provaznik

Merge request reports

Loading