ArXiv Search Plugin
A powerful Dify plugin for searching and retrieving scientific papers from the ArXiv repository. This plugin enables seamless integration of academic research capabilities into your AI applications.
๐ฌ What is ArXiv?
ArXiv is a free distribution service and open-access archive for scholarly articles in physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering, systems science, and economics. Founded in 1991, it hosts over 2 million research papers and is widely used by researchers worldwide.
โจ Features
- Comprehensive Search: Search by keywords, author names, or ArXiv IDs
- Rich Metadata: Returns publication dates, titles, authors, and abstracts
- Configurable Results: Customize the number of results and content length
- Error Handling: Robust error handling for API failures and edge cases
- AI-Powered Summaries: Automatic summarization of search results using Dify's model capabilities
๐ Quick Start
Installation
-
From Plugin Marketplace (Recommended)
- Navigate to the Dify Plugin Marketplace
- Search for "ArXiv"
- Click "Install" to add it to your workspace
-
Manual Installation
Basic Usage
Once installed, you can use the ArXiv plugin in three ways:
1. Agent Applications
Add the ArXiv tool to your Agent and interact naturally:
2. Chatflow Applications
Add an ArXiv tool node to your chatflow for automated research workflows.
3. Workflow Applications
Integrate ArXiv searches into complex automation pipelines.
๐ Usage Examples
Search by Keywords
Search by Author
Search by ArXiv ID
Advanced Search Queries
โ๏ธ Configuration
Plugin Parameters
| Parameter | Type | Default | Description |
|---|
| string | required | Search query (keywords, author, or ArXiv ID) |
Advanced Configuration (Code Level)
The class supports additional configuration:
๐ ๏ธ Development
Project Structure
Key Components
1. ArxivAPIWrapper ()
The core wrapper around the ArXiv API with features:
- Query validation and truncation
- Error handling for network issues
- Result formatting and content limiting
- Metadata extraction
2. ArxivSearchTool
Dify tool implementation that:
- Validates input parameters
- Invokes the ArXiv API wrapper
- Generates AI-powered summaries of results
- Returns formatted responses
Adding Custom Features
To extend the plugin functionality:
-
Modify Search Parameters
-
Add Custom Filtering
-
Enhance Output Format
๐ง API Reference
ArxivAPIWrapper Methods
Performs an ArXiv search and returns formatted results.
Parameters:
- : Search query string (max 300 characters)
Returns:
- Formatted string with paper details or error message
Example:
Error Handling
The plugin handles several error scenarios:
| Error Type | Description | Response |
|---|
| General ArXiv API error | "Arxiv exception: {error}" |
| Empty response from API | "Arxiv exception: {error}" |
| Network/HTTP issues | "Arxiv exception: {error}" |
| No results | Query returns no papers | "No good Arxiv Result was found" |
| Empty query | Missing search query | "Please input query" |
๐งช Testing
Manual Testing
- Install the plugin in your Dify workspace
- Create a simple Agent application
- Add the ArXiv tool
- Test with various query types:
- Keywords: "neural networks"
- Author: "Yann LeCun"
- ArXiv ID: "1706.03762"
Unit Testing
๐ค Contributing
We welcome contributions! Here's how to get started:
- Fork the Repository
- Create a Feature Branch
- Make Your Changes
- Test Thoroughly
- Submit a Pull Request
Contribution Guidelines
- Follow Python PEP 8 style guidelines
- Add docstrings to new functions
- Include tests for new features
- Update documentation as needed
๐ Resources
ArXiv Resources
Dify Resources
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Troubleshooting
Common Issues
Issue: "No good Arxiv Result was found"
- Solution: Try different keywords, check spelling, or broaden your search terms
Issue: "Arxiv exception: HTTPError"
- Solution: Check internet connection or try again later (ArXiv may be temporarily unavailable)
Issue: Results are truncated
- Solution: Increase in the configuration
Issue: Tool not appearing in Dify
- Solution: Ensure plugin is properly installed and workspace is refreshed
Debug Mode
Enable debug logging for detailed error information:
๐ Performance Notes
- Rate Limits: ArXiv has rate limiting; avoid excessive concurrent requests
- Response Time: Searches typically take 1-3 seconds depending on query complexity
- Memory Usage: Plugin uses minimal memory (~1MB as configured)
- Content Limits: Results are truncated to prevent memory issues with large papers
๐ Version History
- v0.0.2: Current version with enhanced error handling and AI summaries
- v0.0.1: Initial release with basic search capabilities