diff --git a/telegram/kb_retrieval.py b/telegram/kb_retrieval.py index 87106e2..218b84c 100644 --- a/telegram/kb_retrieval.py +++ b/telegram/kb_retrieval.py @@ -175,11 +175,11 @@ class KBIndex: # Extract wiki-linked claim references from body related_claims = re.findall(r"\[\[([^\]]+)\]\]", body) - # Body excerpt — decisions get full body (typically 1-2K), entities get 500 chars + # Body excerpt — decisions get full body, entities get 500 chars ft = fm.get("type") if ft == "decision": - # Include full body for decision records — these are what users ask about - overview = body[:2000] if body else (summary or "") + # Full body for decision records — proposals can be 6K+ + overview = body[:8000] if body else (summary or "") elif summary: overview = f"{summary} " body_lines = [l for l in body.split("\n") if l.strip() and not l.startswith("#")] @@ -353,7 +353,7 @@ def retrieve_context(query: str, repo_dir: str, index: KBIndex | None = None, path=ent["path"], entity_type=ent["type"], domain=ent["domain"], - overview=_sanitize_for_prompt(ent["overview"], max_len=2000), + overview=_sanitize_for_prompt(ent["overview"], max_len=8000), tags=ent["tags"], related_claims=ent["related_claims"], )) @@ -583,7 +583,7 @@ def format_context_for_prompt(ctx: KBContext) -> str: sections.append(f"**{ent.name}** ({ent.entity_type}, {ent.domain})") # Top 3 entities get full content, rest get truncated if i < 3: - sections.append(ent.overview[:2000]) + sections.append(ent.overview[:8000]) else: sections.append(ent.overview[:500]) if ent.related_claims: