name: sqlite-graphrag description: This skill MUST activate for sqlite-graphrag CLI operations including persistent memory, GraphRAG, entity graph, hybrid search, recall, remember, ingest, enrich, deep-research, LLM embedding, backend selection (codex claude opencode), OAuth-only enforcement, preflight validation, FTS5, BLOB-backed cosine similarity, CWD isolation, namespace management, migration, maintenance. Activates on keywords memory RAG GraphRAG SQLite one-shot OAuth offline persistent graph entity embedding codex claude opencode remember recall hybrid-search ingest enrich forget purge link
When This Skill Activates
- ACTIVATE when the user asks to remember, save, recall, retrieve, search, or persist anything across sessions
- ACTIVATE for long-term context, knowledge graph, GraphRAG, RAG, entity linking, memory management
- ACTIVATE when sqlite, sqlite-graphrag, embedding, FTS5, hybrid-search, or LLM memory is mentioned
- NEVER ACTIVATE for one-off ephemeral data, simple file I/O, or tasks unrelated to persistent context
LLM Prompt Instruction Rules
- WHEN user says "remember this", "save this", "persist this" → EXECUTE
remember --force-mergewith--graph-stdinincluding curated entities and canonical relations - WHEN user asks "what do you know about X", "recall X", "search X" → EXECUTE
hybrid-search "X" --k 10 --jsonFIRST, then EXPAND top results withread --name <name> --json - WHEN user asks "how is X related to Y" → EXECUTE
graph traverse --from X --depth 2 --jsonorrelated X --hops 2 --json - WHEN user asks "deep research on X" → EXECUTE
deep-research "X" --k 20 --max-hops 3 --json - BEFORE creating ANY memory → EXECUTE
hybrid-search "<name>" --k 5 --jsonto CHECK duplicates; if found, USE--force-mergeto UPDATE - AFTER creating or updating memory → VERIFY with
read --name <name> --json | jaq '{name, description, body_length}' - AFTER EVERY turn with new findings → EVALUATE whether to persist via
remember --force-merge; if nothing new, DECLARE "No new findings to persist" - WHEN exit code is non-zero → READ JSON error envelope from stdout via
jaq '{code, message, error_class}', REPORT remediation steps - WHEN exit code 9 (duplicate) → RETRY with
--force-merge - WHEN exit code 19 (SHUTDOWN) → RETRY MANDATORY; partial work discarded
- WHEN exit code 75 (singleton locked) → WAIT and retry; NEVER increase concurrency
- WHEN exit code 16 (preflight) → FIX MCP config; NEVER bypass with
SKIP_PREFLIGHT - ALWAYS parse JSON output with
jaq(NEVERjq) - ALWAYS pass
--jsonflag on everysqlite-graphraginvocation - ALWAYS use
--llm-backend codex --llm-model gpt-5.4-miniOR--llm-backend claude --llm-model claude-sonnet-4-6OR--llm-backend opencode --llm-model opencode/big-picklefor embedding commands - ALWAYS use canonical relations ONLY:
applies-to,uses,depends-on,causes,fixes,contradicts,supports,follows,related,mentions,replaces,tracked-in - ALWAYS map non-canonical relations BEFORE persisting:
adds|creates → causes,implements → supports,blocks → contradicts,tested-by → related,part-of → applies-to - ALWAYS normalize entity names to kebab-case ASCII lowercase BEFORE passing to CLI
- NEVER use MCP Serena or
.mdmemory files for persistence - NEVER write MEMORY.md or any file-based memory
- NEVER start or reference daemon (REMOVED)
- NEVER pass
ANTHROPIC_API_KEYorOPENAI_API_KEYin environment - PREFER
remember --force-mergeovereditfor updates to ensure re-indexation - PREFER
--graph-stdinwith curated entities over--enable-nerfor extraction quality - LIMIT graph entities to domain-specific concepts: projects, tools, people, decisions, files, incidents
- REJECT generic words, pronouns, UUIDs, hashes, timestamps as entity names
Architecture and Principles
- INVOKE always as subprocess; READ stdout for JSON/NDJSON; READ stderr for logs; CHECK exit code BEFORE parsing
- KNOW BUILD is LLM-only one-shot; binary has NO daemon, NO ONNX runtime, NO model cache
- KNOW COSINE similarity is pure Rust over BLOB-backed
memory_embeddings,entity_embeddings,chunk_embeddings - KNOW SCHEMA is v15 after
initormigrateon fresh database - ENFORCE OAUTH-ONLY: spawn ABORTS exit 1 if
ANTHROPIC_API_KEYorOPENAI_API_KEYis set - KNOW
ANTHROPIC_AUTH_TOKEN,ANTHROPIC_BASE_URL,OPENAI_BASE_URLare PRESERVED for custom providers (OpenRouter, Bedrock) - KNOW hardening flags are ALWAYS passed to
claude -pandcodex execsubprocesses - KNOW subprocess CWD is ISOLATED to temp dir via
apply_cwd_isolation;CLAUDE_CONFIG_DIRset to isolation dir - KNOW orphan spawn directories are cleaned via
cleanup_isolation_dirs - KNOW 7 preflight guards run BEFORE every LLM subprocess fork:
check_argv_size,check_binary_exists,check_mcp_config_inline,check_mcp_config_path,check_walkup_mcp_json,check_output_buffer,check_claude_config_dir - KNOW exit code 16 (
EX_CONFIG) is the universal preflight failure code; READ error envelope for variant-specific remediation - SET
SQLITE_GRAPHRAG_SKIP_PREFLIGHT=1ONLY in emergencies - ISOLATE NAMESPACE per project via
--namespace <ns>or env; default isglobal - NEVER expose the binary as MCP server or HTTP service
- NEVER write
.sqlitefile in parallel to the binary or from another tool - USE MOCK LLM CLI for CI: prepend
tests/mock-llmto PATH
Backend LLM Selection
- PASS
--llm-backend codexto spawn Codex CLI headless (DEFAULT backend) - PASS
--llm-backend claudeto spawn Claude Code headless viaembed_via_claude_local(zero-token, OAuth-compatible) - PASS
--llm-backend opencodeto spawn OpenCode CLI headless (own auth system, NOT OAuth) - PASS
--llm-backend codex,claudefor codex-first with claude fallback - PASS
--llm-backend codex,claude,opencode,nonefor full fallback chain with null embedding last resort - PASS
--llm-model <MODEL>to select embedding model for the active backend - KNOW DEFAULT models: codex=
gpt-5.5, claude=claude-sonnet-4-6, opencode=opencode/big-pickle - PASS
--llm-fallback-mode <claude|codex|opencode>to swap backend mid-job on rate-limit - PASS
--skip-embedding-on-failureONLY when--llm-backend …,noneis active - PASS
--dry-run-backendto plan backend operation without executing (idempotent preview) - PARSE
backend_invokedfield in every embedding envelope to CONFIRM which backend ran - PASS
--codex-binary <PATH>,--claude-binary <PATH>,--opencode-binary <PATH>to override binary locations - PASS
--opencode-model <MODEL>and--opencode-timeout <SECONDS>for opencode-specific tuning - PASS
--mode codex|claude-code|opencodefor ingest and enrich extraction pipelines - KNOW opencode NDJSON output has 3 event types:
step_start,text,step_finish - KNOW opencode free models:
opencode/big-pickle,opencode/deepseek-v4-flash-free,opencode/mimo-v2.5-free,opencode/nemotron-3-ultra-free,opencode/north-mini-code-free - RUN
codex loginto refresh codex OAuth; refresh claude OAuth when stale - NEVER pass API keys with any backend; spawn ABORTS exit 1
Global Flags Reference
--db <PATH>— override database location (NOT global; each subcommand accepts independently)--namespace <ns>— scope operations to a namespace--lang en|pt— force stderr language--tz <TIMEZONE>— localize timestamps--json— structured JSON output (ALWAYS pass)--low-memory— unitary parallelism for constrained containers--max-concurrency N— cap concurrent heavy CLI invocations--wait-lock SECS— widen lock acquisition window--llm-parallelism N— cap embedding subprocess fan-out (default 4, clamp [1, 32])--llm-backend <chain>— backend selection with comma-separated fallback--llm-model <MODEL>— embedding model for active backend--dry-run-backend— plan backend operation without executing--llm-fallback-mode <backend>— swap backend mid-job on rate-limit--llm-fallback <chain>— comma-separated fallback chain tried when primary fails (defaultcodex,claude,none)--llm-slot-no-wait— fail immediately exit 75 when no LLM slot free (instead of waiting)--embedding-dim N— embedding dimensionality override [8, 4096] (default 64 MRL)--graceful-shutdown-secs N— cleanup budget before SIGKILL--skip-embedding-on-failure— exit 0 on embedding failure (ONLY with fallback ending innone)--strict-env-clear— preserve onlyPATHin subprocess for compliance--codex-binary,--claude-binary,--opencode-binary— override binary paths--opencode-model,--opencode-timeout— opencode-specific overrides-v/-vv/-vvv— info/debug/trace logging on stderr
CRUD Write Path (remember, remember-batch, ingest)
- INVOKE
remember --name <kebab> --type <kind> --description <text>with--body <text>or--body-file <path>or--body-stdin - INVOKE
remember --graph-stdinto attach{body, entities, relationships}in single JSON - PASS entities as
[{name, entity_type}]in kebab-case ASCII - PASS relationships as
[{source, target, relation, strength}]wherestrength in [0.0, 1.0] - PASS
--force-mergefor idempotent updates and soft-deleted restoration - PASS
--clear-bodyto wipe body during--force-mergeupdate - PASS
--dry-runto validate inputs without persisting - PASS
--max-rss-mb <MiB>to abort when RSS exceeds threshold (default 8192) - RESPECT 512000 bytes and 512 chunks limit per body
- VALID
--typevalues:user,feedback,project,reference,decision,incident,skill,document,note - USE
--enable-nerfor URL-regex entity extraction (URL-regex ONLY since NER removal) - INVOKE
remember-batchfor 10+ memories via NDJSON stdin; EXPECT per-item status and summary line - INVOKE
ingest <DIR> --recursive --pattern "*.md"to import directory - PASS
--type <kind>to apply same type to all ingested files - PASS
--mode codex|claude-code|opencodefor LLM-curated entity extraction - USE
--auto-describe(default true) to extract description from first body line; opt out via--no-auto-describe - USE
--resumeto continue from queue after interruption;--retry-failedfor failed files only - USE
--fail-fastto stop at first per-file failure - USE
--max-name-length Nto override default name truncation at 60 chars - USE
--llm-parallelism Noningest(default 2);--ingest-parallelism Nfor per-file parallelism - PASS
--claude-model <MODEL>and--claude-timeout <secs>(default 300) for--mode claude-code - PASS
--codex-model <MODEL>and--codex-timeout <secs>(default 300) for--mode codex - PASS
--rate-limit-wait <secs>(default 60) for initial wait on rate-limit with--mode claude-code - PASS
--queue-db <path>for custom queue DB;--keep-queueto preserve it after completion - PASS
--low-memoryoningestfor single-threaded mode (3-4x slower, <4 GB RAM) - PASS
--dry-runoningestto preview file-to-name mapping without persisting - RESPECT
--max-files 10000cap as all-or-nothing validation - NEVER mix
--body,--body-file,--body-stdin,--graph-stdinin single invocation - NEVER pass empty body with no entities via
--graph-stdin - NEVER use
fd | xargs remember; INVOKEingestinstead - NEVER use
--force-mergeiningest(exclusive toremember)
CRUD Read, Update, Delete
- INVOKE
read --name <kebab> --jsonfor O(1) fetch;read --id <N>for lookup by memory_id - PASS
--with-graphto include linked entities and relationships - INVOKE
list --type <kind> --limit N --offset N --jsonto filter and paginate - PASS
--include-deletedto include soft-deleted memories - INVOKE
history --name <n> --diff --jsonfor version history with character diff stats - INVOKE
edit --name <n> --body-file <path>to update body (re-embeds automatically) - USE
--description <text>to update description only (no re-embed) - USE
--type <kind>to change memory type without recreating - USE
--force-reembedto regenerate embedding without body change - USE
--expected-updated-at <ts>for optimistic locking; TREAT exit 3 as conflict - INVOKE
rename --from <old> --to <new>to rename preserving history - INVOKE
restore --name <n> --version <N>to restore old version - INVOKE
forget --name <n>for reversible soft-delete; TREAT exit 4 as absent - INVOKE
purge --retention-days <N> --yesfor hard delete; USE--dry-runfirst - INVOKE
unlink --from <a> --to <b> --relation <type>for edge removal;--entity <name> --allfor bulk - INVOKE
prune-relations --relation <type> --yesfor bulk deletion;--show-entities --dry-runto preview - INVOKE
cleanup-orphans --yesafter bulk forget; thenvacuum --json - NEVER skip optimistic locking in concurrent pipelines
- NEVER delete manually via
sqlite3shell
Entity Graph Operations
- INVOKE
link --from <a> --to <b> --relation <type> --create-missing --weight <float>to create edge - PASS
--entity-type <kind>for auto-created entities (defaultconcept) - PASS
--max-entity-degree Nto warn when entity exceeds N connections - USE
--strict-relationsto fail on non-canonical relation types - INVOKE
graph entities --jsonto list entities; ACCESS via.entities[](NOT.items[]) - SORT via
--sort-by degree|name|created_at; PAGINATE via--limit N --offset N - INVOKE
graph stats --jsonto inspectnode_count,edge_count,avg_degree,max_degree - KNOW entity degree is calculated via accurate COUNT query (
recalculate_degree) - INVOKE
graph traverse --from <root> --depth <N> --jsonfor subgraph traversal - USE
--format json|dot|mermaidwith--output <path>to export graph - INVOKE
memory-entities --name <memory>for forward lookup;--entity <name>for reverse - INVOKE
rename-entity,delete-entity --cascade,merge-entities --names "a,b,c" --into <target> - INVOKE
reclassify --name <n> --new-type <kind>or--from-type <old> --to-type <new> --batch - INVOKE
reclassify-relation --from-relation <old> --to-relation <new> --batchfor bulk relation type migration - INVOKE
normalize-entities --yesto normalize all names to kebab-case ASCII - INVOKE
prune-ner --entity <n>to remove NER bindings;prune-ner --all --yesfor all in namespace - VALIDATE entity names: minimum 2 chars, no newlines, no short ALL_CAPS (4 chars or less REJECTED)
- CANONICAL relations:
applies-to,uses,depends-on,causes,fixes,contradicts,supports,follows,related,mentions,replaces,tracked-in - CANONICAL entity types:
project,tool,person,file,concept,incident,decision,memory,dashboard,issue_tracker,organization,location,date - NEVER use
mentionsas default relation
GraphRAG Search (recall, hybrid-search, related, deep-research, enrich)
- USE canonical three-layer pattern:
hybrid-searchthenread --namethenrelated|graph traverse - INVOKE
recall <query> --k Nfor pure semantic KNN; PASS--no-graphto disable graph expansion - INTERPRET
distanceincreasing as similarity decreasing;score=1.0 - distanceclamped [0.0, 1.0] - INVOKE
hybrid-search <query> --k Nfor FTS5+KNN fusion via RRF - PASS
--rrf-k 60for standard fusion;--weight-vec 1.0 --weight-fts 1.0for balanced - PASS
--type <kind>to filter results by memory type - PASS
--fallback-fts-onlyto skip live embedding and serve FTS5 BM25 only (offline mode) - USE
--with-graph --max-hops 2 --min-weight 0.3for graph expansion; READ BOTHresults[]ANDgraph_matches[] - INVOKE
related <name> --hops Nfor multi-hop traversal from memory - INVOKE
deep-research "<query>" --k 20 --max-hops 3 --max-sub-queries 7 --max-results 50for parallel multi-hop research - PASS
--graph-decay <float>(default 0.7) for score decay per hop;--graph-min-score <float>(default 0.05) for minimum threshold - PASS
--max-neighbors-per-hop Nto limit neighbours per entity per hop - PASS
--timeout <secs>(default 30) for per sub-query timeout - PASS
--with-bodiesto include full memory bodies in results - INVOKE
enrich --operation <op>for LLM graph quality:memory-bindings,entity-descriptions,body-enrich,re-embed --limit N --resume - PASS
--llm-parallelism Nto control concurrent LLM subprocesses - PASS
--max-cost-usd Nto cap accumulated LLM cost (ignored for OAuth users) - USE
--dry-runto preview without spawning LLM - PARSE top fields:
recallreturnsresults[].{name, snippet, distance, score, source};hybrid-searchreturnsresults[].{name, combined_score, vec_rank, fts_rank} - PARSE
deep-researchreturnssub_queries[],results[],evidence_chains[],graph_context,stats - NEVER confuse
distancewithcombined_scorein ranking - NEVER increase
--hopswithout inspectinggraph statsfirst
Exit Codes and Retry Strategy
- EXIT 0: success; EXIT 1: validation error; EXIT 2: argument parsing; EXIT 3: optimistic lock conflict (reload and retry)
- EXIT 4: not found; EXIT 5: namespace error; EXIT 6: payload too large; EXIT 9: duplicate (use
--force-merge) - EXIT 10: database error (run
vacuum+health); EXIT 11: embedding failure (check backend + OAuth) - EXIT 13: partial batch failure (reprocess failed only); EXIT 14: I/O error; EXIT 15: database busy (widen
--wait-lock) - EXIT 16: preflight failure (fix MCP config, NEVER treat as transient)
- EXIT 19: SHUTDOWN (RETRY MANDATORY, partial work discarded); PARSE envelope
{error, code, signal, graceful, message} - EXIT 20: internal error; EXIT 75: slots exhausted or job singleton locked (respect cooldown, NEVER retry immediately)
- EXIT 77: RAM pressure (wait for free memory)
- NEVER ignore non-zero exit; NEVER reprocess full batch after exit 13; NEVER confuse exit 1 with exit 9
Concurrency and Parallelism
- RESPECT hard ceiling
2 x nCPUsfor heavy commands:init,remember,ingest,recall,hybrid-search - SET
--llm-parallelism Ndefault 4 onremember/edit, default 2 oningest(clamp [1, 32]) - USE
--llm-max-host-concurrency Nto cap cross-process LLM subprocesses - USE
--llm-slot-wait-secs Nto wait for slot or--llm-slot-no-waitto abort - KNOW JOB SINGLETON:
enrich,ingest --mode claude-code|codex|opencodeacquire per-namespace singleton - USE
--wait-job-singleton SECSor--force-job-singletonto break stale lock - ENABLE
SQLITE_GRAPHRAG_LOW_MEMORY=1for unitary parallelism (3-4x slower) - NEVER run
enrichin parallel against same database
Maintenance and Diagnostic Subcommands
- RUN
sqlite-graphrag init --namespace <ns>on first use - RUN
health --jsonto verifyintegrity_ok,schema_ok,schema_version >= 15 - RUN
migrate --dry-run --jsonto preview; thenmigrate --jsonafter binary upgrade - RUN
optimize --jsonto refresh planner stats; includesfts_rebuilt - RUN
fts rebuild --jsonwhenhealth.fts_degradedis true;fts check --jsonfor integrity;fts stats --jsonfor row counts - INVOKE
backup --output <path> --jsonfor online backup;sync-safe-copy --dest <path>for atomic snapshot - INVOKE
export --namespace <ns> --type <kind> --jsonto export as NDJSON - INVOKE
vacuum --jsonafter large purge; INSPECTwal_size_mbin health for fragmentation - INVOKE
vec orphan-list --jsonthenvec purge-orphan --yesto clean orphaned vectors;vec stats --jsonfor health - INVOKE
debug-schema --jsonfor schema drift troubleshooting - INVOKE
completions <bash|zsh|fish|elvish|powershell>for shell completions - INVOKE
codex-models --jsonto inspect codex model whitelist - INVOKE
stats --jsonto show database statistics (counts, sizes, namespace breakdown) - INVOKE
namespace-detect --jsonto resolve namespace precedence for current invocation - INVOKE
cache list --jsonto list cached model files;cache clear-models --yesto force re-download - INVOKE
pending list --filter-status queued --jsonto inspect three-stage checkpoint queue;pending show <id>for detail;pending cleanup --yesfor terminal rows - INVOKE
pending-embeddings list --jsonto inspect failed embedding retry queue;pending-embeddings process --jsonto reprocess with next backend - INVOKE
slots status --jsonto inspect host-wide semaphore;slots release --slot-id <N> --yesto reap orphan slots - INVOKE
embedding status --jsonfor aggregate counts by status;embedding list --jsonfor per-entry inspection - SCHEDULE weekly:
purgethencleanup-orphansthenprune-relations --relation mentionsthenvacuumthenoptimizethensync-safe-copy - KNOW every write runs
PRAGMA wal_checkpoint(TRUNCATE)after commit - IF corruption:
sqlite3 broken.sqlite ".recover" | sqlite3 repaired.sqlite
Environment Variables Reference
SQLITE_GRAPHRAG_DB_PATH— persistent database path overrideSQLITE_GRAPHRAG_NAMESPACE— persistent namespaceSQLITE_GRAPHRAG_LLM_BACKEND— persistent backend (codex|claude|opencode|none|auto)SQLITE_GRAPHRAG_LLM_MODEL— persistent model overrideSQLITE_GRAPHRAG_CODEX_BINARY/SQLITE_GRAPHRAG_CODEX_EMBED_MODEL— codex binary and embed modelSQLITE_GRAPHRAG_CLAUDE_BINARY— claude binary path overrideSQLITE_GRAPHRAG_OPENCODE_BINARY/SQLITE_GRAPHRAG_OPENCODE_MODEL/SQLITE_GRAPHRAG_OPENCODE_EMBED_MODEL/SQLITE_GRAPHRAG_OPENCODE_TIMEOUT— opencode overridesSQLITE_GRAPHRAG_EMBEDDING_DIM— embedding dimension [8, 4096] (default 64 MRL)SQLITE_GRAPHRAG_LOW_MEMORY— enable unitary parallelismSQLITE_GRAPHRAG_STRICT_ENV_CLEAR— compliance modeSQLITE_GRAPHRAG_DISPLAY_TZ— persistent timezoneSQLITE_GRAPHRAG_LOG_FORMAT—jsonfor log aggregatorsSQLITE_GRAPHRAG_SKIP_PREFLIGHT— bypass preflight (EMERGENCIES ONLY)SQLITE_GRAPHRAG_IGNORE_SHUTDOWN— CI test harnesses ONLY
Ready-to-Use CLI Formulas
- INIT namespace:
sqlite-graphrag init --namespace <ns> - VERIFY health:
sqlite-graphrag health --namespace <ns> --json | jaq '{integrity_ok, schema_version}' - MIGRATE preview:
sqlite-graphrag migrate --dry-run --json - MIGRATE apply:
sqlite-graphrag migrate --json - REMEMBER codex all flags:
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini --codex-binary <path> --llm-parallelism 4 remember --name <n> --type decision --description "desc" --body-file doc.md --force-merge --max-rss-mb 4096 --json - REMEMBER claude all flags:
sqlite-graphrag --llm-backend claude --llm-model claude-sonnet-4-6 --claude-binary <path> --llm-parallelism 4 remember --name <n> --type decision --description "desc" --body "content" --force-merge --json - REMEMBER opencode all flags:
sqlite-graphrag --llm-backend opencode --llm-model opencode/big-pickle --opencode-binary <path> --opencode-timeout 300 --llm-parallelism 4 remember --name <n> --type note --description "desc" --body-stdin --json - REMEMBER graph-stdin:
echo '{"body":"text","entities":[{"name":"jwt","entity_type":"concept"}],"relationships":[{"source":"jwt","target":"auth-svc","relation":"uses","strength":0.8}]}' | sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini remember --name <n> --type decision --description "desc" --graph-stdin --force-merge --json - REMEMBER-BATCH: pipe NDJSON to
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini remember-batch --json - FULL FALLBACK CHAIN:
sqlite-graphrag --llm-backend codex,claude,opencode,none --skip-embedding-on-failure remember --name <n> --type note --description "desc" --body-file note.md --json - DRY-RUN backend:
sqlite-graphrag --llm-backend codex --dry-run-backend recall "query" --k 5 --json - RECALL codex:
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini recall "query" --k 5 --no-graph --json - RECALL claude:
sqlite-graphrag --llm-backend claude --llm-model claude-sonnet-4-6 recall "query" --k 5 --json - RECALL opencode:
sqlite-graphrag --llm-backend opencode --llm-model opencode/big-pickle recall "query" --k 5 --json - HYBRID-SEARCH codex all flags:
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini hybrid-search "query" --k 10 --with-graph --max-hops 2 --min-weight 0.3 --rrf-k 60 --weight-vec 1.0 --weight-fts 1.0 --type decision --json - HYBRID-SEARCH claude:
sqlite-graphrag --llm-backend claude --llm-model claude-sonnet-4-6 hybrid-search "query" --k 10 --json - HYBRID-SEARCH opencode:
sqlite-graphrag --llm-backend opencode --llm-model opencode/big-pickle hybrid-search "query" --k 10 --with-graph --json - HYBRID-SEARCH fts-only:
sqlite-graphrag hybrid-search "query" --k 10 --fallback-fts-only --json - DEEP-RESEARCH all flags:
sqlite-graphrag --llm-backend claude --llm-model claude-sonnet-4-6 deep-research "question" --k 20 --max-hops 3 --max-sub-queries 7 --max-results 50 --with-bodies --graph-decay 0.7 --graph-min-score 0.05 --timeout 30 --max-neighbors-per-hop 10 --json - RELATED:
sqlite-graphrag related <name> --hops 2 --relation uses --json - INGEST codex all flags:
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini ingest ./docs --mode codex --recursive --pattern "*.md" --type document --auto-describe --resume --max-files 1000 --max-name-length 80 --llm-parallelism 2 --codex-model gpt-5.4-mini --codex-timeout 300 --fail-fast --low-memory --json - INGEST claude all flags:
sqlite-graphrag --llm-backend claude --llm-model claude-sonnet-4-6 ingest ./docs --mode claude-code --recursive --pattern "*.md" --type document --auto-describe --resume --claude-model claude-sonnet-4-6 --claude-timeout 600 --rate-limit-wait 60 --max-cost-usd 5 --queue-db .ingest-queue.sqlite --keep-queue --json - INGEST opencode all flags:
sqlite-graphrag --llm-backend opencode --llm-model opencode/big-pickle ingest ./docs --mode opencode --recursive --pattern "*.md" --type document --auto-describe --opencode-model opencode/big-pickle --opencode-timeout 600 --json - INGEST dry-run:
sqlite-graphrag ingest ./docs --dry-run --pattern "*.md" --recursive --json - ENRICH re-embed codex:
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini enrich --operation re-embed --limit 100 --resume --llm-parallelism 4 --json - ENRICH memory-bindings claude:
sqlite-graphrag --llm-backend claude --llm-model claude-sonnet-4-6 enrich --operation memory-bindings --mode claude-code --max-cost-usd 5 --json - ENRICH opencode:
sqlite-graphrag --llm-backend opencode --llm-model opencode/big-pickle enrich --operation entity-descriptions --mode opencode --dry-run --json - READ with graph:
sqlite-graphrag read --name <n> --with-graph --json - READ by id:
sqlite-graphrag read --id 42 --json - LIST:
sqlite-graphrag list --type decision --limit 50 --offset 0 --include-deleted --json - HISTORY:
sqlite-graphrag history --name <n> --diff --json - EDIT body codex:
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini edit --name <n> --body-file new.md --expected-updated-at "2026-01-01T00:00:00Z" --json - EDIT description only:
sqlite-graphrag edit --name <n> --description "new desc" --json - EDIT force-reembed:
sqlite-graphrag --llm-backend codex --llm-model gpt-5.4-mini edit --name <n> --force-reembed --json - RENAME:
sqlite-graphrag rename --from <old> --to <new> --json - RESTORE:
sqlite-graphrag restore --name <n> --version 2 --json - FORGET:
sqlite-graphrag forget --name <n> --json - PURGE preview:
sqlite-graphrag purge --retention-days 30 --yes --dry-run --json - LINK all flags:
sqlite-graphrag link --from <a> --to <b> --relation uses --weight 0.8 --create-missing --entity-type tool --strict-relations --max-entity-degree 50 --json - UNLINK:
sqlite-graphrag unlink --from <a> --to <b> --relation uses --json - UNLINK bulk:
sqlite-graphrag unlink --entity <name> --all --json - GRAPH stats:
sqlite-graphrag graph stats --json | jaq '{node_count, edge_count, avg_degree}' - GRAPH entities:
sqlite-graphrag graph entities --sort-by degree --order desc --limit 20 --json - GRAPH traverse:
sqlite-graphrag graph traverse --from <entity> --depth 2 --json - GRAPH export:
sqlite-graphrag graph --format <json|dot|mermaid> --output <path> - MERGE entities:
sqlite-graphrag merge-entities --names "a,b,c" --into target --json - NORMALIZE entities:
sqlite-graphrag normalize-entities --yes --json - RECLASSIFY entity:
sqlite-graphrag reclassify --name <n> --new-type concept --json - RECLASSIFY batch:
sqlite-graphrag reclassify --from-type tool --to-type concept --batch --json - RECLASSIFY-RELATION:
sqlite-graphrag reclassify-relation --from-relation <old> --to-relation <new> --batch --json - PRUNE-NER:
sqlite-graphrag prune-ner --entity <n>orprune-ner --all --yes - PRUNE-RELATIONS preview:
sqlite-graphrag prune-relations --relation mentions --yes --show-entities --dry-run - CLEANUP pipeline: INVOKE
forget --name <n>thencleanup-orphans --yes --jsonthenvacuum --json - PENDING list:
sqlite-graphrag pending list --filter-status queued --json - PENDING-EMBEDDINGS:
sqlite-graphrag pending-embeddings list --jsonthenpending-embeddings process --json - SLOTS:
sqlite-graphrag slots status --jsonandslots release --slot-id <N> --yes --json - EMBEDDING status:
sqlite-graphrag embedding status --jsonandembedding list --json - FTS:
sqlite-graphrag fts rebuild --jsonandfts check --jsonandfts stats --json - VEC:
sqlite-graphrag vec stats --jsonandvec orphan-list --jsonthenvec purge-orphan --yes --json - BACKUP:
sqlite-graphrag backup --output backup.sqlite --json - SYNC-SAFE-COPY:
sqlite-graphrag sync-safe-copy --dest snapshot.sqlite - EXPORT:
sqlite-graphrag export --namespace <ns> --type decision --json - OPTIMIZE:
sqlite-graphrag optimize --json - VACUUM:
sqlite-graphrag vacuum --json - DEBUG-SCHEMA:
sqlite-graphrag debug-schema --json - CODEX-MODELS:
sqlite-graphrag codex-models --json - COMPLETIONS:
sqlite-graphrag completions <bash|zsh|fish|elvish|powershell> - STATS:
sqlite-graphrag stats --json - NAMESPACE-DETECT:
sqlite-graphrag namespace-detect --json - CACHE list:
sqlite-graphrag cache list --json - CACHE clear:
sqlite-graphrag cache clear-models --yes - FALLBACK CHAIN:
sqlite-graphrag --llm-backend codex --llm-fallback codex,claude,opencode,none --skip-embedding-on-failure remember --name <n> --type note --description "desc" --body-file note.md --json
Active Rules
- ALWAYS pass
--llm-backendand--llm-modelexplicitly for embedding commands - ALWAYS parse
backend_invokedto confirm which backend ran - ALWAYS run
codex loginor refresh claude OAuth when backend reports stale OAuth - NEVER pass API keys (OAuth-only, exit 1); NEVER use daemon,
--bare,--gliner-variant(REMOVED) - NEVER install with
--features embedding-legacyor--features ner-legacy - NEVER run
enrichin parallel against same database; NEVER write.sqliteoutside the binary - NEVER ignore exit 19 (RETRY MANDATORY) or exit 16 (fix MCP config)
- NEVER call
migrate --to-llm-onlywithout--drop-vec-tablesguard