当前位置: 首页 > news >正文

Connecting weaviate with langflow across docker containers

题意:在Docker容器之间连接Weaviate与Langflow

问题背景:

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 ComponentError 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_ragservices:langflow:image: langflowai/langflow:1.0-alphaports:- "7860:7860"depends_on:- postgresenvironment:- 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/langflowvolumes:- langflow-data:/app/langflowpostgres:image: postgres:16environment:POSTGRES_USER: langflowPOSTGRES_PASSWORD: langflowPOSTGRES_DB: langflowports:- "5432:5432"volumes:- langflow-postgres:/var/lib/postgresql/dataweaviate:command:- --host- 0.0.0.0- --port- '8080'- --scheme- httpimage: cr.weaviate.io/semitechnologies/weaviate:1.25.4ports:- 8080:8080- 50051:50051volumes:- weaviate_data:/var/lib/weaviaterestart: on-failure:0environment:    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/.ollamaports:- 11434:11434container_name: ollamaimage: ollama/ollamavolumes: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.

http://www.lryc.cn/news/404190.html

相关文章:

  • 【linux vim使用说明】
  • cocos2d-x安装和项目
  • 因果推断 | 双重机器学习(DML)算法原理和实例应用
  • Flutter 开源库学习
  • 自主巡航,目标射击
  • MySQL中EXPLAIN关键字详解
  • 如何理解ref toRef和toRefs
  • 【linux】kernel-trace
  • 【Golang 面试基础题】每日 5 题(一)
  • ETCD介绍以及Go语言中使用ETCD详解
  • 03-用户画像+Elasticsearch
  • 初学Mybatis之搭建项目环境
  • JMeter使用小功能-(持续更新)
  • 科研绘图系列:R语言火山图(volcano plot)
  • docker firewalld 防火墙设置
  • 《问题004:报错-JS问题-unknown: Invalid shorthand property initializer.》
  • 什么是 MLPerf?
  • 【SpringBoot】第3章 SpringBoot的系统配置
  • ELK日志分析系统部署文档
  • ue5笔记
  • TCP重传机制详解
  • 如何使用javascript将商品添加到购物车?
  • 【MySQL】:想学好数据库,不知道这些还想咋学
  • 1.关于linux的命令
  • 【人工智能】机器学习 -- 决策树(乳腺肿瘤数)
  • 【proteus经典实战】LCD滚动显示汉字
  • 数据结构复习1
  • 订单管理系统需求规范
  • swiftui使用ScrollView实现左右滑动和上下滑动的效果,仿小红书页面
  • 深入理解并使用 MySQL 的 SUBSTRING_INDEX 函数