Environment Variables
The following environment variables are required to run the application:
-
OPENAI_API_KEY
: The API key for OpenAI API Embeddings. -
POSTGRES_DB
: The name of the PostgreSQL database. -
POSTGRES_USER
: The username for connecting to the PostgreSQL database. -
POSTGRES_PASSWORD
: The password for connecting to the PostgreSQL database. -
DB_HOST
: The hostname or IP address of the PostgreSQL database server. -
DB_PORT
: The port number of the PostgreSQL database server. -
JWT_SECRET
: (Optional) The secret key used for verifying JWT tokens for requests.- The secret is only used for verification. This basic approach assumes a signed JWT from elsewhere.
- Omit to run API without requiring authentication
-
COLLECTION_NAME
: (Optional) The name of the collection in the vector store. Default value is "testcollection". -
CHUNK_SIZE
: (Optional) The size of the chunks for text processing. Default value is "1500". -
CHUNK_OVERLAP
: (Optional) The overlap between chunks during text processing. Default value is "100". -
RAG_UPLOAD_DIR
: (Optional) The directory where uploaded files are stored. Default value is "./uploads/". -
PDF_EXTRACT_IMAGES
: (Optional) A boolean value indicating whether to extract images from PDF files. Default value is "False". -
DEBUG_RAG_API
: (Optional) Set to "True" to show more verbose logging output in the server console, and to enable postgresql database routes -
EMBEDDINGS_PROVIDER
: (Optional) either "openai" or "huggingface", which uses sentence_transformers; defaults to "openai" -
EMBEDDINGS_MODEL
: (Optional) openai default: "text-embedding-3-small", huggingface default: "sangmini/msmarco-cotmae-MiniLM-L12_en-ko-ja" -
HF_TOKEN
: (Optional) if needed forhuggingface
option.
Make sure to set these environment variables before running the application. You can set them in a .env
file or as system environment variables.