Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrective RAG fails with error 422 when tavily web search is needed #381

Open
n30tri8 opened this issue Aug 26, 2024 · 2 comments
Open

Comments

@n30tri8
Copy link

n30tri8 commented Aug 26, 2024

I am running the code in a node env using node --env-file .env --import=tsx src/corrective-RAG.ts.

Normal flow when retrieved docs are relevant work with no error. When it goes for a web search, I get the error:
Error: Request failed with status code 422: undefined

It seems after transforming query, the new query is not received correctly in function call const docs = await tool.invoke({query: state.question});. When I debug it, it shows the query arg is null, hence Tavily tool call results in that exception.

I also tried compiling with tsc, the same happended.

@langchain-ai langchain-ai deleted a comment Aug 26, 2024
@langchain-ai langchain-ai deleted a comment Aug 26, 2024
@bracesproul
Copy link
Collaborator

@n30tri8 are you talking about this notebook? examples/rag/langgraph_crag.ipynb

If so, i would assume it's an issue with your API keys or something simliar, I just ran the notebook and it worked as expected (langsmith trace)

@n30tri8
Copy link
Author

n30tri8 commented Aug 26, 2024

Yes, I am trying to get this code running.
As I saw in your langsmith trace, you asked for information that was available in the context; hence, RAG find relevant information and does not trigger web-search tool call.
Can you try to ask for information not available in the online blog. I tried with "When did human land on moon?"

I can call tavily api search with my API key. I get error code 422, which is consistent with the fact that tavily API is called with empty argument query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@bracesproul @n30tri8 and others