I am trying to build a local RAG application using Langflow. For my vectore store, I want to use a local Weaviate instance, hosted in a separate docker container on the same network. Building the Weaviate component in Langflow fails, and throws an error:
Error Building Component
Error building Component Weaviate: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /v1/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb2a2db9fa0>: Failed to establish a new connection: [Errno 111] Connection refused'))
My setup: Docker for Desktop v4.31.1 on Windows Compose file:
version: "3.9"
name: proto_rag
services:
langflow:
image: langflowai/langflow:1.0-alpha
ports:
- "7860:7860"
depends_on:
- postgres
environment:
- LANGFLOW_DATABASE_URL=postgresql://langflow:langflow@postgres:5432/langflow
# This variable defines where the logs, file storage, monitor data and secret keys are stored.
- LANGFLOW_CONFIG_DIR=app/langflow
volumes:
- langflow-data:/app/langflow
postgres:
image: postgres:16
environment:
POSTGRES_USER: langflow
POSTGRES_PASSWORD: langflow
POSTGRES_DB: langflow
ports:
- "5432:5432"
volumes:
- langflow-postgres:/var/lib/postgresql/data
weaviate:
command:
- --host
- 0.0.0.0
- --port
- '8080'
- --scheme
- http
image: cr.weaviate.io/semitechnologies/weaviate:1.25.4
ports:
- 8080:8080
- 50051:50051
volumes:
- weaviate_data:/var/lib/weaviate
restart: on-failure:0
environment:
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
DISABLE_TELEMETRY: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
DEFAULT_VECTORIZER_MODULE: 'text2vec-ollama'
ENABLE_MODULES: 'text2vec-ollama'
CLUSTER_HOSTNAME: 'node1'
ollama:
volumes:
- ollama:/root/.ollama
ports:
- 11434:11434
container_name: ollama
image: ollama/ollama
volumes:
langflow-postgres:
langflow-data:
ollama:
weaviate_data:
My weaviate component in Langflow calls http://localhost:8080
and has the variable "index name" set to "vector_store".
Connecting to ollama on localhost works, so it doesn't seem to be a network problem. However since AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED
is set true
I can't see a reason why weaviate would refuse the connection.
I tried setting up users and API keys in the compose file and using the key in the langflow component, this had no effect.
[...]
AUTHENTICATION_APIKEY_ENABLED: 'true'
AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'key206339812'
AUTHENTICATION_APIKEY_USERS: 'user206339812'
[...]
I also tried raising the Query limit, which also had no effect.
QUERY_DEFAULTS_LIMIT: 1000
This thread suggests to use the service/container name for reference instead of localhost, this failed aswell.
Indeed, your error message is consistent with that thread's one. Looks like your Langflow is trying to connect to weaviate at http://localhost:8080.
Considering you are using docker, this is not the place where Langflow will find Weaviate, but http://weaviate:8080
I have used your docker-compose, and was able to ingest data using this simple flow in Langflow:
Let me know if this helps.