Configuration & Environment
Relevant source files
The following files were used as context for generating this wiki page:
The ALwrity platform relies on a multi-layered configuration and environment setup to orchestrate AI-powered digital marketing tasks. This system encompasses environment variables for secret management, backend server configuration via FastAPI, and a guided onboarding process to establish initial settings for solopreneurs and content creators.
Sources: README.md, SETUP_GUIDE.md
1. Environment Variables & Secret Management
ALwrity utilizes a .env file located in the project root to manage sensitive API credentials required for AI generation and web research. These variables are critical for the functionality of core services including LLM providers (OpenAI, Google Gemini, Anthropic) and search engines.
Supported API Keys
| Variable | Provider | Purpose |
|---|---|---|
OPENAI_API_KEY | OpenAI | GPT-4 model access for content generation |
GOOGLE_API_KEY | Gemini Pro / Imagen API for text and images | |
ANTHROPIC_API_KEY | Anthropic | Claude AI models for professional writing |
SERPER_API_KEY | Serper.dev | Real-time Google Search results |
TAVILY_API_KEY | Tavily AI | Semantic web research |
Sources: ToBeMigrated/chatbot_custom/README.md, README.md
2. Backend Server Configuration
The backend is built on FastAPI and is configured primarily through backend/app.py and the startup script start_alwrity_backend.py. The environment setup involves the automatic creation of workspace directories to store configurations, prompts, and research data.
Workspace Directory Structure
When the backend starts, it validates and creates the following directories within lib/workspace/:
alwrity_content: Storage for generated marketing materials.alwrity_web_research: Cache and results for competitive analysis.alwrity_prompts: Specialized AI system prompts.alwrity_config: Local configuration files and user settings.
Sources: backend/README.md
Server Execution Parameters
The server behavior can be modified using the following environment variables during startup:
HOST: Server host address (Default:0.0.0.0).PORT: Server port (Default:8000).RELOAD: Boolean to enable auto-reload for development (Default:true).
Sources: backend/README.md, SETUP_GUIDE.md
3. Onboarding & Setup Workflow
ALwrity implements a 6-step onboarding wizard to ensure the environment is correctly configured before the main application is accessed. This process is managed via the Onboarding API endpoints.
Onboarding Steps Flow
The following diagram illustrates the sequential configuration steps required for a new environment:
Setup Components Detail
| Component | Configuration Logic |
|---|---|
| Website Setup | Configures target URL and performs basic/full SEO analysis to baseline the environment. |
| AI Research | Sets search depth (Basic/Comprehensive/Expert) and selects between traditional or neural search. |
| Personalization | Defines brand voice, tone preferences, and style guidelines for consistent generation. |
| Final Setup | Performs verification of connectivity to all configured AI providers and API keys. |
Sources: ToBeMigrated/utils/api_key_manager/components/README.md
4. API Key Management Architecture
The system manages API keys through a dedicated service layer that handles validation, secure storage, and provider-specific configurations.
Configuration Sequence Diagram
This diagram shows how the system validates and saves a new AI provider configuration during the environment setup:
Sources: SETUP_GUIDE.md, backend/README.md
5. Environment Health & Monitoring
To ensure the environment remains stable, ALwrity provides dedicated health check endpoints and directory validation logic within the startup scripts.
- Health Check:
GET /healthreturns the status of the backend and a timestamp. - Dependency Validation: The
start_alwrity_backend.pyscript checks for required Python packages and environment variables before initializing the server. - CORS Configuration: The environment is pre-configured to allow cross-origin requests from
http://localhost:3000andhttp://localhost:8000.
Sources: backend/README.md, SETUP_GUIDE.md
ALwrity's configuration system is designed to be "AI-First," ensuring that once API keys and brand personas are established during the environment setup, the platform can autonomously generate content strategies and research insights without further manual intervention.