feat(cli): Add cognee-cli demo with bundled zero-key graph - #4845
Open
Vasilije1990 wants to merge 1 commit into
Open
feat(cli): Add cognee-cli demo with bundled zero-key graph#4845Vasilije1990 wants to merge 1 commit into
Vasilije1990 wants to merge 1 commit into
Conversation
First-session drop-off research shows the most common failure is a first search that returns nothing (or an API-key error) before the user has seen cognee work at all. Give them proof of life first: cognee-cli demo loads a pre-built knowledge graph and answers a search in ~5 seconds with no LLM key, no embedding provider, and no network access. The graph ships as a COGX archive built once by a maintainer (tools/build_demo_archive.py cognifies the quickstart sample, exports it, and trims document records so the import never triggers add()'s LLM connection check). The demo restores it graph-only via the new remember(source, index_vectors=False) path — threaded through the migration loader as add_data_points(graph_only=True) plus skip_connection_test — and queries it with CHUNKS_LEXICAL, the BM25 retriever that reads chunks from the graph store and needs neither an LLM nor embeddings. CHUNKS_LEXICAL is also added to the CLI's search type choices, where it was previously unreachable. The command sets expectations explicitly: it names the search as keyword-based, points at LLM_API_KEY for full answers over the user's own data, and prints copy-pastable next steps and cleanup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
First-session research shows the most common organic failure: the first search returns nothing (or an API-key error) before the user has ever seen cognee work. This PR ships proof of life:
cognee-cli demoloads a pre-built knowledge graph and answers a search in ~5 seconds with no LLM key, no embedding provider, and no network access.How it works
cognee/cli/samples/demo_graph/, ~48 KB, ships in the wheel): built once by a maintainer viatools/build_demo_archive.py, which cognifies the existing quickstart sample in a scratch store, exports it withcognee.export(format="cogx"), and trimsdocuments.jsonl— document records would route throughadd(), whose pipeline requires a working LLM connection. Chunk text survives as raw nodes (the exporter writes everyDocumentChunkas one), which is exactly what lexical retrieval reads.remember(source, index_vectors=False)— reusing the kwarg the code route already declares — threads through the migration loader asadd_data_points(graph_only=True)and setsskip_connection_teston the import pipeline. No vector engine is initialized, so no key is demanded. Works for both import shapes (streaming and buffered).CHUNKS_LEXICAL(BM25 over graph-stored chunks — no LLM, no embeddings, no network). Also fixes a standalone gap:CHUNKS_LEXICALwas missing from the CLI'sSEARCH_TYPE_CHOICES, making it unreachable fromcognee-cli search/recallentirely.LLM_API_KEY, and prints copy-pastable next steps plus cleanup (forget --dataset demo). In--api-urlmode the dispatcher's existing "run locally" error coversdemo.Test plan
DocumentChunkraw nodes);graph_onlythreading throughstream_graph_from_source,store_imported_graph, and theremember(index_vectors=...)mapping; demo-command behavior (graph-only import asserted, every search pinned toCHUNKS_LEXICAL, custom query/dataset flags, error wrapping).cognee/tests/unit/migration/+cognee/tests/cli_tests/cli_unit_tests/suites: 309 passed locally.LLM_API_KEY/OPENAI_API_KEY/EMBEDDING_API_KEY/ANTHROPIC_API_KEYall stripped from the environment in a scratch store: import + two searches complete in ~4.5 s with real chunk text returned.pre-commit(ruff check + format) clean.🤖 Generated with Claude Code