Citation Assistant
Add verified citations to academic LaTeX documents. Identify citation gaps, search for relevant papers, verify their existence, and add properly formatted BibTeX entries.
CRITICAL: No Hallucinated Citations
All citations MUST be real, verified papers. Hallucinated or fabricated citations are absolutely not tolerated - they constitute academic misconduct and can result in paper rejection or retraction.
- NEVER generate BibTeX from memory
- ALWAYS verify papers exist via API or web search before citing
- If you cannot verify a paper, mark it as
[CITATION NEEDED]- do NOT guess - When in doubt, leave it out
Context
- Bibliography files: !'find . -maxdepth 3 -name "*.bib" 2>/dev/null | head -20 || echo "No .bib files found"'
- LaTeX sections: !'grep -rh "\\section{" *.tex 2>/dev/null | head -20 || echo "No .tex files found"'
Invocation
citation-assistant # Ask user which section needs citations
citation-assistant [section] # Add citations to specified section (e.g., "introduction", "related work")
citation-assistant verify # Verify all existing citations in the document
Workflow
1. Identify Target Section
When invoked:
- If section argument provided: Read that section from the LaTeX file
- If no argument: Use AskUserQuestion to ask "Which section needs citations?"
- Offer sections found in the document (scan for
\section{...})
- Offer sections found in the document (scan for
2. Identify Citation Gaps
Read the section and identify:
- Claims without citations
- Broad claims with insufficient citations (single citation for major claims)
- Methods/techniques missing original paper references
- Comparisons to prior work without references
List gaps to user before searching - Show each claim and why it needs a citation.
3. Search for Papers
For each gap, use multiple search methods to ensure broad coverage:
Check existing bibliography first - Search the project's .bib file(s)
Search using ALL available tools (not just one):
- Exa MCP (if available) - semantic search, good for conceptual queries
- Semantic Scholar API - comprehensive academic database
- Web search - catches recent preprints and non-indexed papers
Run searches in parallel when possible. Different tools have different coverage - a paper missing from one source may appear in another.
Aggregate and deduplicate results - Merge results from all sources
Verify each paper exists in 2+ sources before citing
Fetch BibTeX via DOI - Never generate from memory
4. Add Citations
- Append new entries to .bib file
- Insert citation commands matching the document's style (
\cite{},\citep{},\citet{}, etc.) - Report what was added
Citation Rules
| Situation | Action |
|---|---|
| Found paper, got DOI | Fetch BibTeX via DOI, add citation |
| Found paper, no DOI | Use arXiv BibTeX or construct from verified metadata |
| Cannot verify paper | Mark as [CITATION NEEDED], inform user |
| "I think there's a paper about X" | Search first, never guess |
Never hallucinate citations. If verification fails at any step, mark the citation as needing manual verification.
BibTeX Format
@article{author2024keyword,
title={Title with {Acronyms} Protected},
author={Last, First and Last2, First2},
journal={arXiv preprint arXiv:XXXX.XXXXX},
year={2024}
}
@inproceedings{author2024conf,
title={Title Here},
author={Last, First},
booktitle={Proceedings of NeurIPS},
year={2024}
}
- Key format:
author_year_keyword - Protect acronyms with braces:
{LLM},{GPU},{BERT} - Use
andbetween authors
Python Environment
When running Python code for citation lookups:
- Create a virtual environment if needed:
uv venv - Activate it:
source .venv/bin/activate - Install dependencies:
uv add semanticscholar requests
Never use the system Python directly.
APIs
See references/apis.md for Semantic Scholar and DOI lookup code.
Output
For each citation added, report:
- The claim being supported
- Paper title and authors
- Why this paper is relevant
- The BibTeX key added