Implement RAG summarization and context pipeline

- Add ContextPipeline for async RAG lookups
- Implement RAG result summarization via LLMProcessor
- Add CLI flag for PDF ingestion
- Strip markdown code blocks from LLM responses
- Update TUI context display to use ListItems
This commit is contained in:
2026-05-27 00:17:47 -07:00
parent b83d9b5e6a
commit b25f82cefc
7 changed files with 225 additions and 14 deletions
+11 -1
View File
@@ -87,7 +87,17 @@ class LLMProcessor:
response_format=response_format,
extra_body={"enable_thinking": False},
)
return response.choices[0].message.content
content = response.choices[0].message.content
# Strip markdown code blocks if present
if content.startswith("```"):
import re
content = re.sub(
r"^```(?:json)?\n?|```$", "", content, flags=re.MULTILINE
).strip()
return content
except Exception as e:
logger.error(f"LLM Error: {e}")
return ""