Skip to content

plagtech/deep-research-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Research Agent

Autonomous research agent with 26 specialized tools across academic, scientific, and web domains.

An AI-powered research assistant that searches academic papers, preprints, biomedical literature, chemical compounds, census data, and the live web — then synthesizes findings into sourced reports. Each tool call is a real micropayment via x402.

deep-research run "What is the current state of restaking on Ethereum?"

Features

  • 26 Research Tools — academic papers (OpenAlex), arXiv preprints, Crossref scholarly works, PubMed biomedical, PubChem chemistry, US Census demographics, web search & RAG, and dictionary
  • 4 Research Modesquick (1-3 calls), deep (5-15 calls), fact-check, and compare
  • Any LLM — Claude (default), GPT-4o, Llama, Groq, Ollama, and 100+ providers via litellm
  • x402 Native — each tool call is a real micropayment ($0.001–$0.03 USDC), no subscriptions required
  • Beautiful Output — rich terminal formatting, or export as Markdown, JSON, or plain text
  • Streaming — watch the agent work in real time as it calls tools and builds its answer

Quick Start

Install

pip install deep-research-agent

Configure

cp .env.example .env
# Edit .env with your API keys

You need two things:

  1. An LLM API key (for the orchestration layer)

    • ANTHROPIC_API_KEY for Claude (default, recommended)
    • OPENAI_API_KEY for GPT models
    • GROQ_API_KEY for Groq
    • Or any litellm-supported provider
  2. Gateway access (for the research endpoints)

    • Option A: RESEARCH_API_KEY — subscription access
    • Option B: RESEARCH_WALLET_KEY — funded wallet for x402 auto-pay

Run

# Deep research (default)
deep-research run "What is the current state of restaking on Ethereum?"

# Quick answer
deep-research run --mode quick "Who founded Anthropic?"

# Fact-check a claim
deep-research run --mode fact-check "Bitcoin processes 7 transactions per second"

# Compare topics
deep-research run --mode compare "Optimism vs Arbitrum vs Base"

# Save as Markdown report
deep-research run --output markdown --save report.md "L2 scaling landscape 2026"

# Use a different model
deep-research run --model gpt-4o "Latest developments in AI agents"

# JSON output (for piping to other tools)
deep-research run --output json "Solana DeFi TVL" | jq .answer

List Tools

deep-research tools

Check Config

deep-research config

Python API

import asyncio
from deep_research.agent import ResearchAgent, ResearchMode

async def main():
    async with ResearchAgent(mode=ResearchMode.DEEP) as agent:
        result = await agent.research(
            "What are the most promising zero-knowledge proof systems in 2026?"
        )
        print(result.answer)
        print(f"Tool calls: {result.tool_calls_made}")
        print(f"Est. cost: {result.total_cost_estimate}")

asyncio.run(main())

Streaming

async with ResearchAgent(mode=ResearchMode.DEEP) as agent:
    async for event in agent.research_stream("DePIN landscape"):
        print(event, end="", flush=True)

Custom Model

agent = ResearchAgent(model="groq/llama-3.1-70b-versatile")
agent = ResearchAgent(model="gpt-4o")
agent = ResearchAgent(model="ollama/llama3.1")

Research Tools (26 Endpoints)

Search & RAG

Tool Cost Description
web_search $0.02 Web search via Tavily with ranked results
web_extract $0.02 Extract clean content from URLs
web_qna $0.03 Question-answering over fresh web results

Dictionary

Tool Cost Description
dictionary_define $0.001 Definition with phonetics and examples
dictionary_synonyms $0.001 Synonyms and antonyms
dictionary_phonetics $0.001 Phonetic transcription and audio

Academic Papers (OpenAlex — 250M+ papers)

Tool Cost Description
papers_search $0.002 Full-text academic paper search
papers_by_doi $0.001 Paper metadata by DOI
papers_by_author $0.002 Papers by author name or ORCID
papers_citations $0.002 Citation graph and references
papers_trending $0.002 Trending papers by topic

Preprints (arXiv)

Tool Cost Description
preprints_search $0.002 Search arXiv by keyword and category
preprints_by_id $0.001 Preprint metadata by arXiv ID
preprints_recent $0.002 Latest preprints by category

Scholarly Works (Crossref — 150M+ works)

Tool Cost Description
scholarly_search $0.002 Search books, papers, datasets, and more
scholarly_by_doi $0.001 Full metadata for any DOI
scholarly_citations_count $0.001 Citation count for a DOI
scholarly_journal_info $0.001 Journal metadata by ISSN

Chemistry (PubChem)

Tool Cost Description
chemistry_compound $0.002 Compound by name, formula, or CID
chemistry_similarity $0.002 Structurally similar compounds
chemistry_bioactivity $0.002 Biological assay results

Biomedical (PubMed — 36M+ papers)

Tool Cost Description
biomedical_search $0.002 Search biomedical literature
biomedical_by_pmid $0.001 Paper metadata by PubMed ID
biomedical_related $0.002 Related articles for a PMID

Demographics

Tool Cost Description
demographics_census $0.001 US Census data by state/county/zip
demographics_datasets $0.001 Search Data.gov datasets

Data sourced from OpenAlex, Crossref, PubMed, PubChem, arXiv, US Census Bureau, Data.gov, and Tavily.

How It Works

┌─────────────┐     ┌─────────────┐     ┌──────────────────────┐
│  Your Query  │────▶│  LLM (Claude │────▶│  x402 Research       │
│             │     │  / GPT / etc)│◀────│  Gateway (26 tools)  │
└─────────────┘     └──────┬──────┘     └──────────────────────┘
                           │                       │
                    Decides which          Micropayment per
                    tools to call          tool call ($0.001-$0.03)
                           │                       │
                    ┌──────▼──────┐                │
                    │  Synthesized │◀───────────────┘
                    │  Research    │   Results from each
                    │  Report     │   endpoint
                    └─────────────┘
  1. You submit a research query
  2. The LLM analyzes the query and decides which research tools to call
  3. Each tool call hits the x402 gateway (micropayment per call)
  4. Results flow back to the LLM for synthesis
  5. The LLM may call more tools based on intermediate results (agentic loop)
  6. Final synthesized answer with sources is delivered

Cost Estimates

Mode Typical Calls Estimated Cost
Quick 1-3 $0.002–$0.06
Deep 5-15 $0.01–$0.15
Fact-check 3-7 $0.006–$0.10
Compare 4-10 $0.008–$0.12

Plus LLM inference costs from your chosen provider.

Environment Variables

Variable Required Default Description
RESEARCH_MODEL No claude-sonnet-4-20250514 LLM model (litellm format)
ANTHROPIC_API_KEY If using Claude Anthropic API key
OPENAI_API_KEY If using GPT OpenAI API key
RESEARCH_API_KEY Option A Subscription key
RESEARCH_WALLET_KEY Option B Private key for x402 auto-pay
RESEARCH_GATEWAY_URL No https://gateway.spraay.app Gateway URL
RESEARCH_NETWORK No base Payment chain

Contributing

PRs welcome! See issues for open tasks.

License

MIT — see LICENSE.

About

26-tool autonomous research agent — academic papers, arXiv, PubMed, PubChem, Census, web search. x402 micropayments, any LLM.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages