Josh-XT / AGiXT

AGiXT is a dynamic AI Agent Automation Platform that seamlessly orchestrates instruction management and complex task execution across diverse AI providers. Combining adaptive memory, smart features, and a versatile plugin system, AGiXT delivers efficient and comprehensive AI solutions.
https://AGiXT.com
MIT License
2.61k stars 348 forks source link

Running with PostgreSQL instead of ChromaDb.sqlite backend. #1053

Closed mjcloutier closed 11 months ago

mjcloutier commented 11 months ago

Description

When I run docker-compose-postgres.yml with some modifications for adding missing timezone var, set the various repos for nextjs, agixt, and streamlit to use main instead of latest, also setting a DATABASE_TYPE=postgresql to skip the default of Sqlite.

I get the following issues:

  1. ERROR: Various tables in the database don't have a proper ID set. (This causes various errors for it not to work with postgres db).
  2. ERROR: (psycopg2.errors.NotNullViolation) null value in column "provider_id" of relation "provider_setting" violates not-null constraint DETAIL: Failing row contains (b3a6788b-dcf3-478c-bb33-419a7a296307, null, MODEL_PATH, HuggingFaceH4/starchat-beta).
  3. ERROR: 2023-10-17 03:15:57.966 UTC [1] LOG: database system is ready to accept connections agixt-agixt-1 | Adding agent: OpenAI Assistant agixt-agixt-1 | Agent 'OpenAI Assistant' does not exist in the database. agixt-agixt-1 | Adding agent: OpenOrca agixt-agixt-1 | Agent 'OpenOrca' does not exist in the database. agixt-agixt-1 | Adding agent: SQLExpert agixt-agixt-1 | Agent 'SQLExpert' does not exist in the database. agixt-agixt-1 | Adding agent: Vicuna agixt-agixt-1 | Agent 'Vicuna' does not exist in the database. agixt-agixt-1 | Adding agent: gpt4free agixt-agixt-1 | Agent 'gpt4free' does not exist in the database. agixt-agixt-1 | Adding agent: undefined agixt-agixt-1 | Agent 'undefined' does not exist in the database. agixt-agixt-1 | Error: HTTPConnectionPool(host='localhost', port=7437): Max retries exceeded with url: /api/chain (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xffff8de448b0>: Failed to establish a new connection: [Errno 111] Connection refused'))
  4. BONUS: Should add settings to pick from the (3) Postgresql docker-compose files from the ./AGiXT.sh script

Steps to Reproduce the Bug

  1. Set docker-compose-postgres.yml to use main branch instead of latest.
  2. Set DATABASE_TYPE=postgresql to env var for AGiXT

Expected Behavior

The Application should function properly using Postgresql as the datastore. It should store both the settings and the vector store instead of dumping memories into a folder in the project.

Operating System

Python Version

Environment Type - Connection

Runtime environment

Acknowledgements

Josh-XT commented 11 months ago

That database type setting is not related to Chroma, it is an flag to make AGiXT use a Postgres database on the back end instead of JSON/YAML files. It is currently a feature still in development/testing, but it is unrelated to Chroma.