Skip to content

docs(architecture): sync mermaid diagrams with v4.8.2 fast-path + v4.8.3 staging dispatcher - #170

Merged
lyonzin merged 1 commit into
masterfrom
docs/architecture-sync-v483
Aug 11, 2026
Merged

docs(architecture): sync mermaid diagrams with v4.8.2 fast-path + v4.8.3 staging dispatcher#170
lyonzin merged 1 commit into
masterfrom
docs/architecture-sync-v483

Conversation

@lyonzin

@lyonzin lyonzin commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

Syncs the 4 Mermaid diagrams in ## Architecture (System Overview, Query Processing Flow, Document Ingestion Flow, hybrid_alpha Parameter Effect) with what the code actually does in v4.8.2 (FTS5 Lexical Fast-Path) and v4.8.3 (_write_collection staging dispatcher, #161). The previous diagrams still described the pre-v4.8 hybrid-only pipeline and a 4-category storage layout, so any user reading the README would miss the FTS5 fast-path, the search_method dispatch, the FTS5 storage box, the FTS5 CRUD sync in ingestion, and the zero-downtime staging write path.

Docs-only. No code change, no test change, no version bump.

What changed

  • System Overview: adds SEARCH DISPATCH subgraph (search_method: auto | hybrid | fts5, ADR-006), QueryRouter lexical detection (ADR-002), FTS5 fast-path branch with fallback edge to the hybrid pipeline, SQLite FTS5 storage box (data/fts5_index.db, ADR-001), the FTS5 CRUD sync step in ingestion, the full 8 categories (redteam | blueteam | ctf | security | logscale | development | aar | general — was showing only 4), and marks the 13 MCP tools as frozen (LEI 1) with the actual names.
  • Query Processing Flow: new DISPATCH block at the top of the flow — search_method decision, QueryRouter.classify() auto-routing, FTS5 fast-path with ready AND hits >= min_hits gate, and the fallback edge back to expansion + hybrid path. Result envelope updated to show search_method: fts5 and routed_by: fts5_router.
  • Document Ingestion Flow: expanded input tree to the 8-category layout, added Write Dispatch subgraph (v4.8.3 #161) showing _write_collection routing writes to staging during nuclear_rebuild and to production otherwise, and added SQLite FTS5 as a third store sink (ADR-008 CRUD sync).
  • hybrid_alpha Parameter Effect: added explanatory paragraph that hybrid_alpha only affects the hybrid path — the FTS5 fast-path uses SQLite bm25() natively and ignores the weight. Subgraph title clarified, 0.0 (Pure BM25) label points readers to the fast-path as an alternative for exact identifier queries.

LEI 1 preserved

Docs-only. Zero change to the 13 frozen MCP tools, zero change to API surface, zero change to test count.

Test plan

  • All 4 Mermaid blocks still render (verified 4 flowchart opens in file)
  • CHANGELOG entry in ### Unreleased
  • No version bump (docs-only)
  • 7 pillar Quality Gate green (skip-test-count + skip-changelog labels not needed — CHANGELOG entry included, no test change)

Summary by CodeRabbit

  • Documentation
    • Updated architecture documentation for FTS5 lexical search, query routing, fallback behavior, and CRUD synchronization.
    • Clarified search result fields, category support, scoring behavior, and hybrid_alpha usage.
    • Documented staging and production write routing for zero-downtime ingestion.
    • Added an Unreleased changelog entry summarizing these updates.

Greptile Summary

The PR updates the README architecture documentation for FTS5 query dispatch, staging-aware ingestion, the eight-category layout, and hybrid weighting behavior.

  • Adds auto, hybrid, and forced-FTS5 query branches with fallback and result metadata.
  • Documents staging collection routing and the ChromaDB, BM25, and FTS5 stores.
  • Expands the tool and category descriptions and adds an Unreleased changelog entry.

Confidence Score: 4/5

The documentation-only PR is safe to merge, but two architecture paths should be corrected to avoid misleading users about forced FTS5 errors and rebuild-time index consistency.

Runtime behavior is unchanged; the remaining issues are inaccurate diagram branches for explicit FTS5 dispatch and BM25/FTS5 maintenance during rebuilds.

Files Needing Attention: README.md

Important Files Changed

Filename Overview
README.md Updates four architecture diagrams and the changelog; the forced-FTS5 fallback semantics and rebuild-time secondary-index flows remain inaccurately represented.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Q[Query] --> D{search_method}
    D -->|auto| R[QueryRouter]
    D -->|hybrid| H[Hybrid pipeline]
    D -->|fts5| F[FTS5 fast path]
    R -->|semantic| H
    R -->|lexical| F
    F --> O[Output processing]
    H --> O
    I[Document ingestion] --> W{Write collection}
    W -->|default| P[Production ChromaDB]
    W -->|rebuild| S[Staging ChromaDB]
    P --> B[BM25 / FTS5 maintenance]
    S --> X[Post-swap index rebuild]
Loading

Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
README.md:314-315
**Forced FTS5 fallback is inaccurate**

The diagram sends explicit `search_method="fts5"` requests through the auto-mode fallback gate. When FTS5 is disabled or unready, forced mode returns `Fts5NotReadyError` instead of falling back, and forced searches also bypass `min_hits`, so readers receive behavior different from this documented flow.

### Issue 2
README.md:413-416
**Rebuild index flows are inaccurate**

These edges imply that only production writes update BM25 and that FTS5 is updated directly on every production write. Staging population also builds an isolated BM25 index, while bulk and staging paths rebuild FTS5 from ChromaDB only after the destructive rebuild or collection swap, giving operators the wrong consistency timeline during rebuilds.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "docs(architecture): sync mermaid diagram..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

…ture

The 4 diagrams in ## Architecture (System Overview, Query Processing
Flow, Document Ingestion Flow, hybrid_alpha Parameter Effect) still
described the pre-v4.8 hybrid pipeline and a 4-category storage layout,
missing every architectural change from the FTS5 fast-path release and
the zero-downtime rebuild hotfix. This aligns the docs with what the
code actually does.

