CLI and Cursor skill to refine graphify knowledge graphs with DeepRefine
Project description
DeepRefine-Skill
Cursor skill and CLI to refine graphify knowledge graphs with DeepRefine (graphify-out/graph.json + session query history).
This repository is standalone. The DeepRefine model code (autorefiner, atlas_rag) lives in a separate DeepRefine checkout.
Repository layout
DeepRefine-Skill/ ← this repo (pip install -e .)
├── README.md
├── SKILL.md
├── pyproject.toml
├── deeprefine_skill/
└── scripts/deeprefine.py
DeepRefine/ ← separate clone (training + Reafiner)
├── autorefiner/
├── AutoSchemaKG/
└── ...
your-kb-project/ ← your data (graphify-out/)
└── graphify-out/graph.json
Recommended clone layout:
www/code/
├── DeepRefine/
└── DeepRefine-Skill/ # sibling → auto-detected if DEEPREFINE_REPO unset
How graphify and DeepRefine fit together
| Stage | Tool | Input | Output |
|---|---|---|---|
| Build | graphify | Project files | graphify-out/graph.json, report, HTML |
| Query | graphify | Questions | graphify query "..." |
| Refine | DeepRefine (this repo) | Graph + query history | Updated graph.json, logs |
DeepRefine does not build the graph; it edits graph.json incrementally so later graphify query works better.
Setup
1. DeepRefine environment (atlastune)
Follow DeepRefine/README Environment to create atlastune and install the main repo:
conda activate atlastune
cd /path/to/DeepRefine
pip install -e .
2. Install this CLI
From PyPI:
conda activate atlastune
pip install deeprefine-cli
From source (development):
pip install -e /path/to/DeepRefine-Skill
Verify:
deeprefine --help
deeprefine refinestill requires a local DeepRefine checkout (autorefiner,atlas_rag) and running vLLM services — see below.
3. Point to DeepRefine (if not cloned as sibling)
Only needed when DeepRefine is not at ../DeepRefine relative to this repo and not found by walking up from your cwd:
export DEEPREFINE_REPO=/path/to/DeepRefine
Add to ~/.bashrc if you use a fixed path.
4. Start vLLM (before deeprefine refine)
From the DeepRefine repo:
conda activate atlastune
bash /path/to/DeepRefine/scripts/vllm_serve/qwen3-0.6b-emb.sh
bash /path/to/DeepRefine/scripts/vllm_serve/qwen3-8b-vllm-reafiner.sh
| Variable | Default |
|---|---|
DEEPREFINE_LLM_URL |
http://127.0.0.1:8134/v1 |
DEEPREFINE_EMBED_URL |
http://127.0.0.1:8128/v1 |
DEEPREFINE_MODEL |
HaoyuHuang2/DeepRefine-v1-8B |
DEEPREFINE_EMBED_MODEL |
Qwen/Qwen3-Embedding-0.6B |
5. Install Cursor skill (KB project root)
cd /path/to/your-kb-project # must contain or will contain graphify-out/
deeprefine cursor install
Same pattern as graphify cursor install. Use --user for all projects.
Workflow with graphify
One-time
pip install graphifyy
graphify cursor install # in KB project
pip install -e /path/to/DeepRefine-Skill # in atlastune
deeprefine cursor install # in KB project
Per session (KB project root)
/graphify .orgraphify .→graphify-out/graph.jsongraphify query "..."or/graphify query "..."deeprefine history add --query "..."/deeprefineordeeprefine refine- Optional:
graphify query "..."again to verify
project files ──graphify──► graph.json
│
graphify query
│
deeprefine history add
│
deeprefine refine
│
graphify query
Command cheat sheet (KB project root)
deeprefine history add --query "..."
deeprefine history list --pending
deeprefine refine
deeprefine refine --query "..."
deeprefine index --rebuild
Where to run commands
| Command | Directory |
|---|---|
pip install -e .../DeepRefine-Skill |
Any |
pip install -e .../DeepRefine |
DeepRefine repo |
graphify / deeprefine cursor install |
KB project root |
deeprefine refine |
KB project root |
| vLLM serve scripts | DeepRefine repo |
Agent instructions: SKILL.md.
Publish to PyPI (maintainers)
cd /path/to/DeepRefine-Skill
python -m pip install --upgrade build twine
python -m build
twine check dist/*
twine upload dist/* # needs PyPI token: TWINE_USERNAME=__token__ TWINE_PASSWORD=pypi-...
Test install from TestPyPI first (optional):
twine upload --repository testpypi dist/*
pip install -i https://test.pypi.org/simple/ deeprefine-cli
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deeprefine_cli-0.1.3.tar.gz.
File metadata
- Download URL: deeprefine_cli-0.1.3.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb92f29f7686988c03a0c6affdc9d743cdd20bfa14454365b20bdce0c36a318
|
|
| MD5 |
9dcb57cce4789282697b3729cbf2a074
|
|
| BLAKE2b-256 |
4ca5109dae0ae32ad2175348b8ecbf34d1ac7001117b2558a0915119505b5ac0
|
File details
Details for the file deeprefine_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: deeprefine_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfe9f70cfe303314f78b368134781da83ad2f5aa195920b347d1fb31982bfd37
|
|
| MD5 |
15ff00dc8f29f0610a3f265f5b8839cf
|
|
| BLAKE2b-256 |
e4714a56b92067d33bb6568ae7697a694f6c2f3b0bc24e50d94cf1e0aa8a1ffc
|