To start your Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
Ready to run in production? Please check our deployment guides.
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix
docker build --build-arg APP_NAME=td_ai --build-arg APP_VERSION=0.0.1 --volume /home/bluetab/Escritorio/Truedat/td-ai:/app .
docker build --build-arg APP_VERSION=0.1.0 .
VAULT_TOKENToken for Vault connectionVAULT_SECRETS_PATHPrefix path for vault secretsREDIS_AUDIT_STREAM_MAXLEN(Optional) Maximum length for Redis audit stream. Default: 100REDIS_STREAM_MAXLEN(Optional) Maximum length for Redis stream. Default: 100
OBAN_DB_SCHEMA(Optional) Schema prefix to use for Oban tables. Default:private.OBAN_CREATE_SCHEMA(Optional) Whether to auto-create the Oban schema at boot. Accepts"true"/"false". Default:true.OBAN_KNOWLEDGE_QUEUE_WORKERS(Optional) Number of workers for the knowledge_queue. Default:1.
The following environment variables control the behavior of semantic search:
SEMANTIC_SEARCH_NUM_CANDIDATES(Optional) Number of candidates to consider in KNN search. Default: 200SEMANTIC_SEARCH_K(Optional) Number of top results to return from semantic search. Default: 20SEMANTIC_SEARCH_SIMILARITY(Optional) Minimum similarity threshold for search results. Default: 0.30SEMANTIC_SEARCH_BOOST(Optional) Boost factor for KNN search results. Default: 1.0
To use and develop knowledges locally, you need a python virtual enviroment.
You need to create a Python virtual environment. This command creates and configures a virtual environment with all dependencies:
mix python.setupYou can specify the python binary to use by setting the PYTHON_BINARY environment variable.
PYTHON_BINARY(Optional) Absolute path to the python binary. Default:python.- Note: This path must be absolute, not relative.
- The python binary must have the dependencies listed in
priv/python/requirements.txtinstalled.
- DB_SSL: boolean value, to enable TSL config, by default is false.
- DB_SSL_CACERTFILE: path of the certification authority cert file "/path/to/ca.crt".
- DB_SSL_VERSION: available versions are tlsv1.2, tlsv1.3 by default is tlsv1.2.
- DB_SSL_CLIENT_CERT: Path to the client SSL certificate file.
- DB_SSL_CLIENT_KEY: Path to the client SSL private key file.
- DB_SSL_VERIFY: This option specifies whether certificates are to be verified.
To configure the proxy settings for the AI providers (Gemini and Azure OpenAI), you can set the following environment variables:
-
AI_PROVIDER_PROXY_ADDRESS: The address of the proxy server. -
AI_PROVIDER_PROXY_SCHEMA: The schema to use for the proxy connection (default is "http"). This value will be converted to an atom. -
AI_PROVIDER_PROXY_PORT: The port number for the proxy server. -
AI_PROVIDER_PROXY_OPTIONS: Additional options for the proxy configuration. -
KNOWLEDGE_EMBEDDINGS_BATCH_SIZE:- Purpose: Controls the batch size used when processing knowledge embeddings in the KnowledgeProcessor worker
- Default:
100 - Usage: Defines how many knowledge chunks are processed together in each batch when generating embeddings for knowledge files. Used by the knowledge processing pipeline in td-ai
- Performance: Adjusting this value can help balance memory usage and processing efficiency when handling large knowledge files with many chunks
Example configuration in your environment:
export AI_PROVIDER_PROXY_ADDRESS="proxy.example.com"
export AI_PROVIDER_PROXY_SCHEMA="https"
export AI_PROVIDER_PROXY_PORT="8080"
export AI_PROVIDER_PROXY_OPTIONS="some_options"