Commit Graph

2 Commits

Author SHA1 Message Date
0a3b747612 [CLAUDE] Docs: chốt Session 21 turn 2 — RAG Hybrid setup planning + Cách A validation
Sau S21 turn 1 chốt cicd-monitor, bro clarify 5 dự án future > 1M MD tokens → discussion deep ~15 turn về RAG infrastructure. Em main solo (no SOLUTION_ERP sub-agent spawn), delegate claude-code-guide × 2 research Anthropic + community practice.

Quyết định chốt:
- Cách A defensive (giữ blanket 120K em main + RAG retrieve supplement)
- Bỏ Cách B aggressive (cắt 60-70% blanket) — vi phạm priority em main control flow strong
- Industry-validated cross 4 Anthropic blog + 5 community tools (Cursor/Continue/Cline/Aider all hybrid)
- 3-layer pattern Phase 1-3 incremental rollout (vector → +BM25 → +reranking, recall ~70% → ~92%)
- Stack: Voyage-3-large + Qdrant local + FastMCP Python + Streamlit dashboard

Multi-agent cost reality clarify (post-S21 t2):
- Em main blanket: ~120K
- 4 sub-agents spawn cumulative: ~400K
- Total billed heavy session: ~560K Cách A vs ~700K lazy
- Saving -20% từ multi-agent shared cache 70-90%
- Anthropic acknowledge 8-10× multiplier multi-agent

Files updated:
- docs/STATUS.md (Last updated S21 turn 2 + Recently Done row top)
- docs/HANDOFF.md (TL;DR Session 21 turn 2 section + Last updated)
- docs/rag-setup-plan.md (+Section 13 multi-agent cost reality + Section 14 3-layer hybrid Phase 1-3, +355 LOC)
- docs/changelog/sessions/2026-05-12-1800-s21-turn2-rag-planning.md (new session log)

Memory user-level update (outside repo, separate update):
- feedback_rag_hybrid_pattern.md (NEW cross-project pattern reusable)
- MEMORY.md index (+1 entry pointer)

Plan I NEW deferred — trigger bro confirm 5 dự án path + stack + pilot + Voyage API + disk cleanup → dedicated session 10-14h weekend (per feedback_drastic_refactor_scope rule).

Stats:
- 17 memory entries (+1 RAG hybrid)
- 1 plan file rag-setup-plan.md (1500 LOC final)
- 4 sub-agents seeds-only unchanged
- 81 test unchanged
- 4 commits S21 cumulative (f1c61c9 + 3a34831 + 1f8e9af + this)

CI skip per path filter (all .md).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 18:50:28 +07:00
1f8e9af66f [CLAUDE] Docs: Save RAG setup plan chỉn chu cross-project reference
Plan comprehensive cho future 2 dự án bro > 1M MD context (SOLUTION_ERP baseline reference, chưa cần implement vì 354K < threshold).

12 sections:
1. Context + Why (problem + solution + benefits table)
2. Architecture overview (6-layer diagram: blanket + Qdrant + Voyage + MCP + multi-AI + re-index)
3. BLANKET load list ~100K (28%) — 5 categories: core stable + current state top + agent infra + skills desc + memory critical
4. RAG store list ~254K (72%) — 8 categories: session logs (49%) + gotchas + archives + flows/database + skills detail + memory non-critical + guides + audit
5. Tool stack recommend — Qdrant + Voyage-3-large + FastMCP Python + custom chunker + pre-commit hook
6. Setup scripts copy-paste ready (~250 LOC Python total: indexer + MCP server + settings + hook + agent .md update)
7. Audit procedure 3-tier cadence — weekly quick (~30min) + monthly deep (~2-3h) + quarterly major (~4-6h) + trigger-based ad-hoc
8. Multi-AI client access — MCP protocol agnostic, stdio/HTTP/SSE transport, bearer auth + rate limit, setup per client (Claude Code/Desktop/Cursor/GPT-4)
9. Timeline rollout — 10-14h dedicated session + 4-week trial plan + decision gate PASS/TUNE/ROLLBACK criteria
10. Caveats + risks — beta features + storage 96% full warning + quality monitoring + fallback graceful
11. Success metrics — quality (recall >80%, precision >75%) + cost (<$5/mo) + performance (P50<200ms) + capacity (+50% session lifespan) + multi-AI
12. Future enhancements — Phase 2 (Memory tool + Files API) → Phase 3 (Contextual Retrieval + multi-project) → defer over-engineering

Status: PLAN ONLY — chưa implement. Next trigger: bro confirm 3 thông tin (2 dự án path + stack + pilot choice) → spawn Investigator audit MD inventory pre-flight.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 18:05:18 +07:00