feat(rag): feed whole matched documents to the LLM — no context truncation (A7 revised)

This commit is contained in:
2026-08-24 23:37:44 -04:00
parent d7a4064616
commit 1e6ae360e0
16 changed files with 923 additions and 60 deletions
+2 -4
View File
@@ -126,9 +126,7 @@ def plan_turn(
best_cosine = max((c.cosine for c in chunks), default=0.0)
fts_hits = sum(1 for c in chunks if c.fts_hit)
if best_cosine >= settings.relevance_threshold or fts_hits > 0:
docs = select_documents(
chunks, n=settings.top_n_docs, max_chars=settings.max_context_chars
)
docs = select_documents(chunks, n=settings.top_n_docs)
return TurnPlan(
best_cosine,
fts_hits,
@@ -144,7 +142,7 @@ def plan_turn(
fts_hits,
True,
build_deflect_prompt(titles, notes=steering),
select_documents(chunks, n=settings.top_n_docs, max_chars=settings.max_context_chars),
select_documents(chunks, n=settings.top_n_docs),
derive_suggestions(titles, settings.suggestions),
len(steering),
)