Autonomous Scientific Literature Synthesis Agent Script
Create an automated literature extraction and claim verification pipeline script for academic papers and clinical trial feeds.
Deploy this template when you need an autonomous agent script to fetch, parse, and semantically reconcile scientific papers against an explicit schema. It builds an end-to-end extraction and conflict-resolution engine for data analysis and research operations.
Role: Principal Research Automation Engineer specializing in semantic search pipelines and multi-agent knowledge synthesis.
Context
- Target scientific domain: {{academic_domain}}
- Source repository endpoint: {{target_repository_api}}
- Core extraction schema: {{extraction_schema}}
- Discrepancy resolution policy: {{conflict_resolution_strategy}}
- Destination database: {{output_database}}
- API throughput cap: {{rate_limit_rpm}}
Task
Build a complete, executable Python agent script that queries {{target_repository_api}} for recent publications in {{academic_domain}}, extracts structured empirical findings conforming to {{extraction_schema}}, reconciles conflicting literature claims using {{conflict_resolution_strategy}}, and writes verified records to {{output_database}}.
Method
- Initialize asynchronous HTTP connection pools respecting the {{rate_limit_rpm}} ceiling.
- Query {{target_repository_api}} with domain-specific taxonomy filters for {{academic_domain}}.
- Chunk document text and execute structured entity extraction matching {{extraction_schema}}.
- Score extraction confidence based on sample size, p-values, and methodology rigor.
- Compare extracted claims against historical nodes in {{output_database}} to flag contradictions.
- Apply {{conflict_resolution_strategy}} to resolve or isolate contradictory claims.
- Format validated payloads and perform batch upsert operations into {{output_database}}.
- Emit an execution telemetry summary detailing parsed papers, extracted entities, and conflicts.
Constraints
- Code MUST implement token-bucket rate limiting matching {{rate_limit_rpm}} precisely.
- Script MUST NOT drop unmatched extraction keys silently; unparsed data must enter a dead-letter queue.
- All database queries must use parameterized statements to prevent injection risks.
- Asynchronous event loops must be fully handled with structured task cancellation.
Output format
- Architecture Overview (flow diagram represented in ASCII/text format).
- Dependencies & Configuration (requirements block with pinned versions).
- Standalone Extraction Script (full runnable code containing query engine, parser, conflict resolver, and db writer).
- Sample Execution Log (mock output showing paper intake, claim resolution, and database response).
Self-review
- Does the script explicitly bind and enforce the {{extraction_schema}} during parsing?
- Is {{conflict_resolution_strategy}} concretely implemented rather than left as a mock stub?
- Does the execution loop strictly respect {{rate_limit_rpm}} under high-volume mock inputs?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.