Customization options for final LLM prompt? #3682
Unanswered
MaticBernik
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am implementing a RAG assistant for code generation workflow.
My search pipeline relies on the "retrieval_augmented_generation" processor.
I have written the instructions/prompts for the LLM and have set the "system_prompt" and "user_instructions" fields accordingly. The search pipeline works, but there are some issues:
I want more control over how the context retrieved from the RAG is combined with the "system_prompt" and "user_instructions".
To some degree I have addressed this by dedicating a special field in my index (named "contextualRepresentation"), which is the only field that I send to the llm ("context_field_list": ["contextualRepresentation"]) as this is my way to inject the relevant resources in a structured manner (a bit like toString).
This feels hacky and does not give me the control over where in the "user_instructions" prompt should the RAG context be inserted and how.
Can someone point me in the direction of better solution?
I was looking at all the information that is being stored in the index about conversational messages (GET /_plugins/_ml/memory/{memory_id}/messages/), yet I am not certain how the historical messages are being inserted into the final prompt that is being sent to the LLM.
To be more specific - I doubt that the LLM has the access to the Contextual information of the previous messages. For example: When I instruct the LLM to show all the customers that bought the car branded VW the LLM generates a flawless query as the context retrieved by RAG based on the user's query is relevant. But If I follow-up by demanding for making some adjustments to the previously generated query (i.e. "Can you count them"), the current context retrieved by RAG will be a total mess and LLM would need (if even) to use the historical contextual resources that were retrieved from the index when generating the previous message.
So to sum it up:
What are my options to review the structure of the request or more specifically the final prompt that is being sent to the chatGPT (with the emphasis on context and memory/chat history) and what customization options are available to me?
Beta Was this translation helpful? Give feedback.
All reactions