Every setting the ERP Financial Agent reads at startup is declared inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/yohangr3/agentelanggrafh/llms.txt
Use this file to discover all available pages before exploring further.
src/core/config.py as a Pydantic Settings field. Values are loaded from a .env file first, then from real environment variables — with real environment variables taking precedence. Required fields (marked with ... in the source) have no default and will cause the app to refuse to start if they are absent.
Required variables
These fields have no default value. The application will not start without them.Hostname of the MySQL database server. For AWS RDS use the full endpoint, e.g.
iafinagent.choi0eaq2mr7.us-east-1.rds.amazonaws.com.Target database (schema) name. The default database used in the CloudFormation stack is
iafinagent.Database login username. The CloudFormation stack defaults to
admin.Database password. In production this value is injected from AWS Secrets Manager at container startup; set
DB_PASSWORD_SECRET_ARN instead and leave this blank in the ECS environment.AWS Cognito User Pool ID that issues JWT tokens. Format:
us-east-1_XXXXXXXXX. The CognitoJWTValidator derives the JWKS endpoint URL from this value.AWS / LLM
AWS region where Bedrock, Cognito, DynamoDB, and Secrets Manager resources live. Cross-region inference profiles (
us.anthropic.*) require this to be us-east-1.Optional. Your 12-digit AWS account ID. Required by some IAM resource ARN constructions and tenant-panel features. When running on ECS the value is available from instance metadata.
Bedrock cross-region inference profile used for general LLM calls (intent classification, SQL generation, explanations). Must be a valid inference profile ID, not a base model ID.
Bedrock inference profile for reasoning-intensive graph nodes. Billed at a higher token rate than the general model; see
COST_PER_1K_INPUT_TOKENS_REASONING.Bedrock model for generating text embeddings (FAISS schema registry, semantic search). Produces 1024-dimensional vectors by default (
EMBEDDING_DIMENSIONS).Optional. Full ARN of the Secrets Manager secret that stores the database password, e.g.
arn:aws:secretsmanager:us-east-1:123456789012:secret:erp-agent/db-password. When set, resolve_secrets() fetches the real password at startup and injects it into DB_PASSWORD. Leave unset for local development.Database connection
MySQL port. Change only if your RDS instance is on a non-standard port.
TCP handshake and authentication timeout in seconds. Passed as
connect_timeout in connect_args to aiomysql.Per-read timeout in seconds. Controls how long the driver waits for data from the server on a single network read.
Per-write timeout in seconds. Applies to write operations (relevant if the application is extended beyond read-only access in future).
Session / Cache
Full Redis connection URL. In the ECS deployment this is derived from the ElastiCache cluster endpoint:
redis://<cluster-endpoint>:6379/0.Default TTL applied to all Redis keys (session checkpoints, rate-limit counters). Expired keys are evicted automatically by Redis.
How long an idle conversation session is kept alive, counted from the last message in the session.
Hard ceiling on the number of messages stored per session. Older messages are dropped when the limit is reached.
Agent behaviour
Number of prior conversation turns injected into each LLM prompt as context. Increasing this value improves multi-turn coherence but raises token cost per request.
Sampling temperature for the intent classification node.
0.0 produces deterministic output.Sampling temperature for SQL generation.
0.0 produces deterministic queries.Sampling temperature for the explanation generation node.
Sampling temperature for the SQL self-correction node.
Sampling temperature for the report/analysis generation node.
Sampling temperature for the understand/slot-extraction node.
Maximum self-correction retries when the SQL validator rejects a generated query. After this many attempts the agent returns an error to the user.
Maximum clarification rounds before the agent applies smart defaults and proceeds without user input.
Enables
sqlglot-based validation of every generated SQL statement before execution. Disable only in development when iterating on prompt templates.Enables input sanitization on all user-provided strings before they are passed to LLM nodes or SQL generation.
Enables audit trail logging. Every query execution is recorded with user, session, generated SQL, and row count.
Enables Human-in-the-Loop confirmation before executing expensive queries. When
true, queries whose estimated cost exceeds the threshold are paused and sent to the frontend for user approval.Maximum number of rows the database layer will return from any single SELECT. Results are truncated at this limit to protect memory.
Wall-clock timeout for SQL execution. Queries that exceed this limit are cancelled and the agent reports a timeout error.
Timeout for individual LLM API calls to Bedrock in seconds.
Schema registry
Embedding vector dimensions produced by
BEDROCK_EMBEDDING_MODEL_ID. Amazon Titan Embed Text v2 defaults to 1024 dimensions.Path to reference files (
sap-schema.md, query-patterns.md) used by the schema registry.Directory where FAISS indexes are persisted on disk. On ECS this maps to an EFS mount so the index survives task restarts.
Number of schema chunks returned by the schema-registry nearest-neighbour search for each query.
Number of few-shot query patterns returned by the schema registry for each query.
When
true, the schema_linker node prefers the generated YAML-based schema catalog (yaml_schemas/*.yml) over the legacy domain_catalog.py / enricher.py for covered tables. Setting this to false is an instant rollback if a covered table misbehaves.Analysis and export
Maximum number of rows included in CSV or Excel exports.
When
true, the visualization node automatically selects the most appropriate chart type based on data shape.RBAC
Controls whether RBAC policy violations actually block requests. When
false (shadow mode) violations are logged as warnings but the request proceeds. Set to true in production only after verifying no false positives in the audit log.When
true, every shadow-denial (a violation that is not blocking because RBAC_ENFORCE=false) is logged as a warning. Disable once enforcement is live to reduce log noise.Tenant slug this instance serves.
* allows any tenant (backwards-compatible default). Set to a specific slug (e.g. agripac) to restrict access to Cognito users whose custom:tenantId claim matches.Multi-tenant panel
DynamoDB table name for the tenant registry used by the instance panel feature.
owner/repo whose provision-tenant.yml workflow is dispatched by the tenant panel to provision new tenant instances.AWS Secrets Manager secret name for the GitHub Personal Access Token (with
Actions:write scope) used to dispatch the provisioning workflow.Cognito and rate limiting
Optional. AWS Cognito App Client ID. When set, the JWT validator also verifies the
aud claim in the ID token against this value.Enables per-user rate limiting. When
false, all rate-limit checks are skipped.Maximum requests per minute allowed per authenticated user. Requests beyond this limit receive HTTP 429.
Maximum requests per hour per authenticated user. Enforced independently of the per-minute limit.
DynamoDB memory
Enables long-term conversation memory in DynamoDB. When
true, the agent writes conversation turns to the erp-agent-conversations table so context persists across browser sessions.Number of days before DynamoDB automatically expires conversation records. The TTL attribute on each item is set to
now + DYNAMODB_TTL_DAYS.File upload and code execution
Maximum file size (in megabytes) accepted by the upload endpoint. Requests that exceed this limit are rejected with HTTP 413.
Maximum number of rows accepted in a CSV or Excel upload. Files with more rows are rejected before parsing begins.
TTL in minutes for uploaded file data stored in Redis. After expiry the data is evicted and the user must re-upload.
Timeout in seconds for the code-execution subprocess spawned by the agent.
Memory limit in megabytes for the code-execution subprocess.
Maximum number of code refinement iterations the agent attempts before returning an error.
Retry and circuit breaker
Maximum retry attempts for LLM API calls to Bedrock.
Maximum retry attempts for database operations.
Exponential back-off multiplier applied between retries.
Minimum wait in seconds before the first retry.
Maximum wait cap in seconds between retries.
Number of consecutive failures required to trip the circuit breaker (open state).
Seconds after which the circuit breaker transitions from open to half-open and allows a single probe request.
Observability
Optional. LangSmith API key for LLM call tracing. Tracing is disabled when this variable is absent.
LangSmith project name that traces are grouped under.
Enables LangChain’s V2 tracing protocol. Set to
true together with LANGSMITH_API_KEY to stream traces to LangSmith.Enables Prometheus metrics collection. Metrics are exposed on the
/metrics endpoint.Prefix applied to all Prometheus metric names.
Enables per-request token cost tracking. Cost is computed using the
COST_PER_1K_*_TOKENS settings and logged alongside every LLM invocation.USD cost per 1,000 input tokens for the general model (
BEDROCK_MODEL_ID, Claude Sonnet 4.5).USD cost per 1,000 output tokens for the general model (
BEDROCK_MODEL_ID, Claude Sonnet 4.5).USD cost per 1,000 input tokens for the reasoning model (
BEDROCK_REASONING_MODEL_ID).USD cost per 1,000 output tokens for the reasoning model (
BEDROCK_REASONING_MODEL_ID).Alert is emitted when any request exceeds this latency threshold in seconds.
Alert is emitted when the rolling error rate exceeds this fraction (e.g.
0.10 = 10%).Prompt version tag used for A/B testing and evaluation tracking.
Number of parallel workers used by the offline evaluation pipeline.
API
JSON-encoded list of origins that the FastAPI CORS middleware will allow. Must be a valid JSON array string in
.env. Example for local dev with both Vite ports: ["http://localhost:5173","http://localhost:5174"].Global API request timeout in seconds.
Runtime environment label. Accepted values include
development, staging, and production. Used in log output and CloudWatch tagging.Python logging level. Set to
DEBUG to enable SQLAlchemy query echo and verbose agent tracing. Accepted values: DEBUG, INFO, WARNING, ERROR, CRITICAL.Full .env example
The snippet below covers every configurable variable. Copy it, fill in the required fields, and remove the optional sections you don’t need.
.env