AutoGPT: unknown command `FT.SEARCH` when using redis-stack-server docker container

Duplicates

  • I have searched the existing issues

Steps to reproduce 🕹

requirements.txt installed

password set in .env for redis

docker container started with $ docker run -d --name redis-stack-server -p 127.0.0.1:6379:6379 redis/redis-stack-server:latest redis-server --requirepass <password_is_set>

python3 scripts/main.py

when it is running noticed errors in cli

looking up error is recommened redis-search-server be installed to solve FT.SEARCH error but it is now deprecated https://hub.docker.com/r/redislabs/redisearch

Current behavior 😯

Error calling Redis search: unknown command FT.SEARCH, with args beginning with: auto-gpt, *=>[KNN 10 @embedding $vector AS vector_score], RETURN, 2, data, vector_score, SORTBY, vector_score, A,

Expected behavior 🤔

no errors shown

Your prompt 📝

ai_goals:
- Increase net worth
- Grow Twitter Account
- Develop and manage multiple businesses autonomously
ai_name: Jarvis
ai_role: an AI designed to autonomously develop and run businesses with the sole goal
  of increasing your net worth

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Also, while this is closed, but for those having this exact same problem with RedisSearch stack in the docker, make sure you start the server like this:

command: "redis-stack-server /etc/redis.conf"

and NOT like this:

command: "redis-server /etc/redis.conf"

You can check if the search module is loaded by going into the redis cli and running

module list

The first startup command for Redis should output a long list of loaded modules while the second start up command command will output an empty array

I hope this helps someone.

In regards to the FT.INFO and FT.CREATE error: I discovered there was a redis server running on my computer before the docker redis was activated. I ran the following (M1 Mac) to turn it off for good because it kept restarting every time I tried to just kill the port. I got the answer from this page here: https://tableplus.com/blog/2018/10/how-to-start-stop-restart-redis.html

The command I used to kill the process from auto restarting for good.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Check your ports.

going to chaulk it up as a redis issue

I have tried all kinds of things, creating custom Dockerfile and making both auto-gpt and redis-stack-server on same docker network

include redis-cli in the build and exec into auto-gpt to ping redis container with password successfully PONG

no matter how you slice it just fails with the error and exits

I have sse and sse2 flags on cpu and should be supported from research i5 XEON dual 56 cores and 160 gb ram

since I have so many notes and going to go another direction will just add them here encase someone wants to do this entirely in docker. All was successful except the redis error which I will assume when redis image is compiled my cpu flags are not compatible. * I have tried older and edge version of redis images, all same issue.

Dockerfile

FROM python:3.11

WORKDIR /app
COPY requirements.txt /app/
COPY scripts/ /app

RUN apt-get update && apt-get install -y redis-tools
RUN pip install -r requirements.txt

CMD ["python3", "main.py"]

docker-compose.yml

version: '3.9'

services:
  auto-gpt:
    build: .
    container_name: auto-gpt-container
    depends_on:
      - redis-stack-server
    env_file: .env
    stdin_open: true
    tty: true
    networks:
      - auto-gpt-network

  redis-stack-server:
    image: redis/redis-stack-server:latest
    container_name: redis-stack-server
    command: ["redis-stack-server", "--requirepass", "${REDIS_PASSWORD}"]
    ports:
      - "127.0.0.1:6379:6379"
    volumes:
      - redis-data:/data
    networks:
      - auto-gpt-network

volumes:
  redis-data:

networks:
  auto-gpt-network:

.env ( add your other env’s as needed )

MEMORY_BACKEND=redis
MEMORY_INDEX=whatever
REDIS_HOST=redis-stack-server
REDIS_PORT=6379
REDIS_PASSWORD=12345

docker-compose up -d

find address of container

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis-stack-server

get into container

docker exec -it auto-gpt-container /bin/bash

ping inside auto-gpt-container to redis container with password should see PONG if successful

redis-cli -h redis-stack-server -p 6379 -a 12345 ping

run app

python3 main.py

@bigsk1 I ran into similar problems as you, and it sounds like we have a similar setup. I run a proxmox host machine with an ubuntu VM. How is your VM set up? I was failing due to SSE instruction set error.
I realized after further research, you must set your VM up as “type = host”. This will make all features of your host cpu available to your VM. If you use the default type (which is kvm64 I believe) you won’t get SSE instruction support on your VM!! image

So edit your VM CPU properties and change type to “host”, if you haven’t done so. Once I did that, I was able to get redis-stack-server to work with default settings & no finagling, just as the autogpt guide states.

Make sure your password is configured in .env and try an AUTH command with the password to test locally.

Do you able to connect to local redis and create the search index?

https://redis.io/docs/stack/search/quick_start/#create-an-index https://redis.io/docs/stack/search/quick_start/#add-documents https://redis.io/docs/stack/search/quick_start/#search-the-index

tried and received an error

127.0.0.1:6379> FT.CREATE myIdx ON HASH PREFIX 1 doc: SCHEMA title TEXT WEIGHT 5.0 body TEXT url TEXT (error) ERR Protocol error: unauthenticated multibulk length