Sign inSign up

denissa4/agent4docs-index

By denissa4

Updated 7 months ago

Image
0

2.2K

denissa4/agent4docs-index repository overview

NLSQL Bot + Anomaly Detection & TalkToDocs:Llama-Index

Build locally:

docker build -f Dockerfile -t ai-agent .

Run locally:

docker run --rm -p 8080:80 --env-file .env ai-agent
NLSQL Envs:
Environment VariableDescriptionUsed With
DatabaseTypeDatabase type options: 'mysql', 'mssql', 'snowflake', 'redshift', 'postgresql', 'bigquery'All
DataSourceFor 'snowflake' analogue of the 'Account' db parametersnowflake
WarehouseWarehouse identifiersnowflake
DbSchemaDatabase schemasnowflake
DbNameDatabase nameAll
DbUserDatabase usernameAll
DbPasswordDatabase passwordAll
DbPortDatabase port numbermysql, postgresql
ApiEndPointAPI endpoint URLAll
ApiTokenAPI authentication tokenAll
AppIdApplication IDAll
AuthTenantIDAuthentication tenant ID (Optional)All
AppPasswordApplication passwordAll
StaticEndPointStatic endpoint URLAll
client_emailService account emailbigquery
token_uriToken URIbigquery
private_keyPrivate key for authenticationbigquery
project_idGoogle Cloud project IDbigquery
Anomaly Detection Envs:
Environment VariableDescription
FromYearStarting year from which to measure trusted data
ToYearThe final year up to which trusted data is measured (inclusive)
CorridorsMode1 = standard mode (flat corridors over given time period, minimum 1 year of data); 2 = seasonal mode (monthly calculated corridors, minimum 2 years' of data)
WindowSizeSize of the rolling window when using seasonal corridors mode (default = 5)
BoundarySensitivitySensitivity for the lower and upper bounds for anomaly detection (mean +- BoundarySensitivity * standard deviation)
EmailAddressEmail address for sending anomaly detection email
EmailPasswordPassword for senders email (app password may need to be used for gmail and outlook accounts)
RecipientEmailEmail addresses of recipients (separated by comma (no space))
AzureAppNameAzure app name where interactive graph files are stored
OpenAiAPIAPI key for OpenAI integration (informative emails)
OpenAiBaseBase URL for OpenAI integration
OpenAiTypeType of OpenAI service (e.g. azure)
OpenAiVersionOpenAI version
OpenAiNameName of OpenAI model to be used
SystemMessageSystem Message for OpenAI for initial context and instructions given to OpenAI model
FrequencyFrequency (in days) for which the anomaly detection should take place
Talk-to-Docs Envs:
Environment VariableDescription
LanguageModelProviderProvider of the language model (accepts: GCP, AWS, AzureOpenAI, HuggingFace) More to be added.
LanguageModelNameName of the LLM ID, e.g. anthropic.claude-sonnet-4-5-20250929-v1:0
LanguageModelApiKeyAuthentication secret:
- AzureOpenAI/Gemini: API key
- AWS: Secret Access Key
LanguageModelEndpointProvider-specific endpoint or identifier.
- For AzureOpenAI: The Azure OpenAI resource endpoint URL.
- For AWS: AWS Access Key ID.
LanguageModelVersionVersion of the LLM.
- For AzureOpenAI: The model version (e.g. 2025-12-01)
- For AWS: The model region (e.g. us-east-2)
AzureModelDeploymentNameThe deployment name of the Azure-based language model.
LanguageModelContextSystem prompt/context given to the LLM for answering document queries
LanguageModelMaxTokensMaximum number of tokens the LLM can generate in a response (default: 8000)
LanguageModelTimeoutTimeout in seconds for LLM requests (default: 300)
StreamingEnable streaming responses from the bot; Options: true, false (default: false)
EmbeddingModelEmbedding model used for vectorising documents and queries (default: BAAI/bge-small-en-v1.5)
AzureStorageAccNameName of the Azure Storage account containing document files
AzureBlobContainerNameName of the Azure Blob Storage container where documents are stored
AzureStorageSasTokenOptional; SAS token for Azure Blob Storage authentication. Falls back to Managed Identity if not provided
ChunkSizeNumber of words per text chunk when splitting documents for embedding (default: 200)
MaxChunkSizeMaximum number of words per text chunk - If a sentence ender is not found after ChunkSize and before MaxChunkSize, the chunk will be split at MaxChunkSize (default: 500)
SentenceEndersWhen true, chunks break at sentence endings (!, ?, .) that come after word count, rather than strictly at word count (default: true)
GraphRagWhen true uses Graph RAG mode, when false uses standard vector search (default: false)
VerboseGraphWhen true adds more verbose graph RAG answer containing sources and patterns (default: false)
AzureModelsStorageAccNameStorage account name for model storage - embedding & LLM models are stored here (default: nlsqlstorage)
AzureModelsBlobContainerNameContainer name for model storage (default: models)
AzureModelsStorageSasToken
StoreHuggingFaceModelsWhen true Hugging Face models will be storred in local models storage after download - if present stored models will be used instead of Hugging Face models (default: false)
RagSearchResultsNumber or results returned to the LLM (default: 5)
GraphChunkSizeChunk size in tokens for splitting Graph RAG documents (defailt: 50000)
GraphMultistepReasoningNumber of recursive reasoning steps for graph queries (default: 1)
MedicalAssistantWhen true the LLM will be given a specific prompt for generating downstream complications reports (defailt: false)
  • Supported LLM providers:
    • Google Cloud Platform (GCP)
    • Amazon Web Services (AWS)
    • Azure OpenAI (AzureOpenAI)
    • Hugging Face (HuggingFace)
    • More coming soon...

Notes:

  • Only Hugging Face Embedding models are supported at the moment.
  • For standard RAG mode document chunking overlap is a minimum of 50 words OR 10% if higher than 50 words.
Other Envs:
Environment VariableDescription
connections__serviceConnection__settings__clientIdAzure Application ID for Microsoft Teams bot authentication
connections__serviceConnection__settings__clientSecretAzure Application secret for Microsoft Teams bot authentication - Remove this env for UserAssignedMSI
connections__serviceConnection__settings__tenantIdAzure Active Directory Tenant ID for the bot
connectionsMap__0__connectionConnection name for the application (default: serviceConnection)
connectionsMap__0__serviceUrlURL of the application connection (default: *)
TalkToDocsControls bot mode; "true" = Talk-to-Docs only, "false" = NLSQL only, "" = both (NLSQL with Talk-to-Docs fallback)
DEBUGEnable verbose debug logging; Options: true, false (default: false)

Tag summary

Content type

Image

Digest

sha256:2a635d6c9

Size

1009.7 MB

Last updated

7 months ago

docker pull denissa4/agent4docs-index