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:
- User Input: User submits a question.
-
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.
- Send the question to the LLM with the prompt:
-
Fuseki Query:
- Use the JSON response to construct and run a Fuseki query.
- Retrieve context information.
-
LangChain Integration:
- Use the retrieved context as input for LangChain.
- Generate a response to the user’s question using LangChain.
Steps:
- Capture user question.
- Send formatted question to LLM.
- Parse JSON response from LLM.
- Construct and execute Fuseki query with parsed data.
- 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.