Skip to content

Fuseki Query Builder to generate Context for LLM

Issue: Build a Fuseki Query

Objective: Create a process to build and execute a Fuseki query based on user input.

Description:

  1. User Input: User submits a question.
  2. LLM Interaction:
    • Send the question to the LLM with the prompt:
      "Please find Image, Artist, etc., from this question: $Question and return in JSON format."
    • Receive relevant information in JSON format.
  3. Fuseki Query:
    • Use the JSON response to construct and run a Fuseki query.
    • Retrieve context information.
  4. LangChain Integration:
    • Use the retrieved context as input for LangChain.
    • Generate a response to the user’s question using LangChain.

Steps:

  1. Capture user question.
  2. Send formatted question to LLM.
  3. Parse JSON response from LLM.
  4. Construct and execute Fuseki query with parsed data.
  5. Use retrieved context in LangChain to answer the user’s question.

Expected Outcome:

  • User questions are transformed into structured Fuseki queries, retrieving context information to enhance responses generated by LangChain.