Configuration (config.yaml)
Relevant source files
The following files were used as context for generating this wiki page:
The config.yaml file serves as the central configuration hub for the CoI-Agent system. It defines essential parameters for connecting to Large Language Model (LLM) providers (OpenAI or Azure OpenAI), setting up embedding models, and authorizing access to external research APIs like Semantic Scholar.
This configuration is critical for the initialization of the DeepResearchAgent and ReviewAgent, as well as the SementicSearcher module, which rely on these settings to perform automated literature reviews and idea generation.
Configuration Loading and Environment Integration
At runtime, the application reads config.yaml and maps its values to system environment variables. This allows various modules to access secrets and endpoints globally via standard environment lookups.
Initialization Flow
The application initializes by loading the YAML file and updating os.environ. If a value in the configuration file is an empty string, it is skipped to prevent overwriting existing system variables.
The flow ensures that environment variables are populated before the get_llms() function is called to instantiate the model clients.
Sources: main.py:12-20, agents.py:17-27
LLM Provider Settings
The system supports two primary LLM provider paths: Azure OpenAI and standard OpenAI. This is toggled via the is_azure boolean flag.
| Option | Description | Relevant Module |
|---|---|---|
is_azure | Boolean flag (True/False) to switch between Azure and OpenAI. | main.py, agents.py |
AZURE_OPENAI_ENDPOINT | The base URL for the Azure OpenAI service. | openai_llm client |
AZURE_OPENAI_KEY | Authentication key for Azure services. | openai_llm client |
AZURE_OPENAI_API_VERSION | Specific API version for Azure requests. | openai_llm client |
OPENAI_API_KEY | Authentication key for standard OpenAI API. | openai_llm client |
OPENAI_BASE_URL | Custom base URL for OpenAI (useful for proxies). | openai_llm client |
Sources: config.yaml:3-13, README.md:50-60
Model Selection and Roles
The project distinguishes between "Main" and "Cheap" models to balance performance and cost during complex research tasks.
Tiered Model Configuration
The configuration defines two specific tiers:
- MAIN_LLM_MODEL: Used for high-reasoning tasks like judging ideas, refining experiments, and generating final research directions.
- CHEAP_LLM_MODEL: Used for token-heavy tasks like summarizing paper content, extracting entities, and providing initial reviews.
Sources: config.yaml:22-24, agents.py:17-27, agents.py:228-230
External Service API Keys
To function as a research agent, the system requires access to the Semantic Scholar Academic Graph.
- SEMENTIC_SEARCH_API_KEY: Required to authenticate requests to the Semantic Scholar API. This key is retrieved by the
SementicSearcherclass to perform asynchronous paper lookups and metadata retrieval. - EMBEDDING_API_SETTINGS: Separate endpoints and keys can be provided for embedding models (e.g., for calculating cosine similarity during reranking). If left empty, the system defaults to using the main LLM configuration.
Searcher Configuration Table
| Parameter | Function | Default/Requirement |
|---|---|---|
SEMENTIC_SEARCH_API_KEY | Authorizes API calls to api.semanticscholar.org | Mandatory for search |
EMBEDDING_MODEL | Specific model used for vector representations | Optional (Defaults to Main) |
EMBEDDING_API_ENDPOINT | Custom endpoint for embedding generation | Optional |
Sources: config.yaml:1-20, searcher/sementic_search.py:84-86, README.md:47-49
Conclusion
The config.yaml file is the foundational configuration layer of the CoI-Agent. By centralizing LLM provider details, model tiers, and external API keys, it allows the DeepResearchAgent and ReviewAgent to dynamically adapt to different computing environments and cost constraints while maintaining access to the scientific literature required for the Chain-of-Ideas process.