โ๏ธ Configuration
co_ai
uses Hydra for flexible and hierarchical configuration. Each agent, tool, and subsystem loads settings from a structured YAML config. This allows you to dynamically switch models, pipelines, memory backends, and more.
๐๏ธ Configuration Structure
The root config lives in config/config.yaml
and includes nested paths for:
defaults:
- db: default
- logging: default
- report: default
- agents:
- generation
- ranking
- review
- reflection
- evolution
- proximity
- meta_review
````
---
## ๐ง Memory Configuration (`db.yaml`)
Example for a PostgreSQL database with `pgvector`:
```yaml
host: localhost
port: 5432
database: co_ai
user: postgres
password: yourpassword
# Optional store overrides
extra_stores: []
๐ Logging (logging.yaml
)
logger:
log_path: logs/
log_file: ""
log_path
: Base directory for logslog_file
: Specific log file; if empty, will auto-generate using timestamp and run ID
๐ Reporting (report.yaml
)
generate_report: true
format: yaml
๐งช Agent Configuration
Each agent has its own file under config/agents/
. For example:
โจ Generation Agent
name: generation
prompt_type: file
prompt_file: generation_goal_aligned.txt
top_k: 5
๐ง Reflection Agent
name: reflection
prompt_type: file
prompt_file: reflect_consistency.txt
preferences:
- goal_consistency
- factual
- reliable_source
- simplicity
๐งฌ Prompt Tuning Agent
name: prompt_tuning
model: qwen2.5
num_prompts: 10
๐ Prompt Directory Override
You can override the prompt directory from the command line or within the context:
PROMPT_DIR: "prompts"
๐งช Example Run with Overrides
You can override any value from the CLI:
python co_ai/main.py goal="Can AI assist scientific discovery?" logging.logger.log_path=run_logs
Or define a full run config:
goal: "Evaluate LLMs for literature review"
run_id: "review_run_01"
๐ Tips
- Every config is passed to its agent as a flat
dict
- Use
.get()
for optional config keys - Log config values using
OmegaConf.to_yaml(cfg)
๐ Runtime Mutation
Agents can mutate config or context, but best practice is to treat config as static and context as dynamic.