ThoughtChain is an AI-powered assistant that builds a short literature review for a given research question. It queries Semantic Scholar, downloads open access papers, screens them with a language model and returns a concise scientific report. A small Flask web interface is also provided.
- Install Python 3.8 or newer.
- Install dependencies:
pip install -r requirements.txt
# additional packages for the web app
pip install flask flask-cors python-dotenvCreate a .env file in the project root and add your API keys:
OPENAI_API_KEY=your-openai-key
SEMANTIC_SCHOLAR_API_KEY=your-semantic-scholar-key
The application loads this file automatically. Keep the .env file private and never commit it to version control.
You can call the pipeline directly from Python:
python - <<'PY'
from main import run_pipeline
result = run_pipeline("What is the role of epigenetics in Alzheimer's disease?")
print(result["report"])
PYTo start the Flask interface run:
python app.pyOpen http://127.0.0.1:5000/ in your browser and enter a research question. The page will display each step of the pipeline and the generated report.
Want to build on this project? Here are a few ideas:
- Add PDF parsing: Allow users to upload their own papers and extract insights.
- Add Long Term Storage: Allow users to upload their own papers and extract insights.
- Citation Generator: Export results in APA/MLA/BibTeX format.
- LLM Model Swapping: Use Anthropic Claude, Mistral, or open models like LLaMA via HuggingFace. You could even train models for each specific module.
- Multi-language Support: Let users input questions in other languages.
- User Accounts: Save searches and generated reports to a personal dashboard.
This project is licensed under the MIT License. See the LICENSE file for details.