396 questions
1
vote
1
answer
98
views
agent.invoke() with Gemini gives inconsistent output types
I am using the LangChain 1.0 new agent = create_agent() method to create an agent but I am getting inconsistent output response types.
Case 1: str as output
When the user query is simple such as "...
0
votes
1
answer
407
views
ModuleNotFoundError when importing ConversationBufferMemory and ConversationalRetrievalChain from LangChain
I'm trying to import ConversationBufferMemory and ConversationalRetrievalChain in my Python notebook as follows:
from langchain.memory import ConversationBufferMemory
from langchain.chains import ...
0
votes
1
answer
59
views
passing input_variables to Prompt template in langchain
I have code below in ReAct prompt template. I have input_variables like tools, tool_names, etc. But when we are calling, not all input_variables are passed. Then, to my understanding, it should throw ...
0
votes
0
answers
70
views
Langchain: How to let an AgentExecutor Propagate RunnableConfig["configurable"] to @tool?
I'm encountering a critical issue using LangChain's AgentExecutor where a dynamic, per-call variable passed via the config dictionary is not being propagated to a custom @tool called by the agent. ...
1
vote
0
answers
54
views
Why does my LangChain RAG chatbot sometimes miss relevant chunks in semantic search?
I built a RAG chatbot using LangChain + ChromaDB + OpenAI embeddings. The pipeline works, but sometimes the chatbot doesn’t return the most relevant PDF content, even though it exists in the vector DB....
0
votes
0
answers
70
views
How to let Gitlab/Langchain continue finding file?
I want to use Langchain to automatically update a helm chart via Gitlab-Python API. I realise it might work without langchain/llm with a more deterministic approach. However, i use it for testing ...
2
votes
2
answers
617
views
ValueError: variable agent_scratchpad should be a list of base messages, got of type <class 'str'>
This is a very basic example how I am trying to use langchain to invoke a llm and find the tool to use:
import asyncio
import json
from langchain.agents import AgentExecutor, ...
0
votes
1
answer
66
views
LangChain FAISS similarity_search returns empty list despite populated index
I’m trying to use LangChain with FAISS to build a simple document retriever. I’ve indexed several documents, but when I call similarity_search, I always get an empty list.
from langchain.embeddings....
1
vote
1
answer
82
views
How to find package version that is compatible with other package [closed]
How can I find the package version that can work with other package requirement. For my case, I have hard requirement for numpy==1.24.4 and I am looking to install langchain-core which the latest ...
0
votes
0
answers
54
views
LangChain - SQLDatabaseToolkit not join tables as expected
I have an agent with LangChain.
I have a database with these tables:
CREATE TABLE teams (
team_id INT PRIMARY KEY,
team_name VARCHAR(50) UNIQUE NOT NULL,
coach VARCHAR(50) NOT NULL
);
...
1
vote
1
answer
265
views
Running Ollama as a k8s STS with external script as entrypoint to load models
I manage to run Ollama as a k8s STS. I am using it for Python Langchain LLM/RAG application. However the following Dockerfile ENTRYPOINT script which tries to pull a list of images exported as MODELS ...
0
votes
0
answers
360
views
Google VertexAI InvalidArgument: 400 Request contains an invalid argument
I am using Google VertexAI gemini-2.0-flash with LangChain. I keep getting InvalidArgument: 400 Request contains an invalid argument error when making ainvoke, astream and with_structured_output to ...
0
votes
0
answers
26
views
Trying to deploy my first modal app with a chrona database but the data is not being used. Need help debugging retrieveInfoForQuery function?
I am having trouble figuring out why I can't see the print statements in the terminal for my retrieveInfoForQuery function and trying to figure out what is wrong. I have verified the chroma db is on ...
0
votes
1
answer
635
views
Facing ModuleNotFoundError: No module named 'ragas.metrics.critique'
I am getting below error when running the code snippet in AWS sagemaker JupyterLab notebook:
ModuleNotFoundError: No module named 'ragas.metrics.critique'
import warnings
warnings.filterwarnings('...
1
vote
1
answer
294
views
RegexTextSplitter does not exist in langchain_text_splitters?
Trying to import RegexTextSplitter using
from langchain.text_splitter import RegexTextSplitter ,RecursiveCharacterTextSplitter
And I get the error
from langchain.text_splitter import RegexTextSplitter ...