System Overview
- Adds a dedicated SEARCH DISPATCH subgraph (search_method: auto |
  hybrid | fts5, ADR-006) with QueryRouter regex-based lexical
  detection (ADR-002) and the FTS5 fast-path branch with fallback
  arrow to the hybrid pipeline.
- Adds SQLite FTS5 storage (data/fts5_index.db, ADR-001) alongside
  ChromaDB.
- Corrects the category list from 4 pre-existing categories to the
  full 8 (redteam | blueteam | ctf | security | logscale |
  development | aar | general).
- Adds the FTS5 CRUD sync box in the ingestion pipeline (task 05).
- Marks the 13 MCP tools as frozen (LEI 1) and lists all 13.

Query Processing Flow
- New DISPATCH subgraph at the top: search_method decision, QueryRouter
  auto classification, FTS5 fast-path with ready-and-min_hits gate,
  and the fallback edge back to the hybrid path.
- Preserves the existing hybrid pipeline (expansion, keyword routing,
  RRF, cross-encoder rerank, adjacent chunk expansion) for the
  semantic branch.
- Result envelope now shows the fts5 search_method value and the
  fts5_router routed_by tag surfaced by the fast-path.

Document Ingestion Flow
- Expands the input tree to the full 8-category layout.
- Adds the Write Dispatch subgraph (v4.8.3 #161) showing
  _write_collection routing writes to staging while nuclear_rebuild
  is populating and to production otherwise.
- Adds the SQLite FTS5 store as a third sink alongside ChromaDB and
  BM25, reflecting the CRUD sync path (ADR-008).

hybrid_alpha Parameter Effect
- Adds an explanatory paragraph that hybrid_alpha only affects the
  hybrid path — the FTS5 fast-path uses SQLite bm25() natively and
  ignores the weight entirely.
- Subgraph title updated accordingly. The 0.0 (Pure BM25) label now
  points readers to the FTS5 fast-path as an alternative for exact
  identifier queries.

Unreleased changelog entry added. No code change, no test change,
no version bump. LEI 1 and Pillar 7 unchanged.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

README.md now documents FTS5 lexical routing, fallback behavior, synchronized ChromaDB and SQLite storage, staging versus production writes, expanded categories, result metadata, and hybrid-only hybrid_alpha semantics.

Changes

Architecture documentation

Layer / File(s) Summary
FTS5 query routing documentation
README.md
The architecture and query-flow diagrams document search_method dispatch, lexical routing, FTS5 fallback, result metadata, expanded categories, and hybrid-only hybrid_alpha weighting.
Ingestion routing and release documentation
README.md
The ingestion diagrams document FTS5 CRUD synchronization, staging and production write routing, and the related Unreleased changelog entry.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: hohlas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the documentation update and its two main architecture changes: the FTS5 fast-path and staging dispatcher.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/architecture-sync-v483

Comment @coderabbitai help to get the list of available commands.

Comment thread README.md
Comment on lines +314 to +315
FASTPATH --> NOTREADY
NOTREADY -->|no, fallback| EXPAND

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Forced FTS5 fallback is inaccurate

The diagram sends explicit search_method="fts5" requests through the auto-mode fallback gate. When FTS5 is disabled or unready, forced mode returns Fts5NotReadyError instead of falling back, and forced searches also bypass min_hits, so readers receive behavior different from this documented flow.

Prompt To Fix With AI
This is a comment left during a code review.
Path: README.md
Line: 314-315

Comment:
**Forced FTS5 fallback is inaccurate**

The diagram sends explicit `search_method="fts5"` requests through the auto-mode fallback gate. When FTS5 is disabled or unready, forced mode returns `Fts5NotReadyError` instead of falling back, and forced searches also bypass `min_hits`, so readers receive behavior different from this documented flow.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

Comment thread README.md
Comment on lines +413 to +416
STAGING --> CHROMADB
PROD --> CHROMADB
PROD --> BM25IDX
PROD --> FTS5DB

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Rebuild index flows are inaccurate

These edges imply that only production writes update BM25 and that FTS5 is updated directly on every production write. Staging population also builds an isolated BM25 index, while bulk and staging paths rebuild FTS5 from ChromaDB only after the destructive rebuild or collection swap, giving operators the wrong consistency timeline during rebuilds.

Prompt To Fix With AI
This is a comment left during a code review.
Path: README.md
Line: 413-416

Comment:
**Rebuild index flows are inaccurate**

These edges imply that only production writes update BM25 and that FTS5 is updated directly on every production write. Staging population also builds an isolated BM25 index, while bulk and staging paths rebuild FTS5 from ChromaDB only after the destructive rebuild or collection swap, giving operators the wrong consistency timeline during rebuilds.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

@lyonzin
lyonzin merged commit 3f91f7b into master Aug 11, 2026
37 of 38 checks passed
@lyonzin
lyonzin deleted the docs/architecture-sync-v483 branch August 11, 2026 00:24

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 236-246: Update the SEARCH DISPATCH diagrams in README.md to show
search.lexical_fast_path.enabled as a prerequisite for the auto route, and label
the not_ready/low_hits fallback to Hybrid as applying only to
search_method="auto". Add the explicit fts5 behavior: raise Fts5NotReadyError
when the index is unavailable and bypass min_hits, while leaving the method
table as “SQLite FTS5 only.”
- Around line 282-284: Update both README diagrams to document the full staging
promotion and index-readiness sequence: nuclear_rebuild(swap=True) writes and
validates staging, atomically promotes it to production, rebuilds BM25, then
resets and asynchronously migrates FTS5. Indicate that readers use production
until promotion and FTS5 queries fall back to hybrid until migration completes.
- Around line 363-364: Update the README search flow and Search Method Values
documentation to distinguish the request selector contract (auto, hybrid, fts5)
from the result-item search_method label contract (fts5, hybrid, semantic,
keyword). Explain that auto resolves to the selected search path, and add fts5
to the Search Method Values list.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a79dc420-5bb4-4223-8244-a818aa2958ef

📥 Commits

Reviewing files that changed from the base of the PR and between 1deea51 and 658e3e1.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md
Comment on lines +236 to +246
subgraph SEARCH["SEARCH DISPATCH (v4.8.2+)"]
direction TB
SM["search_method dispatch<br/>auto | hybrid | fts5"]
QROUTER["QueryRouter (regex)<br/>lexical vs semantic<br/>(ADR-002)"]
FTS5PATH["FTS5 Fast-Path<br/>(exact identifiers <10ms)"]
HYBRIDPATH["Hybrid Pipeline<br/>(conceptual queries)"]

SM --> QROUTER
QROUTER -->|lexical| FTS5PATH
QROUTER -->|semantic| HYBRIDPATH
FTS5PATH -.->|not_ready / low_hits<br/>fallback| HYBRIDPATH

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 6 --glob '!README.md' \
  'search_method|QueryRouter|lexical_fast_path|not_ready|min_hits|fts5' .

Repository: lyonzin/knowledge-rag

Length of output: 50380


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- README dispatch and method sections ---'
sed -n '220,325p' README.md

printf '%s\n' '--- relevant implementation files ---'
rg -l --glob '*.py' \
  'search_method|fts5_enabled|fts5_min_hits|Fts5NotReadyError|fast_path_fallback|QueryRouter' \
  mcp_server tests | sort

printf '%s\n' '--- dispatch symbols and nearby logic ---'
rg -n -C 10 --glob '*.py' \
  'search_method|fts5_enabled|fts5_min_hits|Fts5NotReadyError|fast_path_fallback|QueryRouter' \
  mcp_server tests | head -n 500

Repository: lyonzin/knowledge-rag

Length of output: 39068


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- README method table and FTS5 configuration text ---'
sed -n '286,322p' README.md
rg -n -C 8 --glob 'README.md' \
  'lexical_fast_path|search_method|FTS5|fallback|min_hits|not.ready|not_ready' README.md

printf '%s\n' '--- override contract tests ---'
sed -n '1,260p' tests/test_search_method_override.py
sed -n '145,180p' tests/test_e2e_fts5.py

Repository: lyonzin/knowledge-rag

Length of output: 50379


Correct the FTS5 dispatch diagrams.

Show search.lexical_fast_path.enabled as a prerequisite for the auto route. Restrict not_ready and low_hits fallback to search_method="auto". Explicit search_method="fts5" raises Fts5NotReadyError when the index is unavailable and bypasses min_hits; the method table can remain “SQLite FTS5 only.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 236 - 246, Update the SEARCH DISPATCH diagrams in
README.md to show search.lexical_fast_path.enabled as a prerequisite for the
auto route, and label the not_ready/low_hits fallback to Hybrid as applying only
to search_method="auto". Add the explicit fts5 behavior: raise Fts5NotReadyError
when the index is unavailable and bypass min_hits, while leaving the method
table as “SQLite FTS5 only.”

Comment thread README.md
Comment on lines +282 to 284
FTS5SYNC["FTS5 CRUD sync<br/>(v4.8.2 task 05)"]
PARSERS --> CHUNKER --> FTS5SYNC
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 8 --glob '!README.md' \
  '_write_collection|_staging_target|nuclear_rebuild|fts5|BM25|promotion|swap' .

Repository: lyonzin/knowledge-rag

Length of output: 50378


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- README architecture and ingestion sections ---'
sed -n '260,310p;380,425p' README.md

printf '%s\n' '--- relevant implementation symbols ---'
rg -n -C 12 \
  'def (nuclear_rebuild|index_all|_write_collection|_staging_target|_remove_document_chunks)|_staging_target|staging|swap|nuclear_rebuild|_fts5_reset_and_rebuild|start_migration_background|_fts5_sync_add_from_doc|build_index' \
  mcp_server tests --glob '*.py' | head -n 1200

Repository: lyonzin/knowledge-rag

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- staging and rebuild definitions ---'
rg -n '^    def (_write_collection|_swap|_cleanup_stale_staging_collections|nuclear_rebuild|_initialize_fts5_dispatch|_maybe_start_fts5_migration|_ensure_bm25_index)|nuclear_rebuild\(' mcp_server/server.py

printf '%s\n' '--- staging/write implementation ---'
sed -n '1160,1175p;1770,1885p;4090,4145p' mcp_server/server.py

printf '%s\n' '--- rebuild and FTS5 initialization implementation ---'
sed -n '2420,2670p' mcp_server/server.py

printf '%s\n' '--- all README references to staging/rebuild/index readiness ---'
rg -n -C 4 'staging|promotion|nuclear_rebuild|FTS5|BM25|queryable|ready|swap' README.md

Repository: lyonzin/knowledge-rag

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- swap/rebuild implementation ---'
sed -n '2020,2445p' mcp_server/server.py

printf '%s\n' '--- exact post-swap helpers and call sites ---'
rg -n -C 18 \
  '_swap_collections_atomic|_rebuild_bm25_post_swap|_fts5_reset_and_rebuild|_staging_target|_bm25_initialized|build_index\(\)' \
  mcp_server/server.py | sed -n '1,900p'

Repository: lyonzin/knowledge-rag

Length of output: 49099


Document the staging promotion and index-readiness sequence.

Update both diagrams to show that nuclear_rebuild(swap=True) writes to staging, validates it, atomically promotes it to production, rebuilds BM25, then resets and asynchronously migrates FTS5. State that readers use production until promotion and that FTS5 queries fall back to hybrid until migration completes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 282 - 284, Update both README diagrams to document
the full staging promotion and index-readiness sequence:
nuclear_rebuild(swap=True) writes and validates staging, atomically promotes it
to production, rebuilds BM25, then resets and asynchronously migrates FTS5.
Indicate that readers use production until promotion and FTS5 queries fall back
to hybrid until migration completes.

Comment thread README.md
Comment on lines +363 to +364
NOTREADY -->|yes, hit| MINSCORE
SNIPPET --> RESULTS["Results<br/>search_method: fts5 | hybrid | semantic | keyword<br/>routed_by: fts5_router | none<br/>score + filtered_by_score + content_length"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n -C 6 --glob '!README.md' \
  'search_method|routed_by|filtered_by_score|content_length' .

Repository: lyonzin/knowledge-rag

Length of output: 50377


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- README context ---'
sed -n '345,375p' README.md

printf '%s\n' '--- implementation dispatch and result labels ---'
sed -n '2660,2705p;2832,2895p;3048,3082p;3884,3992p' mcp_server/server.py

printf '%s\n' '--- focused tests ---'
sed -n '1,15p;107,125p' tests/test_search_method_override.py
sed -n '45,65p;78,106p' tests/test_e2e_fts5.py

Repository: lyonzin/knowledge-rag

Length of output: 16912


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 8 'search_method|effective_method|effective route|routed_by' README.md docs/features/fts5_fast_path.md

Repository: lyonzin/knowledge-rag

Length of output: 39223


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '820,865p;1305,1325p' README.md

Repository: lyonzin/knowledge-rag

Length of output: 2788


Clarify the two search_method contracts.

Document auto | hybrid | fts5 as the request selector. Document fts5 | hybrid | semantic | keyword as the result-item label. Explain how auto maps to the selected path, and add fts5 to the Search Method Values list.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 363 - 364, Update the README search flow and Search
Method Values documentation to distinguish the request selector contract (auto,
hybrid, fts5) from the result-item search_method label contract (fts5, hybrid,
semantic, keyword). Explain that auto resolves to the selected search path, and
add fts5 to the Search Method Values list.

@lyonzin
lyonzin requested a balanced review from Copilot August 11, 2026 00:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates architecture documentation to reflect FTS5 dispatch, staging-aware ingestion, and current category organization.

Changes:

  • Documents FTS5 routing, fallback, and result metadata.
  • Adds staging write dispatch and secondary-index flows.
  • Updates categories, tools, and hybrid_alpha guidance.
Suppressed comments (4)

README.md:310

  • Forced search_method="fts5" must not enter the auto readiness/minimum-hit fallback gate. Runtime raises Fts5NotReadyError when disabled/unready and, when ready, bypasses min_hits entirely. Split forced and auto FTS5 branches so the diagram does not promise a hybrid fallback for explicit requests.
        METHOD -->|fts5| FASTPATH

README.md:325

  • This block still depicts a word-boundary match as a hard redteam filter. Since the automatic keyword route is telemetry-only, both branches search the same hybrid corpus and differ only in the routed_by value.
    subgraph ROUTING["Keyword Routing (category filter)"]
        KWROUTER["Keyword Router<br/>(word boundaries)"]

README.md:394

  • “Keeps prod serving queries” overstates the current isolation. Production ChromaDB remains query-visible, but _populate_staging() rebinds self.bm25_index, and query() reads that field dynamically, so BM25/hybrid behavior can change during population. Scope this promise specifically to ChromaDB reads.
        STAGING["Staging Collection<br/>(nuclear_rebuild only,<br/>keeps prod serving queries)"]

README.md:416

  • These edges omit the isolated BM25 state populated during staging and imply direct FTS5 updates throughout rebuild ingestion. After a swap, runtime rebuilds BM25 and resets/repopulates FTS5 from the swapped ChromaDB; direct FTS5 synchronization applies only to production CRUD operations. Show those distinct consistency paths.
    STAGING --> CHROMADB
    PROD --> CHROMADB
    PROD --> BM25IDX
    PROD --> FTS5DB

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md
Comment on lines +243 to +246
SM --> QROUTER
QROUTER -->|lexical| FTS5PATH
QROUTER -->|semantic| HYBRIDPATH
FTS5PATH -.->|not_ready / low_hits<br/>fallback| HYBRIDPATH
Comment thread README.md
subgraph HYBRID["HYBRID PIPELINE"]
direction LR
ROUTER["Keyword Router<br/>(word boundaries)"]
KWROUTER["Keyword Router<br/>(word boundaries → category filter)"]
Comment thread README.md
ADJ --> MINSCORE
SNIPPET --> RESULTS["Results<br/>search_method: hybrid|semantic|keyword<br/>score + filtered_by_score + content_length"]
NOTREADY -->|yes, hit| MINSCORE
SNIPPET --> RESULTS["Results<br/>search_method: fts5 | hybrid | semantic | keyword<br/>routed_by: fts5_router | none<br/>score + filtered_by_score + content_length"]
Comment thread README.md
CHUNKER["Chunking<br/>MD: section-aware<br/>Other: 1000 chars + 200 overlap"]
PARSERS --> CHUNKER
FTS5SYNC["FTS5 CRUD sync<br/>(v4.8.2 task 05)"]
PARSERS --> CHUNKER --> FTS5SYNC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants