Skip to main content

AutoGen tools for Built-Simple research APIs (PubMed & ArXiv)

Project description

AutoGen Built-Simple Research Tools

PyPI version Python 3.9+ License: MIT

GPU-accelerated research tools for Microsoft AutoGen agents.

Search millions of academic papers on PubMed (4.48M+ articles) and ArXiv (2.77M+ papers) with semantic understanding. Built on Built-Simple's high-performance research APIs.

๐Ÿš€ Features

  • ๐Ÿ”ฌ PubMed Search: Semantic + keyword hybrid search across 4.48M biomedical articles
  • ๐Ÿ“š ArXiv Search: Fast search across 2.77M preprints (physics, math, CS, AI/ML)
  • โšก GPU-Accelerated: Millisecond response times via Built-Simple APIs
  • ๐Ÿ“„ Full Text: Retrieve complete article text from PubMed Central
  • ๐Ÿค– AutoGen Native: One-line registration with AutoGen agents

๐Ÿ“ฆ Installation

pip install autogen-builtsimple

Or with AutoGen included:

pip install autogen-builtsimple[autogen]

๐Ÿƒ Quick Start

import os
from autogen import ConversableAgent
from autogen_builtsimple import register_research_tools

# Create agents
assistant = ConversableAgent(
    name="ResearchAssistant",
    system_message="""You are a research assistant that helps find and analyze 
    scientific papers. Use the search tools to find relevant literature.""",
    llm_config={"config_list": [{"model": "gpt-4", "api_key": os.environ["OPENAI_API_KEY"]}]},
)

user_proxy = ConversableAgent(
    name="User",
    llm_config=False,
    is_termination_msg=lambda msg: "TERMINATE" in msg.get("content", ""),
    human_input_mode="NEVER",
)

# Register all research tools with one line!
register_research_tools(assistant, user_proxy)

# Start researching
chat_result = user_proxy.initiate_chat(
    assistant,
    message="Find 5 recent papers on CRISPR gene therapy for cancer treatment"
)

๐Ÿ”ง Available Tools

PubMed Tools

Tool Description
search_pubmed Hybrid semantic + keyword search across PubMed
get_pubmed_full_text Retrieve full article text (PMC articles)
get_pubmed_metadata Batch fetch metadata for multiple PMIDs

ArXiv Tools

Tool Description
search_arxiv Hybrid/vector/text search across ArXiv
get_arxiv_paper_url Get PDF and abstract URLs for a paper

๐Ÿ“– Usage Examples

Search PubMed

from autogen_builtsimple import search_pubmed

# Semantic search for medical literature
results = search_pubmed(
    query="machine learning early cancer detection biomarkers",
    limit=10,
    min_year=2020
)
print(results)

Search ArXiv

from autogen_builtsimple import search_arxiv

# Search for AI papers
results = search_arxiv(
    query="large language models reasoning capabilities",
    limit=10,
    search_type="hybrid"  # or "vector" or "text"
)
print(results)

Get Full Text

from autogen_builtsimple import get_pubmed_full_text

# Get complete article text
full_text = get_pubmed_full_text(pmid="35421456")
print(full_text)

Selective Registration

from autogen_builtsimple import register_pubmed_tools, register_arxiv_tools

# Register only PubMed tools
register_pubmed_tools(assistant, user_proxy)

# Or only ArXiv tools
register_arxiv_tools(assistant, user_proxy)

๐Ÿ”‘ API Keys (Optional)

The tools work without API keys using IP-based rate limiting. For higher limits, get a free API key:

results = search_pubmed(
    query="diabetes treatment",
    limit=20,
    api_key="your-api-key"
)

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  AutoGen Agent  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  autogen-builtsimple โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Built-Simple   โ”‚
โ”‚   (Assistant)   โ”‚     โ”‚      Tools       โ”‚     โ”‚     APIs        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                        โ”‚
                                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                โ”‚                                               โ”‚
                        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                        โ”‚    PubMed     โ”‚                               โ”‚    ArXiv      โ”‚
                        โ”‚  GPU Search   โ”‚                               โ”‚  GPU Search   โ”‚
                        โ”‚  4.48M docs   โ”‚                               โ”‚  2.77M docs   โ”‚
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“Š Performance

Endpoint Latency Index Size
PubMed Hybrid Search ~100-150ms 4.48M articles
ArXiv Hybrid Search ~70-90ms 2.77M papers
PubMed Full Text ~50ms PMC subset

๐Ÿค Contributing

Contributions welcome! Please feel free to submit issues and pull requests.

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ”— Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autogen_builtsimple-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autogen_builtsimple-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file autogen_builtsimple-0.1.0.tar.gz.

File metadata

  • Download URL: autogen_builtsimple-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for autogen_builtsimple-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5140042603298f845a37a947144b2f196be88aaf033ce6c606a90b605b5787d4
MD5 d1b84210e3b7fa4a1b35504075222480
BLAKE2b-256 204df6c14855f936ea3e4658f5b9b49d895b170d8765cf670828bb980acf260f

See more details on using hashes here.

File details

Details for the file autogen_builtsimple-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autogen_builtsimple-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9853975274e0b474a4a67d4361c0ad3ad8a0e6b110c5348f724cf6a3f7fed53a
MD5 887ef9a2f23d243713b396d84ca4aba9
BLAKE2b-256 b60494ebdd624d1a9432ffbb86ec3b804e71da79804e6f6ae997d47b1b7a57a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page