Description of the Bug
In backend/app/rag/agent.py, line 14, the module imports from a package called langchain_classic which does not exist on PyPI:
from langchain_classic.agents import create_react_agent, AgentExecutor
There is no standard Python package named langchain_classic available on PyPI. When agent.py is imported or loaded by the application (which happens during Celery worker initialization or when the RAG pipeline is used), this import raises:
ModuleNotFoundError: No module named 'langchain_classic'
Also on line 16:
from langchain_core.prompts import PromptTemplate
The import path langchain_core requires langchain >= 0.3. If the installed version is older, this will also fail.
The requirements.txt lists langchain-classic as a dependency. However, searching PyPI shows no package by this name exists. There is an archived langchain-classic package on GitHub but it is not published to PyPI and is deprecated/removed.
Steps to Reproduce
- Clone the repository and install dependencies:
pip install -r backend/requirements.txt
- Try to import or start the Celery worker
- Observe
ModuleNotFoundError: No module named 'langchain_classic'
Expected Behavior
The import should use a real, installable package. The correct import for create_react_agent and AgentExecutor in modern langchain (v0.1+) is:
from langchain.agents import create_react_agent, AgentExecutor
Or for langchain v0.3+:
from langchain.agents import create_react_agent, AgentExecutor
Impact
This import failure prevents the entire RAG agent pipeline from functioning. The application may start (if agent.py is not imported at startup), but any Celery task or chat endpoint that triggers agent logic will crash with ModuleNotFoundError.
Affected File
backend/app/rag/agent.py (lines 14, 16)
Suggested Fix
Update the imports to use the correct langchain package paths and update requirements.txt to pin a compatible langchain version.
GSSoC '26
Description of the Bug
In
backend/app/rag/agent.py, line 14, the module imports from a package calledlangchain_classicwhich does not exist on PyPI:There is no standard Python package named
langchain_classicavailable on PyPI. Whenagent.pyis imported or loaded by the application (which happens during Celery worker initialization or when the RAG pipeline is used), this import raises:Also on line 16:
The import path
langchain_corerequires langchain >= 0.3. If the installed version is older, this will also fail.The
requirements.txtlistslangchain-classicas a dependency. However, searching PyPI shows no package by this name exists. There is an archivedlangchain-classicpackage on GitHub but it is not published to PyPI and is deprecated/removed.Steps to Reproduce
pip install -r backend/requirements.txtModuleNotFoundError: No module named 'langchain_classic'Expected Behavior
The import should use a real, installable package. The correct import for
create_react_agentandAgentExecutorin modern langchain (v0.1+) is:Or for langchain v0.3+:
Impact
This import failure prevents the entire RAG agent pipeline from functioning. The application may start (if
agent.pyis not imported at startup), but any Celery task or chat endpoint that triggers agent logic will crash withModuleNotFoundError.Affected File
backend/app/rag/agent.py(lines 14, 16)Suggested Fix
Update the imports to use the correct langchain package paths and update
requirements.txtto pin a compatible langchain version.GSSoC '26