Skip to main content

CLI and Cursor skill to refine graphify knowledge graphs with DeepRefine

Project description

DeepRefine-Skill

DeepRefine Logo
██████╗ ███████╗███████╗██████╗ ██████╗ ███████╗███████╗██╗███╗   ██╗███████╗
██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗  ██║██╔════╝
██║  ██║█████╗  █████╗  ██████╔╝██████╔╝█████╗  █████╗  ██║██╔██╗ ██║█████╗  
██║  ██║██╔══╝  ██╔══╝  ██╔═══╝ ██╔══██╗██╔══╝  ██╔══╝  ██║██║╚██╗██║██╔══╝  
██████╔╝███████╗███████╗██║     ██║  ██║███████╗██║     ██║██║ ╚████║███████╗
╚═════╝ ╚══════╝╚══════╝╚═╝     ╚═╝  ╚═╝╚══════╝╚═╝     ╚═╝╚═╝  ╚═══╝╚══════╝

PyPi Python Paper Project

workflow

DeepRefine-Skill plugs into agent workflows and use a single command /deeprefine in your agent CLI to refine and evolve your LLM-Wiki (e.g., graphify) knowledge base.

/deeprefine

It refines your graphify knowledge graph for better future retrieval and Q&A quality.


News

  • [2026/6/15] v0.1.8 - Aligned interaction memory with LLM-Wiki (graphify) and fixed the single query refinement issue.
  • [2026/6/2] v0.1.7 — Cursor skill + deeprefine refine with configurable API. And strict DeepRefine agent loop.

Agent CLI (Recommended)

This is the default mode and the main workflow for this project.

Why Agent CLI first

  • Uses your current Cursor session model (no separate API/vLLM setup required)
  • Follows the same control flow as Reafiner.refine()
  • Integrates with graphify query memory automatically
  • Handles pending queries in batch, one by one

One-time setup

pip install deeprefine-cli graphifyy

cd /path/to/your-kb-project
graphify cursor install
deeprefine cursor install

After upgrading the package, run deeprefine cursor install again to refresh local skill files.

Typical session (Agent CLI)

/graphify .
./graphify ./ --wiki
/graphify query "your question"
/deeprefine

What /deeprefine does now (default queue behavior)

When you run /deeprefine, it should follow this order:

  1. deeprefine history sync-memory
    • import queries from graphify-out/memory/query_*.md
    • write to graphify-out/.deeprefine/history.jsonl
  2. load pending queries from history.jsonl (refined != true)
  3. refine all pending queries sequentially
  4. mark each finished query as refined via deeprefine loop finish

Agent artifacts

graphify-out/
├── graph.json                              # graphify main graph (refined in-place)
├── memory/
│   └── query_*.md                          # graphify query logs (sync source)
└── .deeprefine/
    ├── history.jsonl                       # DeepRefine-maintained history queue
    ├── graph.json.bak                      # backup before first apply in this run
    ├── loop_trace_<query_id>.json          # per-query loop audit trace
    ├── refinement_results_<YYYYMMDD>.jsonl # per-day run log
    └── refinement_actions_*.txt            # optional; only when refinement path is taken

Agent-related commands

Run from your KB project root.

Command Description
deeprefine cursor install Install /deeprefine skill into current project
deeprefine cursor install --user Install skill for all projects (~/.cursor/skills/)
deeprefine history sync-memory Import graphify-out/memory/query_*.md into DeepRefine history
deeprefine history list --pending Show unrefined queue
deeprefine loop init --query "..." Create loop_trace_<id>.json template
deeprefine loop validate --trace-file T Validate trace against Reafiner control flow
deeprefine apply --trace-file T --refinement-file F Apply <refinement> actions to graph.json
deeprefine loop finish --trace-file T [--refinement-file F] Persist results and mark history refined

Terminal CLI (FAISS + API/vLLM)

Use this section when you want a pure terminal workflow without Cursor /deeprefine.

Extra requirements

  • DeepRefine repository installed in atlastune
  • Inference backend configured (API or vLLM)
conda activate atlastune
cd /path/to/DeepRefine && pip install -e .
pip install deeprefine-cli

# Optional, if DeepRefine repo is elsewhere
export DEEPREFINE_REPO=/path/to/DeepRefine

Inference environment (CLI mode)

Variable Default
DEEPREFINE_LLM_URL (empty; SDK default)
DEEPREFINE_EMBED_URL (empty; SDK default)
DEEPREFINE_API_KEY fallback to OPENAI_API_KEY
DEEPREFINE_LLM_API_KEY fallback to DEEPREFINE_API_KEY
DEEPREFINE_EMBED_API_KEY fallback to DEEPREFINE_API_KEY
DEEPREFINE_MODEL gpt-4.1-mini
DEEPREFINE_EMBED_MODEL text-embedding-3-small

Terminal workflow

cd /path/to/your-kb-project

# Option A: import from graphify memory first (recommended)
deeprefine history sync-memory
deeprefine history list --pending
deeprefine refine

# Option B: add one explicit query
deeprefine history add --query "your question"
deeprefine refine

Terminal commands

Command Description
deeprefine history add --query "..." Append one query to history
deeprefine history list List all history rows
deeprefine history sync-memory Import graphify memory queries into history
deeprefine history list --pending List only unrefined queries
deeprefine refine Refine all pending queries
deeprefine refine --query "..." Refine a single query (also records it)
deeprefine refine --rebuild-index Rebuild FAISS before refine
deeprefine index --rebuild Rebuild FAISS cache only

Installation

Method Command
PyPI pip install deeprefine-cli==0.1.7
Source pip install -e /path/to/DeepRefine-Skill
deeprefine --help
# Expect: cursor, history, index, refine, apply, loop

License

MIT — see LICENSE.

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

deeprefine_cli-0.1.8.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

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

deeprefine_cli-0.1.8-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file deeprefine_cli-0.1.8.tar.gz.

File metadata

  • Download URL: deeprefine_cli-0.1.8.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for deeprefine_cli-0.1.8.tar.gz
Algorithm Hash digest
SHA256 c93d0aca27d70153b1a6e9f6d7faaf9af70c0a7ea2784d805c16944aac443a2f
MD5 30c820da8c1ec9e60b44f16c1d1c4e41
BLAKE2b-256 5041e99cc4f942781fd8275df7da9d3ed06d5f53d9bf90022121678f84e4ed71

See more details on using hashes here.

File details

Details for the file deeprefine_cli-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: deeprefine_cli-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for deeprefine_cli-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e3fd74190063302dd0dcdbe456c14419a669f2c4692ef3ced157e33e35333112
MD5 18bd61a265b400e2e76d1854bd051303
BLAKE2b-256 95019f37bf97ac6ca8dd05093977ae4b7ebcc4d0b0c5871a9c68cb2eba147185

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