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
+12 -3
View File
@@ -3,7 +3,16 @@ from typing import List, Optional, Union
from textual.app import App, ComposeResult
from textual.containers import Container, Horizontal, Vertical
from textual.widgets import Button, DataTable, Footer, Input, Label, ListView, Static
from textual.widgets import (
Button,
DataTable,
Footer,
Input,
Label,
ListItem,
ListView,
Static,
)
from src.llm.models import CharacterStateUpdate, ExtractionResult, LoreUpdate
from src.persistence.characters import update_character_state
@@ -181,8 +190,8 @@ class ConfirmationApp(App):
# Format the update for display
display_text = f"Query: {update.query}\nSource: {update.source}\n\n{update.snippet}"
# Add a new Static widget to the ListView
context_pane.mount(Static(display_text))
# Add a new ListItem widget to the top of the ListView for 'most recent'
context_pane.mount(ListItem(Label(display_text), index=0))
if hasattr(self.context_queue, "task_done"):
self.context_queue.task_done()