feat(engine): add demo command and align showcase assets#39
feat(engine): add demo command and align showcase assets#39
Conversation
Add interactive `kindx demo` command to engine/kindx.ts that walks users through BM25 search, vector search, hybrid query, and MCP integration with real eval-docs when available and graceful simulated fallback. Create 52 demo files across 10 categories: - Benchmarks: eval report, latency analysis, JSON results, runner script - Recipes: Claude Desktop, Cursor, Continue.dev, LangChain, AutoGPT - CLI demos: basic workflow, output formats, MCP server, multi-collection - Expected output: reference outputs for all CLI demos - Stress tests: large corpus, idempotency, edge cases, corruption recovery - Video scripts: 30s wow, 5min deep-dive, VHS tape file, recording setup - Screenshots: index + 10 detailed scene descriptions - README additions: tagline, benchmarks table, integration links - Sample data: TypeScript codebase (4 src + 3 docs) and notes corpus (5 files) - CI validation: GitHub Actions workflow for scripts, JSON, markdown, structure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the demonstrability and evaluability of KINDX by introducing a new interactive demo command and a rich set of supporting content. The changes aim to provide users with a quick and comprehensive way to understand KINDX's capabilities, integrate it into various AI workflows, and assess its performance characteristics, ultimately lowering the barrier to adoption and integration. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
Adds a new kindx demo CLI subcommand plus a large demo/ showcase intended to support interactive walkthroughs, scripted demos, benchmark reporting, and CI validation of demo artifacts.
Changes:
- Added
democommand dispatch and arunDemo()walkthrough inengine/kindx.ts. - Added demo scripts, expected outputs, video/screenshot scripts, and sample data under
demo/. - Added a GitHub Actions workflow (
demo/ci/demo-validation.yml) to validate demo content structure and basic syntax.
Reviewed changes
Copilot reviewed 53 out of 53 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| engine/kindx.ts | Adds kindx demo command implementation and command dispatch entry. |
| demo/ci/demo-validation.yml | CI checks for demo shell script syntax, structure, and JSON validation. |
| demo/cli-demos/.sh + expected-output/ | CLI demo scripts and “golden” outputs for recordings/docs. |
| demo/benchmarks/* | Benchmark reports and a runner script intended to generate eval JSON. |
| demo/video-scripts/* | Terminal/video recording guides and a VHS tape script. |
| demo/screenshots/* | Screenshot index and per-screenshot expected output descriptions. |
| demo/README-additions.md | Proposed README content additions (tagline, benchmarks, integrations). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
demo/benchmarks/run-eval.sh
Outdated
| local search_flags="" | ||
|
|
||
| case "${mode}" in | ||
| bm25) search_flags="--mode bm25" ;; | ||
| vector) search_flags="--mode vector" ;; | ||
| hybrid) search_flags="--mode hybrid" ;; | ||
| hybrid_rerank) search_flags="--mode hybrid --rerank" ;; | ||
| esac | ||
|
|
||
| ${KINDX_BIN} search ${search_flags} --top 5 --json \ | ||
| "${COLLECTION_DIR}" "${query}" 2>/dev/null |
| ```bash | ||
| $ kindx search my-docs "API design" --json | ||
| ``` | ||
|
|
||
| ## Expected Terminal Output | ||
|
|
||
| ```json | ||
| $ kindx search my-docs "API design" --json | ||
| { | ||
| "query": "API design", | ||
| "mode": "bm25", | ||
| "collection": "my-docs", | ||
| "results": [ | ||
| { | ||
| "rank": 1, | ||
| "uri": "kindx://my-docs/api-reference.md", |
| ```bash | ||
| $ kindx vsearch my-docs "prevent overfitting in ML models" | ||
| ``` |
| ```bash | ||
| $ kindx query my-docs "startup fundraising strategy" --explain | ||
| ``` |
demo/cli-demos/mcp-demo.sh
Outdated
| MCP_PORT=3100 | ||
| MCP_BASE="http://localhost:${MCP_PORT}" | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Step 1: Start the MCP server | ||
| # --------------------------------------------------------------------------- | ||
| # The --http flag starts an HTTP transport (rather than stdio). The --daemon | ||
| # flag backgrounds the process so the script can continue. | ||
|
|
||
| echo "=== Step 1: Start MCP server ===" | ||
| echo "Starting KINDX MCP server on port ${MCP_PORT}..." | ||
| echo "" | ||
|
|
||
| kindx mcp --http --daemon | ||
|
|
||
| echo "" | ||
| echo "Server is running in the background." | ||
| echo "" | ||
|
|
||
| # Give the server a moment to initialize. | ||
| sleep 2 | ||
|
|
| # --- Scene 4: Show Claude Desktop config --- | ||
| Type "echo '{\"mcpServers\":{\"kindx\":{\"command\":\"kindx\",\"args\":[\"serve\"]}}}'" | ||
| Sleep 500ms | ||
| Enter | ||
| Sleep 3s |
demo/cli-demos/multi-collection.sh
Outdated
| kindx update --all | ||
| echo "" | ||
|
|
||
| echo "Embedding all collections..." | ||
| kindx embed --all |
engine/kindx.ts
Outdated
| const db = getDb(); | ||
| // Check if the eval docs are already indexed in any collection | ||
| const results = searchFTS(db, bm25Query, 5); | ||
| closeDb(); |
engine/kindx.ts
Outdated
| console.log(`${c.bold}${c.cyan}║ 1. kindx collection add my-docs ~/Documents ║${c.reset}`); | ||
| console.log(`${c.bold}${c.cyan}║ 2. kindx embed ║${c.reset}`); | ||
| console.log(`${c.bold}${c.cyan}║ 3. kindx query "your question here" ║${c.reset}`); | ||
| console.log(`${c.bold}${c.cyan}║ ║${c.reset}`); | ||
| console.log(`${c.bold}${c.cyan}║ Docs: https://github.com/ambicuity/KINDX ║${c.reset}`); | ||
| console.log(`${c.bold}${c.cyan}╚══════════════════════════════════════════════════════════════╝${c.reset}\n`); |
| - name: Check eval-results.json with jq | ||
| run: | | ||
| if [ -f demo/benchmarks/eval-results.json ]; then | ||
| echo "Validating demo/benchmarks/eval-results.json" | ||
| jq empty demo/benchmarks/eval-results.json | ||
| echo "JSON is valid." | ||
| else | ||
| echo "demo/benchmarks/eval-results.json not found — skipping." | ||
| fi | ||
|
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive kindx demo command and a large suite of associated demo materials, including sample data, recipes, benchmarks, and CI validation. The changes are well-structured and provide a great showcase for the project's capabilities.
My review focuses on the new demo command implementation and the accompanying scripts. I've identified a couple of areas for improvement to enhance robustness and error handling. Specifically, I've suggested replacing a fixed sleep with a polling mechanism in a demo script to avoid flakiness, and improving error logging in the new runDemo function to provide better diagnostics when the live demo part fails.
Overall, this is a substantial and valuable addition to the project.
engine/kindx.ts
Outdated
| } catch { | ||
| showSimulatedBM25Results(); | ||
| } |
There was a problem hiding this comment.
This catch block currently swallows any errors from the real search attempt silently. While falling back to simulated results is the correct behavior for a demo, logging the actual error to stderr would be beneficial for debugging purposes without interrupting the demo flow.
} catch (e) {
console.error(`${c.yellow}Demo search failed, falling back to simulated results. Error: ${e instanceof Error ? e.message : String(e)}${c.reset}`);
showSimulatedBM25Results();
}
demo/cli-demos/mcp-demo.sh
Outdated
| # Give the server a moment to initialize. | ||
| sleep 2 |
There was a problem hiding this comment.
Using a fixed sleep to wait for the server to initialize can be unreliable and lead to flaky script execution, as the server's startup time may vary. A more robust approach is to poll the server's status until it becomes responsive.
| # Give the server a moment to initialize. | |
| sleep 2 | |
| # Wait for the server to be ready | |
| echo " Waiting for MCP server to start..." | |
| for _ in $(seq 1 10); do | |
| if kindx mcp status &>/dev/null; then | |
| echo " Server is up." | |
| break | |
| fi | |
| sleep 0.5 | |
| done | |
| if ! kindx mcp status &>/dev/null; then | |
| echo " Error: MCP server did not start within 5 seconds." | |
| exit 1 | |
| fi |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a complete evaluation harness under demo/comparisons/ that benchmarks KINDX against 8 competitors (ChromaDB, LanceDB, Orama, Khoj, AnythingLLM, PrivateGPT, LocalGPT, GPT4All) on retrieval quality, setup friction, and agent integration. Includes: - 18 shared test queries across 3 difficulty levels - Per-competitor test scripts (bash/python/typescript) that are runnable - run-all.sh orchestrator with prerequisite checks - Analysis scripts for comparison tables and Markdown reports - competitor-comparison.md with sourced claims and honest weaknesses - mcp-comparison.md deep dive on MCP/agent integration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Feature matrix: KINDX reranking = Yes (Qwen3 cross-encoder) - Retrieval table: KINDX reranking = Yes (Qwen3-Reranker-0.6B) with RRF fusion - Key insight: credit both KINDX and LanceDB for reranking+hybrid - Weaknesses: replace incorrect 'No Reranking' with 'Markdown-Only File Types' - Renumber weakness sections after consolidation
ambicuity
left a comment
There was a problem hiding this comment.
Validated the AI review findings against the current head and local smoke tests.\n\nKept and fixed the relevant issues:\n- Copilot's stale CLI/demo syntax and wrong repo/config examples\n- Gemini's MCP readiness concern, implemented with real HTTP health polling instead of a nonexistent status subcommand\n- Manual blockers from local testing: removed the committed .mcp.json token-bearing file and unrelated Claude scaffolding, fixed kindx update -c option handling, aligned the MCP/demo assets with the real query/get/multi_get/status surface, and rewrote the benchmark harness to use public CLI commands on real eval data\n- Repaired the linked-issue workflow permissions and used the intended no-issue bypass for this PR, since there is no associated issue to link\n\nNot kept as merge blockers:\n- Gemini's old runDemo swallow-error note is outdated after the walkthrough cleanup\n- Advanced Security's sample-code rate-limit comments remain non-runtime demo content and were not treated as blockers for merge readiness\n\nLocal verification completed with an isolated KINDX home: build, demo shell syntax, JSON validation, kindx demo, collection add/update, BM25 JSON search, CPU-only embed, vector search, hybrid query, MCP HTTP initialize + tools/call, and a one-query smoke run of the rewritten benchmark harness.\n\nThe token removed from .mcp.json should still be rotated or revoked outside Git if it has not been already.
Summary
Add an interactive
kindx democommand and a comprehensive demo showcase with 52 files across 10 categories, providing everything needed to demonstrate, evaluate, and integrate KINDX.New CLI Command
kindx demo— One-command interactive walkthrough that demonstrates BM25 search (real results when eval-docs are available), vector search, hybrid query, output formats, and MCP configuration. Added to the command dispatch inengine/kindx.ts.Demo Content (52 files)
Key Details
bash -nsyntax validationjq/python3 -m json.toolvalidationTest plan
kindx demoto verify interactive walkthrough completes without errorsbash -n demo/cli-demos/*.sh demo/stress-tests/*.sh demo/benchmarks/run-eval.shto validate all shell scriptsjq empty demo/benchmarks/eval-results.jsonto validate JSONfind demo -type f | wc -ldemo/ci/demo-validation.ymlworkflow passes on this branchdemo/cli-demos/basic-workflow.shend-to-end with a local KINDX install🤖 Generated with Claude Code