Skip to content

Commit b2ca9d5

Browse files
authored
Merge pull request #1 from HuaDongJian/package/scinet-client-cli
Package SciNet as pip-installable client CLI
2 parents f603d03 + b61691b commit b2ca9d5

21 files changed

Lines changed: 8453 additions & 162 deletions

README.md

Lines changed: 479 additions & 162 deletions
Large diffs are not rendered by default.

README_zh.md

Lines changed: 514 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/SCINET_API_DOC.html

Lines changed: 965 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/SCINET_API_DOC_zh.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>SciNet API 文档站</title>
7+
<meta http-equiv="refresh" content="0; url=SCINET_API_DOC.html?lang=zh">
8+
<script>location.replace("SCINET_API_DOC.html?lang=zh");</script>
9+
</head>
10+
<body>
11+
<p>正在打开 <a href="SCINET_API_DOC.html?lang=zh">SciNet API 中文文档站</a>...</p>
12+
</body>
13+
</html>

docs/api/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>SciNet API Documentation</title>
7+
<meta http-equiv="refresh" content="0; url=SCINET_API_DOC.html">
8+
<script>location.replace("SCINET_API_DOC.html");</script>
9+
</head>
10+
<body>
11+
<p>Opening <a href="SCINET_API_DOC.html">SciNet API Documentation</a>...</p>
12+
</body>
13+
</html>

scinet/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SciNet public API configuration.
2+
SCINET_API_BASE_URL=http://scinet.openkg.cn
3+
SCINET_API_KEY=your-personal-scinet-token
4+
SCINET_TIMEOUT=900
5+
SCINET_RUNS_DIR=./runs

scinet/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.env
2+
.env.local
3+
token.env
4+
*.sqlite3
5+
.cache/
6+
runs/
7+
__pycache__/
8+
*.pyc
9+
dist/
10+
build/
11+
*.egg-info/
12+
.venv/
13+
.DS_Store

scinet/MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md
2+
include .env.example
3+
recursive-include examples *.sh\ninclude src/scinet/builtin_skills.json\ninclude README_skills.md\n

scinet/README.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# SciNet Client
2+
3+
A lightweight pip-installable client and CLI for the hosted SciNet / KG2API service.
4+
5+
SciNet provides scientific knowledge-graph retrieval for paper search, related-author discovery, author-paper lookup, literature review, idea grounding/evaluation, idea generation, trend analysis, and researcher review.
6+
7+
## Installation
8+
9+
Install directly from GitHub:
10+
11+
```bash
12+
pip install git+https://github.com/zjunlp/SciNet.git
13+
```
14+
15+
For isolated CLI usage:
16+
17+
```bash
18+
pipx install git+https://github.com/zjunlp/SciNet.git
19+
```
20+
21+
After installation:
22+
23+
```bash
24+
scinet -h
25+
```
26+
27+
## Get an API Token
28+
29+
Open:
30+
31+
```text
32+
http://scinet.openkg.cn/register
33+
```
34+
35+
Complete email verification and copy your personal token.
36+
37+
Then configure:
38+
39+
```bash
40+
export SCINET_API_BASE_URL="http://scinet.openkg.cn"
41+
export SCINET_API_KEY="your-personal-scinet-token"
42+
```
43+
44+
You can also create a local `.env` from `.env.example`, although the CLI reads environment variables directly.
45+
46+
## Quick Start
47+
48+
```bash
49+
scinet health
50+
scinet config
51+
```
52+
53+
Search papers:
54+
55+
```bash
56+
scinet --timeout 900 search-papers \
57+
--query "open world agent" \
58+
--domain "artificial intelligence" \
59+
--time-range 2020-2024 \
60+
--keyword "high:open world agent" \
61+
--top-k 3 \
62+
--top-keywords 0 \
63+
--max-titles 0 \
64+
--max-refs 0 \
65+
--report-max-items 3
66+
```
67+
68+
Literature review:
69+
70+
```bash
71+
scinet --timeout 900 literature-review \
72+
--query "retrieval augmented generation" \
73+
--domain "artificial intelligence" \
74+
--time-range 2020-2025 \
75+
--keyword "high:retrieval augmented generation" \
76+
--top-k 5
77+
```
78+
79+
Idea evaluation:
80+
81+
```bash
82+
scinet --timeout 900 idea-evaluate \
83+
--idea "LLM-based multi-perspective evaluation for scientific research ideas" \
84+
--keyword "high:idea evaluation" \
85+
--top-k 3
86+
```
87+
88+
Researcher review:
89+
90+
```bash
91+
scinet --timeout 900 researcher-review \
92+
--author "Yoshua Bengio" \
93+
--limit 10 \
94+
--no-abstract
95+
```
96+
97+
## Python SDK
98+
99+
```python
100+
from scinet import SciNetClient
101+
102+
client = SciNetClient()
103+
print(client.health())
104+
105+
result = client.search_papers(
106+
query="open world agent",
107+
keywords=[{"text": "open world agent", "score": 10}],
108+
top_k=3,
109+
)
110+
111+
print(result)
112+
```
113+
114+
## Commands
115+
116+
| Command | Purpose |
117+
|---|---|
118+
| `health` | Check backend health |
119+
| `config` | Show configuration |
120+
| `build-plan` | Build a structured plan without calling backend |
121+
| `search-papers` | Search related papers |
122+
| `related-authors` | Retrieve related authors |
123+
| `author-papers` | Query papers by author |
124+
| `support-papers` | Retrieve support papers |
125+
| `paper-search` | Lightweight low-level paper search |
126+
| `literature-review` | Review-oriented paper retrieval |
127+
| `idea-grounding` | Ground a research idea against literature |
128+
| `idea-evaluate` | Collect evidence for idea evaluation |
129+
| `idea-generate` | Discover idea seeds |
130+
| `trend-report` | Research trend analysis |
131+
| `researcher-review` | Researcher background review |
132+
| `make-report` | Regenerate Markdown report from saved artifacts |
133+
134+
## Outputs
135+
136+
Each run saves artifacts under:
137+
138+
```text
139+
runs/<run_id>/
140+
plan.json
141+
request.json
142+
response.json
143+
summary.txt
144+
report.md
145+
metadata.json
146+
```
147+
148+
## Development
149+
150+
Install editable mode:
151+
152+
```bash
153+
pip install -e .
154+
scinet -h
155+
```
156+
157+
Build package:
158+
159+
```bash
160+
python -m pip install build twine
161+
python -m build
162+
twine check dist/*
163+
```
164+
165+
## Security
166+
167+
Do not commit `.env`, API tokens, SMTP credentials, `.cache/`, or `runs/`.
168+
169+
## License
170+
171+
MIT.

scinet/README_skills.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SciNet Skills
2+
3+
SciNet skills are editable JSON presets for downstream research workflows.
4+
5+
```bash
6+
scinet skill list
7+
scinet skill show literature-review
8+
scinet skill run literature-review --query "open world agent" --keyword "high:open world agent"
9+
scinet skill init my-review --from literature-review
10+
```
11+
12+
User-defined skills are loaded from:
13+
14+
1. `./skills/*.json`
15+
2. `~/.scinet/skills/*.json`
16+
3. paths in `SCINET_SKILLS_DIR`
17+
18+
User skills override builtin skills with the same name.

0 commit comments

Comments
 (0)