██████╗ ███████╗███████╗██████╗ ██████╗ ███████╗███████╗██╗███╗   ██╗███████╗
██╔══██╗██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗  ██║██╔════╝
██║  ██║█████╗  █████╗  ██████╔╝██████╔╝█████╗  █████╗  ██║██╔██╗ ██║█████╗  
██║  ██║██╔══╝  ██╔══╝  ██╔═══╝ ██╔══██╗██╔══╝  ██╔══╝  ██║██║╚██╗██║██╔══╝  
██████╔╝███████╗███████╗██║     ██║  ██║███████╗██║     ██║██║ ╚████║███████╗
╚═════╝ ╚══════╝╚══════╝╚═╝     ╚═╝  ╚═╝╚══════╝╚═╝     ╚═╝╚═╝  ╚═══╝╚══════╝

Evolve your LLM-Wiki from Interaction History.

DeepRefine-Skill plugs into agent workflows and exposes one command /deeprefine to refine and evolve your LLM-Wiki from query interaction history.

releasev0.1.8
python3.10+
licenseMIT

Agent CLI (Recommended)

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

DeepRefine uses your current agent session model, syncs graphify memory, and refines pending history queries in batch.

Why Agent CLI First

  • Uses your current Cursor/agent session model.
  • Follows the same control flow as Reafiner.refine().
  • Integrates with graphify query memory automatically.
  • Handles pending queries one-by-one instead of single-query refine.

What /deeprefine Does

Default queue behavior when you invoke /deeprefine:

  • Run deeprefine history sync-memory.
  • Import graphify-out/memory/query_*.md into history.jsonl.
  • Load pending queries where refined != true.
  • Refine pending queries sequentially and mark done via loop finish.

Agent Quick Start

One-time setup at your KB project root.

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

Typical session in agent CLI.

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

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

Terminal CLI (FAISS + API/vLLM)

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

This mode requires the original DeepRefine repository in your environment.

conda activate atlastune cd /path/to/DeepRefine && pip install -e . pip install deeprefine-cli # optional when DeepRefine repo is elsewhere export DEEPREFINE_REPO=/path/to/DeepRefine

Terminal workflow (recommended path).

cd /path/to/your-kb-project deeprefine history sync-memory deeprefine history list --pending deeprefine refine

Core Commands

Run from your KB project root.

Agent-related Commands

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 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
deeprefine refine --query "..." Refine one query
deeprefine refine --rebuild-index Rebuild FAISS first
deeprefine index --rebuild Rebuild FAISS cache only

What It Produces

Structured artifacts for reproducibility, auditing, and iterative graph improvement.

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 for refinement path