Introduction to CoI Agent
Relevant source files
The following files were used as context for generating this wiki page:
The Chain-of-Ideas (CoI) Agent is a multi-agent system designed to revolutionize scientific research by automating the development of novel research ideas using Large Language Models (LLMs). The system systematically explores existing literature, builds "idea chains" representing historical research progression, and leverages evolutionary-style reasoning to propose innovative, feasible, and novel research directions.
Sources: README.md:1-5, agents.py:99-105
System Architecture
The CoI Agent architecture is built upon a modular framework where specialized agents interact with external search APIs and LLM providers to synthesize new knowledge. The primary workflow involves a "Deep Research" phase that traces literature backwards and forwards to establish context before generating a final research proposal.
Core Components
| Component | Responsibility | Relevant Files |
|---|---|---|
| DeepResearchAgent | Manages the primary workflow of searching, chaining ideas, and generating novel proposals. | agents.py:99-130 |
| ReviewAgent | Evaluates generated ideas and experiments, providing critical feedback for refinement. | agents.py:53-75 |
| SementicSearcher | Interfaces with the Semantic Scholar API to retrieve and parse academic papers. | searcher/sementic_search.py:59-100 |
| openai_llm | Handles communication with OpenAI or Azure OpenAI for all text generation and embedding tasks. | LLM.py:59-110 |
High-Level Workflow
The following diagram illustrates the high-level process from a research topic input to the final refined experiment.
Sources: agents.py:150-250, main.py:40-55
Deep Research and Idea Chaining
The DeepResearchAgent is responsible for building a chronological sequence of research advancements. It performs both "Forward" searches (finding citations) and "Backward" searches (finding references) to understand how a specific field has evolved.
Idea Chain Logic
- Anchor Paper Identification: The system starts with an anchor paper related to the topic.
- Expansion: It searches for future papers that cited the anchor and past papers that the anchor referenced.
- Extraction: For each paper in the chain, it extracts entities, the core idea (background, novelty, contribution), and the experimental design.
- Trend Analysis: It summarizes the progression (e.g., "how Paper 0 leads to Paper 1").
Sources: agents.py:228-280, prompts/deep_research_agent_prompts.py:84-120
Evolutionary Reasoning Pattern
The agent uses four modes of thinking to transition from the established trend to a new "Future Direction":
- Reflection: Identifying where current methods fail.
- Analogy: Applying solutions from other fields to the current problem.
- Deep Dive: Modifying specific aspects of existing approaches.
- Imitate: Following the successful progressive strategies of previous researchers.
Sources: prompts/deep_research_agent_prompts.py:175-195
Review and Refinement Mechanism
The system employs a ReviewAgent to ensure the quality and feasibility of the generated output. This agent simulates the peer-review process by analyzing the proposed experiment against established literature.
Technical Implementation Details
Configuration and Environment
The system supports both OpenAI and Azure OpenAI. Configuration is managed via a config.yaml file, which is loaded into environment variables at runtime.
# config.yaml example
SEMENTIC_SEARCH_API_KEY: ""
is_azure: True
AZURE_OPENAI_ENDPOINT: ""
MAIN_LLM_MODEL: "gpt-4o"
Sources: README.md:40-65, main.py:10-20
PDF Parsing
The project utilizes scipdf_parser and grobid to convert raw PDF research papers into structured JSON dictionaries containing titles, abstracts, sections, and references.
# searcher/sementic_search.py:246-255
def read_arxiv_from_path(self, pdf_path):
if not os.path.exists(pdf_path):
return None
try:
article_dict = scipdf.parse_pdf_to_dict(pdf_path)
except Exception as e:
return None
return article_dict
Sources: searcher/sementic_search.py:246-255
Data Models
The Result class in searcher/sementic_search.py serves as the primary data structure for academic papers, storing metadata required for ranking and chaining.
| Field | Type | Description |
|---|---|---|
title | String | The paper title. |
abstract | String | A summary of the paper. |
article | Dict | The full parsed content of the PDF. |
citations_count | Int | Number of citations for ranking relevance. |
year | Int | Publication year for chronological ordering. |
Sources: searcher/sementic_search.py:49-55
Conclusion
The CoI Agent represents a sophisticated application of multi-agent orchestration for scientific discovery. By grounding its generation process in actual literature chains and utilizing a rigorous review-refine loop, it minimizes hallucination and maximizes the novelty of its research proposals. This system provides a robust framework for researchers to explore new domains and generate high-quality hypotheses autonomously.