unsloth/studio/backend/core/rag
Roland Tannous ccebbed190 Studio: always pre-fetch RAG + min-score threshold + retrieval logging
- chat-adapter pre-fetches retrieval on every turn when RAG is on,
  regardless of provider. Users no longer have to phrase queries as
  'the document I attached' for retrieval to fire. Local tool models
  still get search_knowledge_base registered as a refinement path.
- New per-thread ragMinScore slider (Min relevance, 0..1) gates
  retrieved hits by dense cosine similarity. Hits below the floor
  (and BM25-only hits with no dense signal) are dropped server-side
  so unrelated docs don't get injected when the user's query is
  off-topic from what's indexed.
- Backend logs at search start (scope, top_k, min_score, query
  preview), after retrieval (retrieved vs met_threshold counts),
  and on return (final hit count) for both /api/rag/search and the
  search_knowledge_base tool path.
- System-prompt nudge prepended when pre-fetch returns hits so the
  model knows to cite [1], [2] rather than paraphrase silently.
2026-05-24 18:15:02 +04:00
..
parsers Studio: layout-aware RAG parsers + heading-aware chunking (Phase 3A) 2026-05-24 11:10:13 +04:00
__init__.py Studio: add RAG with hybrid search, reranker, chat integration 2026-05-23 18:46:15 +04:00
bm25.py Studio: add RAG with hybrid search, reranker, chat integration 2026-05-23 18:46:15 +04:00
chunking.py Studio: late chunking opt-in per KB (Phase 3B-late) 2026-05-24 12:18:09 +04:00
embeddings.py Studio: multimodal RAG mode (Phase 3B-multimodal) 2026-05-24 12:33:08 +04:00
ingestion.py Studio: multimodal RAG mode (Phase 3B-multimodal) 2026-05-24 12:33:08 +04:00
reranker.py Studio: multimodal RAG mode (Phase 3B-multimodal) 2026-05-24 12:33:08 +04:00
retrieval.py Studio: always pre-fetch RAG + min-score threshold + retrieval logging 2026-05-24 18:15:02 +04:00
tool.py Studio: always pre-fetch RAG + min-score threshold + retrieval logging 2026-05-24 18:15:02 +04:00
vector_store.py Studio: add RAG with hybrid search, reranker, chat integration 2026-05-23 18:46:15 +04:00