Skip to content

fix: wire AgentGraph to YAML config #150

Closed
bhavyakeerthi3 wants to merge 3 commits intoreactome:mainfrom
bhavyakeerthi3:fix/agentgraph-config-hardcoding-wired
Closed

fix: wire AgentGraph to YAML config #150
bhavyakeerthi3 wants to merge 3 commits intoreactome:mainfrom
bhavyakeerthi3:fix/agentgraph-config-hardcoding-wired

Conversation

@bhavyakeerthi3
Copy link
Copy Markdown

@bhavyakeerthi3 bhavyakeerthi3 commented Mar 15, 2026

Description

This PR addresses the long-standing issue where AgentGraph hardcoded the LLM and embedding models, ignoring any settings in config.yml.
First reported in #108, this completes the YAML configurability work by extending it to the most critical parameters.

Closes #108, Closes #148

Changes

  • Pydantic Model: Added llm and embedding fields to the Config class in src/util/config_yml/__init__.py.
  • Schema & Defaults: Updated .config.schema.yaml and config_default.yml to support these fields with safe defaults (gpt-4o-mini, text-embedding-3-large).
  • Graph Wiring: Updated the AgentGraph constructor to accept and use these configurations instead of hardcoded strings.
  • Entry Point: Updated chat-chainlit.py to correctly pass the YAML-loaded configurations to the agent during startup.

Impact

The chatbot is now fully configurable. Users can switch to Claude, Gemini, or local Ollama models via config.yml without touching Python source code — making the project significantly more accessible to contributors and deployers.

Tests Added

Added test_config_loads_llm_and_embedding to tests/test_config.py:

def test_config_loads_llm_and_embedding(mock_config_file):
    config = Config.from_yaml(mock_config_file)
    assert config.llm == "gpt-4o-mini"
    assert config.embedding == "text-embedding-3-large"

Verification

Verified that AgentGraph correctly receives and uses parameters from config_default.yml on startup.

Files Affected

  • src/util/config_yml/__init__.py
  • config_default.yml
  • .config.schema.yaml
  • src/agent/graph.py
  • bin/chat-chainlit.py
  • tests/test_config.py

Relation to Other PRs

Completes configurability work started in #112 by AaryanCode69, extending it to cover LLM and embedding model parameters which were not included in that PR.

@bhavyakeerthi3 bhavyakeerthi3 changed the title fix: wire AgentGraph to YAML config (Closes #108, Closes #148) fix: wire AgentGraph to YAML config Mar 15, 2026
Updated the Config Pydantic model and YAML schema to include llm and
embedding fields. Modified AgentGraph constructor to accept these
configurations and updated the chat-chainlit.py entry point to pass
them from the loaded configuration.

This removes hardcoded 'gpt-4o-mini' and 'text-embedding-3-large'
references, making the agent models fully configurable.
@bhavyakeerthi3 bhavyakeerthi3 force-pushed the fix/agentgraph-config-hardcoding-wired branch from 4d6f8f5 to 4384475 Compare March 15, 2026 08:12
@bhavyakeerthi3 bhavyakeerthi3 deleted the fix/agentgraph-config-hardcoding-wired branch March 15, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: AgentGraph hardcodes LLM and embedding models — ignores YAML configuration refactor: Make LLM and Embedding Model Configurable via YAML

1 participant