AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Redis Memory Issue (FT.INFO not found after multiple reinstalls and creating new servers/cleaning the ports.)

Open pjoneswv opened this issue 1 year ago • 12 comments

Duplicates

  • [X] I have searched the existing issues

Steps to reproduce 🕹

Please note that this was based on the stable branch.

Installing docker, then creating a server in Redis. I had to remove the password because none of the commands were working, it wouldn't initiate the bot.

Each time Redis was reinstalled, updated or a new server was created, I would get the same error as listed below.

Error creating Redis search index: unknown command 'FT.CREATE', with args beginning with: 'auto-gpt' 'ON' 'HASH' 'PREFIX' '1' 'auto-gpt:' 'SCORE' '1.0' 'SCHEMA' 'data' 'TEXT' 'WEIGHT' '1.0' 'embedding' 'VECTOR' 'HNSW' Welcome to Auto-GPT! Enter the name of your AI and its role below. Entering nothing will load defaults. Name your AI: For example, 'Entrepreneur-GPT' AI Name: t t here! I am at your service. Describe your AI's role: t For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.' t is: Enter up to 5 goals for your AI: t For example: Increase net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously' Enter nothing to load defaults, enter nothing when finished. Goal 1: Goal 2: Using memory of type: RedisMemory Using Browser: chrome

  • Thinking... Traceback (most recent call last): File "/Users/pauljones/opt/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Users/pauljones/opt/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/pauljones/Auto-GPT/autogpt/main.py", line 53, in main() File "/Users/pauljones/Auto-GPT/autogpt/main.py", line 49, in main agent.start_interaction_loop() File "/Users/pauljones/Auto-GPT/autogpt/agent/agent.py", line 65, in start_interaction_loop assistant_reply = chat_with_ai( File "/Users/pauljones/Auto-GPT/autogpt/chat.py", line 88, in chat_with_ai logger.debug(f"Memory Stats: {permanent_memory.get_stats()}") File "/Users/pauljones/Auto-GPT/autogpt/memory/redismem.py", line 154, in get_stats return self.redis.ft(f"{self.cfg.memory_index}").info() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/commands/search/commands.py", line 370, in info res = self.execute_command(INFO_CMD, self.index_name) File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1258, in execute_command return conn.retry.call_with_retry( File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/retry.py", line 46, in call_with_retry return do() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1259, in lambda: self._send_command_parse_response( File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1235, in _send_command_parse_response return self.parse_response(conn, command_name, **options) File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1275, in parse_response response = connection.read_response() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/connection.py", line 882, in read_response raise response redis.exceptions.ResponseError: unknown command 'FT.INFO', with args beginning with: 'auto-gpt'

Current behavior 😯

Each time is says FT.INFO not found before asking for a bot name. After putting in the goals this happens.

Error creating Redis search index: unknown command 'FT.CREATE', with args beginning with: 'auto-gpt' 'ON' 'HASH' 'PREFIX' '1' 'auto-gpt:' 'SCORE' '1.0' 'SCHEMA' 'data' 'TEXT' 'WEIGHT' '1.0' 'embedding' 'VECTOR' 'HNSW' Welcome to Auto-GPT! Enter the name of your AI and its role below. Entering nothing will load defaults. Name your AI: For example, 'Entrepreneur-GPT' AI Name: t t here! I am at your service. Describe your AI's role: t For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.' t is: Enter up to 5 goals for your AI: t For example: Increase net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously' Enter nothing to load defaults, enter nothing when finished. Goal 1: Goal 2: Using memory of type: RedisMemory Using Browser: chrome

  • Thinking... Traceback (most recent call last): File "/Users/pauljones/opt/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Users/pauljones/opt/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/pauljones/Auto-GPT/autogpt/main.py", line 53, in main() File "/Users/pauljones/Auto-GPT/autogpt/main.py", line 49, in main agent.start_interaction_loop() File "/Users/pauljones/Auto-GPT/autogpt/agent/agent.py", line 65, in start_interaction_loop assistant_reply = chat_with_ai( File "/Users/pauljones/Auto-GPT/autogpt/chat.py", line 88, in chat_with_ai logger.debug(f"Memory Stats: {permanent_memory.get_stats()}") File "/Users/pauljones/Auto-GPT/autogpt/memory/redismem.py", line 154, in get_stats return self.redis.ft(f"{self.cfg.memory_index}").info() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/commands/search/commands.py", line 370, in info res = self.execute_command(INFO_CMD, self.index_name) File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1258, in execute_command return conn.retry.call_with_retry( File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/retry.py", line 46, in call_with_retry return do() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1259, in lambda: self._send_command_parse_response( File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1235, in _send_command_parse_response return self.parse_response(conn, command_name, **options) File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1275, in parse_response response = connection.read_response() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/connection.py", line 882, in read_response raise response redis.exceptions.ResponseError: unknown command 'FT.INFO', with args beginning with: 'auto-gpt'

Expected behavior 🤔

The bot should start working, instead it stops and goes back to the cd.

Your prompt 📝

# Paste your prompt here

Error creating Redis search index: unknown command 'FT.CREATE', with args beginning with: 'auto-gpt' 'ON' 'HASH' 'PREFIX' '1' 'auto-gpt:' 'SCORE' '1.0' 'SCHEMA' 'data' 'TEXT' 'WEIGHT' '1.0' 'embedding' 'VECTOR' 'HNSW' Welcome to Auto-GPT! Enter the name of your AI and its role below. Entering nothing will load defaults. Name your AI: For example, 'Entrepreneur-GPT' AI Name: t t here! I am at your service. Describe your AI's role: t For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.' t is: Enter up to 5 goals for your AI: t For example: Increase net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously' Enter nothing to load defaults, enter nothing when finished. Goal 1: Goal 2: Using memory of type: RedisMemory Using Browser: chrome

  • Thinking... Traceback (most recent call last): File "/Users/pauljones/opt/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Users/pauljones/opt/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/pauljones/Auto-GPT/autogpt/main.py", line 53, in main() File "/Users/pauljones/Auto-GPT/autogpt/main.py", line 49, in main agent.start_interaction_loop() File "/Users/pauljones/Auto-GPT/autogpt/agent/agent.py", line 65, in start_interaction_loop assistant_reply = chat_with_ai( File "/Users/pauljones/Auto-GPT/autogpt/chat.py", line 88, in chat_with_ai logger.debug(f"Memory Stats: {permanent_memory.get_stats()}") File "/Users/pauljones/Auto-GPT/autogpt/memory/redismem.py", line 154, in get_stats return self.redis.ft(f"{self.cfg.memory_index}").info() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/commands/search/commands.py", line 370, in info res = self.execute_command(INFO_CMD, self.index_name) File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1258, in execute_command return conn.retry.call_with_retry( File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/retry.py", line 46, in call_with_retry return do() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1259, in lambda: self._send_command_parse_response( File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1235, in _send_command_parse_response return self.parse_response(conn, command_name, **options) File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/client.py", line 1275, in parse_response response = connection.read_response() File "/Users/pauljones/opt/anaconda3/lib/python3.9/site-packages/redis/connection.py", line 882, in read_response raise response redis.exceptions.ResponseError: unknown command 'FT.INFO', with args beginning with: 'auto-gpt'

pjoneswv avatar Apr 16 '23 16:04 pjoneswv

I also have the same issue

beknazar avatar Apr 17 '23 05:04 beknazar

I have the same issue

we1005 avatar Apr 17 '23 09:04 we1005

Same issue

ruckc avatar Apr 17 '23 14:04 ruckc

@pjoneswv @beknazar @we1005 - I figured out you need the redisearch module... easiest way for me was to use the redis-stack container instead of redis.

ruckc avatar Apr 17 '23 15:04 ruckc

Change the docker-compose.yml file to

version: "3.9"

services:
  auto-gpt:
    depends_on:
      - redis
    build: ./
    env_file:
      - .env
    volumes:
      - "./autogpt:/app"
      - ".env:/app/.env"
    profiles: ["exclude-from-up"]

  redis:
    image: "redis/redis-stack:latest"
    ports:
      - "6379:6379"
    environment:
      - REDIS_ARGS=--requirepass <choose a pwd>

Modify the .env to include the added password and the value of the redis host REDIS_HOST=redis

It should work now ;)

You can also have a look at https://github.com/Significant-Gravitas/Auto-GPT/pull/2196

V0nMis3s avatar Apr 17 '23 15:04 V0nMis3s

Same issue on my end using local apt-install'ed redis on WSL (not docker)

lxe avatar Apr 17 '23 22:04 lxe

Looks like the docker redis from readme is working fine

lxe avatar Apr 17 '23 22:04 lxe

Did you install the "redis-stack" package locally instead of redis? I was on a mac environment and the error went away after installing the following steps. https://redis.io/docs/stack/get-started/install/mac-os/

nobita2041 avatar Apr 17 '23 23:04 nobita2041

give this a shot. WSL Docker dns has always seemed to be problematic, so worth setting up it's own network also.

version: "3.9"

services:
  auto-gpt:
    depends_on:
      - redis
    build: ./
    env_file:
      - .env
    environment:
      - MEMORY_BACKEND=redis
      - REDIS_HOST=auto-gpt-redis-1
      - REDIS_PORT=6379
      - REDIS_PASSWORD=autogpt12345
    volumes:
      - "./autogpt:/app"
      - ".env:/app/.env"
      - "./data/auto_gpt_workspace:/home/appuser/auto_gpt_workspace"
    profiles: ["exclude-from-up"]

  redis:
    image: "redis/redis-stack-server:latest"
    restart: on-failure
    stop_grace_period: 1m
    environment:
      - REDIS_ARGS=--requirepass autogpt12345
    volumes:
      - ./data/redis:/data

networks:
    default:
      name: auto-gpt

ceramicwhite avatar Apr 18 '23 01:04 ceramicwhite

the same issue

blackcoffeeli avatar Apr 18 '23 10:04 blackcoffeeli

@blackcoffeeli - @lxe I'm running Auto-GPT locally (in WSL2) and redis-stack via docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest with no issues.

ruckc avatar Apr 18 '23 12:04 ruckc

try to install redisearch pip install redisearch

gongfuchang avatar Apr 18 '23 14:04 gongfuchang

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:

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

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

Check your ports and see what you find.

If you check your redis MODULE LIST in the redis cli you should see the ft module, but when I checked my MODULE LIST it was empty, because it was the local redis I had installed awhile back. By removing that one, the docker redis was able to take precedence and AutoGPT was happy and able to access the correct MODULES.

riefer02 avatar Apr 18 '23 22:04 riefer02

pip install redisearch

try to install redisearch pip install redisearch

fine,

blackcoffeeli avatar Apr 19 '23 02:04 blackcoffeeli

try to install redisearch pip install redisearch

this got rid of the original message, but I got a new message new. Error: Redis is not installed. Please install redis-py to use Redis as a memory backend.

Solution: Uninstall/stop all redis instances and download redis-stack instead of normal redis, and run it as a docker container using the following command:

docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest

roswell67 avatar Apr 22 '23 21:04 roswell67

try to install redisearch pip install redisearch

Please add redisearch to requirements.

mweber89 avatar May 27 '23 11:05 mweber89

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] avatar Sep 06 '23 21:09 github-actions[bot]

This issue was closed automatically because it has been stale for 10 days with no activity.

github-actions[bot] avatar Sep 17 '23 01:09 github-actions[bot]