Skip to content

Add environment variable and configuration management to Lucidia #6

@blackboxprogramming

Description

@blackboxprogramming

Description

Currently, Lucidia's modules reference hard-coded paths and API keys (e.g., the memory file and OpenAI API key). This makes it difficult to configure the project across different environments. We should centralize configuration and load values from environment variables or a .env file.

Proposed work

  • Add a config.py module that reads environment variables for values such as MEMORY_FILE_PATH, CONTRADICTIONS_FILE_PATH, and OPENAI_API_KEY, falling back to sensible defaults.
  • Use the python-dotenv package to load variables from a .env file automatically during development.
  • Update chatgpt_agent.py, memory_manager.py, and contradiction_agent.py to fetch values from the configuration module instead of hard-coded strings.
  • Create a .env.example file with sample variables and add instructions in the README for creating a local .env.
  • Ensure that missing or invalid configuration values result in clear error messages.

Acceptance criteria

  • Lucidia reads configuration values from environment variables or a .env file and falls back to defaults if not provided.
  • The repository contains a config.py and a .env.example illustrating required settings.
  • Updated modules no longer contain hard-coded file paths or API keys.
  • Tests verify that configuration values are loaded correctly and that defaults are used when variables are absent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions