Connect RAG to SQL Agent #1202
Unanswered
ravitejajasti
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
-
I am following the SQLAgent tutorial from Langgraph and adding RAG to it.
The idea is that we use RAG to fetch relevant DB table info and make the SQL agent job easier in finding the right table as well as in creating the correct query. However, I am really not sure if I am doing it right. I get errors when I try integrating RAG with SQL Agent.
I am new to Langchain and Langgraph and I believe some of the errors I get are basic.
To retrieve documents, I am using a custom tool
`
@tool
def retrieve_documents(state):
"""Retrieve documents from the vector store based on the query."""
docsearch = OpenSearchVectorSearch(index_name='sqlstruc_slim', # TODO: use the same index-name used in the ingestion script
embedding_function=LiteLLMEmbedder(),
opensearch_url= 'https://' + opensearch_details['host'] + f":{opensearch_details['port']}",
http_auth=(opensearch_details['creds_user'], opensearch_details['creds_pass']),
use_ssl=True,
verify_certs=opensearch_details['verify_certs'],
ssl_assert_hostname=False,
ssl_show_warn=False,
)
`
and my workflow looks like this.
`
Define a new graph
Beta Was this translation helpful? Give feedback.
All reactions