High-Level Architecture
Relevant source files
The following files were used as context for generating this wiki page:
The Chain-of-Ideas (CoI) Agent is an autonomous research framework designed to generate novel scientific ideas and experimental designs through iterative literature analysis and multi-agent collaboration. The system leverages Large Language Models (LLMs) to perform deep research, simulate peer review, and refine research directions based on a "chain of ideas" extracted from existing scientific publications.
Sources: README.md:10-15, agents.py:108-112
System Components
The architecture is composed of several specialized modules and agents that interact to move from a research topic to a finalized experimental plan.
Core Agents
| Component | Description | Key Responsibilities |
|---|---|---|
| DeepResearchAgent | The primary orchestration agent for idea synthesis. | Generates search queries, builds research chains, synthesizes novel ideas, and designs experiments. |
| ReviewAgent | A simulation of a peer reviewer. | Provides critical feedback on generated ideas and experiments to ensure feasibility and novelty. |
| SementicSearcher | The data retrieval interface. | Interfaces with Semantic Scholar API to find, download, and parse research papers. |
| openai_llm | The LLM interface wrapper. | Manages synchronous and asynchronous calls to OpenAI or Azure OpenAI services for text generation and embeddings. |
Sources: agents.py:65-75, agents.py:108-135, searcher/sementic_search.py:65-80, LLM.py:64-75
Architectural Overview Diagram
The following diagram illustrates the high-level interaction between the user, the core agents, and external research databases.
Sources: main.py:45-60, agents.py:150-165
Functional Logic and Data Flow
The Research Chain Process
The system operates by creating a "chain" of related papers. Starting from an anchor paper or a topic-based search, the DeepResearchAgent performs both forward search (citations) and backward search (references) to understand the evolution of a research trend.
- Search & Discovery: Uses
SementicSearcher.search_asyncto find initial papers. - Chain Building: Iteratively explores references and citations using
deep_research_paper_with_chain. - Extraction: Extracts entities, summary ideas, and experimental designs from paper content using specialized prompts.
- Trend Analysis: Summarizes the historical progression from early to late papers in the chain.
Sources: agents.py:240-270, agents.py:300-340, searcher/sementic_search.py:180-210
Sequence of Idea Generation
The following sequence diagram detail the execution flow from initialization to the final result output.
Sources: main.py:45-60, agents.py:140-160, agents.py:385-400
Implementation Details
LLM Integration
The LLM.py file provides a unified interface for model interactions. It supports both Azure and standard OpenAI endpoints and handles exponential backoff through the tenacity library.
response_async: Used for non-blocking text generation.get_embbeding: Used by theSementicSearcherto re-rank papers based on cosine similarity to the research topic.
Sources: LLM.py:140-160, searcher/sementic_search.py:145-160
Prompt Management
Prompts are modularized into specific files based on the agent's role.
deep_research_agent_prompts.py: Contains prompts for query rewriting, reference extraction, trend analysis, and novelty checking.review_agent_prompts.py: Contains prompts for assessing feasibility, novelty, and experimental design.
Sources: prompts/deep_research_agent_prompts.py:10-25, prompts/review_agent_prompts.py:45-55
Data Structures
The primary data structure used for paper metadata is the Result class in sementic_search.py.
class Result:
def __init__(self,title="",abstract="",article=None,citations_conut = 0,year = None) -> None:
self.title = title
self.abstract = abstract
self.article = article
self.citations_conut = citations_conut
self.year = year
Sources: searcher/sementic_search.py:65-72
Summary
The CoI Agent architecture prioritizes the iterative refinement of research ideas by mimicking the scientific process. By combining deep literature traversal (DeepResearchAgent) with adversarial feedback (ReviewAgent), the system ensures that generated outputs are not only relevant but also grounded in existing academic trends and verified for novelty.
Sources: README.md:5-10, agents.py:450-460