Skip to main content
The command-line binary, built from the cognee-cli crate. It drives the full pipeline and is also the on-device (Android) runner. Run cognee-cli <command> --help for the authoritative flag list; the clap definitions are in crates/cli/src/cli.rs.

Subcommands

The memory API verbs (remember / recall / improve / forget) are the primary surface; the add / cognify / memify / search commands below them are the lower-level pipeline they compose. All of these are always built (not feature-gated). The feature-gated commands are enabled in the default build of cognee-cli (except platform-specific ones). See Architecture: feature strategy. Cloud serve / disconnect are not part of OSS.

Memory API

The four primary verbs cover the common workflow end-to-end:
remember with a --session-id records session memory; without one it persists permanent, graph-backed memory. recall is session-aware and graph-backed; with no -t/--query-type it auto-routes to a suitable retrieval strategy.

Lower-level pipeline

The memory verbs compose add → cognify → search, which you can also drive directly for fine-grained control (remember ≈ add + cognify + improve; recall ≈ auto-routed search):
A cognify run that the configured failure policy let complete despite per-document failures prints one extra WARN line per dataset (cognify completed with failures — …), naming the counts and the first ten failed data ids (… (first 10 of N) beyond that), and saying whether a re-run would pick the outstanding documents up. A clean run prints nothing extra. The same numbers — with the untruncated id list — are persisted under pipeline_runs.run_info.cognify_failures. Which failures are tolerated at all is the failure policy in Configuration: cognify failure handling; the default errors the run instead. -t/--query-type on search / recall accepts GRAPH_COMPLETION, RAG_COMPLETION, CHUNKS, SUMMARIES, CODE, CYPHER and TEMPORAL (the QueryTypeArg enum in crates/cli/src/cli.rs; see also cognee-cli search --help). The library’s SearchType enum is larger (16 types, including HYBRID_COMPLETION — see Operations: search), but the other types are not exposed as CLI values yet. The hybrid retriever’s tuning knobs are not exposed as CLI flags either — see Configuration: hybrid retriever knobs.

config subcommand

Reads/writes ~/.config/cognee-rust/config.json. Keys are the snake_case Settings field names plus the keys of the component config sections compiled into this build. set and get take the canonical key (such as llm.model) or its Python flat alias (such as llm_model); cognee-cli config list prints the canonical keys only. See Configuration: CLI config.

LLM retries

--llm-max-retries N (accepted by cognify, add-and-cognify, search) overrides the retry count for that run; the persistent default is the llm_max_retries config key (default 3). The CLI flag wins over the config value, which in turn is set by LLM_MAX_RETRIES. It governs the structured-output retry loop only — the strict-schema, function-call and JSON-fallback parsing paths — and counts attempts, not re-asks: 3 is three attempts, so at most two corrective re-asks. The transport retry loop underneath it is a separate knob, LLM_NETWORK_RETRIES (config key llm_network_retries, default 2), which has no CLI flag. They used to share one value, which multiplied the two ladders into each other. 0 is accepted for consistency with the env var; every adapter floors the structured count at 1, so it means “one attempt, no re-ask”. To shorten a transport ladder that would otherwise keep waiting out its time floor, set LLM_MIN_RETRY_SECONDS=0. A run-sequence step may carry the flag; it applies to that step, and steps without it fall back to the configured value.

Logging

The CLI calls cognee_logging::init_logging at startup. Console logs go to stderr instead of stdout whenever stdout is machine-readable — -f json / -f simple on search / recall, and always for export, visualize and bench — so that output stays parseable (a -f json step inside run-sequence is not detected and keeps stdout). The env-var surface (COGNEE_LOG_*, RUST_LOG/LOG_LEVEL, LOG_FILE_NAME) is shared with the HTTP server and bindings and documented canonically in Configuration: logging. Example — JSON logs to a custom directory: