Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions ai4s_semantic_scholar/GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# AI4S Semantic Scholar 插件使用指南

## 快速开始

### 1. 获取 API Key

1. 访问 [ai4scholar.net](https://ai4scholar.net)
2. 注册账号
3. 在个人中心获取 API Key

### 2. 配置插件

在 Dify 平台中:
1. 进入「插件」页面
2. 找到 Semantic Scholar 插件
3. 点击「配置」
4. 输入你的 API Key

### 3. 开始使用

插件提供以下工具,可在 Dify 工作流或聊天应用中使用:

## 使用场景示例

### 场景一:文献调研

使用**语义搜索**找到相关论文:

```
查询:"deep learning for medical image analysis"
年份:2020-2024
领域:Computer Science, Medicine
仅开放获取:是
```

### 场景二:查找特定论文

使用**标题搜索**:

```
标题:Attention Is All You Need
年份:2017
```

### 场景三:深入了解论文

使用**论文详情**获取完整信息:

```
论文ID:DOI:10.48550/arXiv.1706.03762
包含引用:是
包含参考文献:是
```

### 场景四:比较多篇论文

使用**多篇论文详情**:

```
论文ID列表:
DOI:10.48550/arXiv.1706.03762
DOI:10.48550/arXiv.1810.04805
DOI:10.48550/arXiv.2005.14165
```

### 场景五:调研作者

使用**作者搜索**:

```
作者姓名:Yann LeCun
返回数量:5
```

## 常见问题

### Q: API Key 无效?

A: 请确认:
1. API Key 复制完整,没有多余空格
2. 账号积分充足
3. API Key 没有被禁用

### Q: 搜索结果太少?

A: 尝试:
1. 使用更通用的关键词
2. 扩大年份范围
3. 移除领域筛选

### Q: 如何获取论文 PDF?

A: 搜索结果中会显示开放获取的 PDF 链接。勾选"仅开放获取"可只返回有免费 PDF 的论文。

## 积分消耗说明

每次 API 调用消耗 1 积分,批量操作按实际调用次数计算。

如需更多积分,请访问 [ai4scholar.net](https://ai4scholar.net) 充值。

## 联系支持

- 微信:literaf
- 网站:[ai4scholar.net](https://ai4scholar.net)
21 changes: 21 additions & 0 deletions ai4s_semantic_scholar/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 literaf

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
90 changes: 90 additions & 0 deletions ai4s_semantic_scholar/PRIVACY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Privacy Policy

**Last Updated**: December 31, 2024

This privacy policy describes how the AI4S Semantic Scholar plugin ("Plugin") collects, uses, and shares information.

---

## 1. Data Collection

### Data We Collect

| Data Type | Description | Purpose |
|-----------|-------------|---------|
| **Search Queries** | Text queries entered by users | To perform paper/author searches |
| **Paper IDs** | S2 ID, DOI, arXiv ID provided by users | To retrieve paper details |
| **Author IDs** | Semantic Scholar author IDs | To retrieve author information |
| **API Key** | User's ai4scholar.net API key | To authenticate API requests |

### Data We Do NOT Collect

- Personal identification information (name, email, etc.)
- Device information
- Location data
- Usage analytics or tracking data

---

## 2. Data Usage

All collected data is used **solely** for the following purposes:

1. **Processing API Requests**: Search queries and IDs are sent to ai4scholar.net API to retrieve academic paper information.
2. **Authentication**: API keys are used to authenticate requests and track credit usage.

**We do NOT**:
- Store user queries or search history
- Use data for advertising or marketing
- Sell or share data with third parties (except as described below)

---

## 3. Third-Party Services

This plugin uses the following third-party services:

| Service | Purpose | Privacy Policy |
|---------|---------|----------------|
| **ai4scholar.net** | Academic paper search API | [ai4scholar.net](https://ai4scholar.net) |
| **Semantic Scholar** | Underlying data source | [Semantic Scholar Privacy](https://www.semanticscholar.org/privacy-policy) |

Data sent to these services is subject to their respective privacy policies.

---

## 4. Data Retention

- **No local storage**: The plugin does not store any user data locally.
- **API logs**: ai4scholar.net may retain API usage logs for billing and security purposes. See [ai4scholar.net](https://ai4scholar.net) for details.

---

## 5. Data Security

- API keys are transmitted securely and stored using Dify's credential management system.
- All API communications use HTTPS encryption.

---

## 6. User Rights

You have the right to:
- Stop using the plugin at any time
- Request deletion of your ai4scholar.net account and associated data

---

## 7. Changes to This Policy

We may update this privacy policy from time to time. Changes will be reflected in the "Last Updated" date above.

---

## 8. Contact

For privacy concerns or questions, please contact:

- **GitHub Issues**: [dify-plugin-ai4s-semantic-scholar](https://github.com/literaf/dify-plugin-ai4s-semantic-scholar/issues)
- **WeChat**: literaf
- **Website**: [ai4scholar.net](https://ai4scholar.net)
138 changes: 138 additions & 0 deletions ai4s_semantic_scholar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# AI4S Semantic Scholar

Academic paper search plugin powered by [ai4scholar.net](https://ai4scholar.net) API for Dify platform.

**Author**: [ai4scholar](https://ai4scholar.net)
**Repository**: [dify-plugin-ai4s-semantic-scholar](https://github.com/literaf/dify-plugin-ai4s-semantic-scholar)

[English Documentation](./README.md) | [中文文档](./README_ZH.md)

---

## Overview

- **Plugin Type**: Tool Plugin (Python)
- **Tools**: 11 tools (Paper Search / Paper Details / Paper Analysis / Author Search)
- **Output**: text (Markdown format)

This plugin wraps the Semantic Scholar API via ai4scholar.net proxy, providing stable service with unified credit billing.

---

## Configuration (Provider Credentials)

After installing the plugin in Dify, configure the following credentials:

| Credential | Required | Description |
|-----------|----------|-------------|
| `api_key` | ✅ Yes | Your ai4scholar.net API Key |

**Get API Key**: Visit [ai4scholar.net](https://ai4scholar.net) to register and obtain your API key.

---

## Tools

### Paper Search

| Tool | API Endpoint | Description |
|------|-------------|-------------|
| **Semantic Search** (`semantic_search`) | `GET /graph/v1/paper/search` | Search papers by relevance using natural language |
| **Title Search** (`title_search`) | `GET /graph/v1/paper/search/match` | Search papers by exact or partial title |
| **Bulk Search** (`bulk_search`) | `GET /graph/v1/paper/search/bulk` | Execute multiple search queries at once |

### Paper Details

| Tool | API Endpoint | Description |
|------|-------------|-------------|
| **Paper Detail** (`paper_detail`) | `GET /graph/v1/paper/{paper_id}` | Get detailed information for a single paper |
| **Multiple Papers Detail** (`multiple_papers_detail`) | `POST /graph/v1/paper/batch` | Get details for multiple papers at once |

### Paper Analysis

| Tool | API Endpoint | Description |
|------|-------------|-------------|
| **Paper Recommendations** (`paper_recommendations`) | `GET /recommendations/v1/papers` | Get recommended papers based on a given paper |
| **Paper Citations** (`paper_citations`) | `GET /graph/v1/paper/{paper_id}/citations` | Get papers that cite the given paper |
| **Paper References** (`paper_references`) | `GET /graph/v1/paper/{paper_id}/references` | Get reference papers of the given paper |

### Author Search

| Tool | API Endpoint | Description |
|------|-------------|-------------|
| **Author Search** (`author_search`) | `GET /graph/v1/author/search` | Search authors and get publication statistics |
| **Author Detail** (`author_detail`) | `GET /graph/v1/author/{author_id}` | Get author details (h-index, citation count, etc.) |
| **Author Papers** (`author_papers`) | `GET /graph/v1/author/{author_id}/papers` | Get papers published by an author |

---

## Parameters

### Semantic Search

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | ✅ | Natural language search query |
| `limit` | number | ❌ | Number of results (1-100, default 10) |
| `year` | string | ❌ | Year filter (e.g., "2020", "2020-2024") |
| `fields_of_study` | string | ❌ | Field of study filter |
| `open_access_only` | boolean | ❌ | Only return open access papers |

### Paper Detail

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `paper_id` | string | ✅ | Paper ID (supports S2 ID, DOI, arXiv ID) |
| `include_citations` | boolean | ❌ | Include citing papers |
| `include_references` | boolean | ❌ | Include reference papers |

### Paper Recommendations / Citations / References

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `paper_id` | string | ✅ | Paper ID (supports S2 ID, DOI, arXiv ID) |
| `limit` | number | ❌ | Number of results (default 10-20) |

### Author Search

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | ✅ | Author name |
| `limit` | number | ❌ | Number of results (1-20, default 5) |

### Author Detail / Author Papers

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `author_id` | string | ✅ | Semantic Scholar author ID |
| `limit` | number | ❌ | Number of results (for author_papers only) |

---

## Credits

Each API call consumes 1 credit. Batch operations are charged per actual API call.

To get more credits, visit [ai4scholar.net](https://ai4scholar.net).

---

## Links

- [ai4scholar.net](https://ai4scholar.net) - API Service
- [Semantic Scholar API Docs](https://api.semanticscholar.org/api-docs/)
- [Dify Plugin Documentation](https://docs.dify.ai/)

---

## Support

- **GitHub Issues**: [Report a bug or request a feature](https://github.com/literaf/dify-plugin-ai4s-semantic-scholar/issues)
- **WeChat**: literaf
- **Website**: [ai4scholar.net](https://ai4scholar.net)

---

## License

MIT License
Loading