Skip to content

feat(chat): ship the grounded chat and retrieval slice - #36

Merged
kpeez merged 3 commits into
mainfrom
next-step
Mar 25, 2026
Merged

feat(chat): ship the grounded chat and retrieval slice#36
kpeez merged 3 commits into
mainfrom
next-step

Conversation

@kpeez

@kpeez kpeez commented Mar 25, 2026

Copy link
Copy Markdown
Owner

This PR turns the rebuilt PaperChat app into a real grounded-chat product by adding retrieval, conversation persistence, a first-class chat UI, and the runtime hardening needed to exercise that UI reliably in local browser runs.

Summary

  • adds the backend chat/retrieval contract on top of persisted chunks and conversations
  • adds the /app/chat experience and promotes the product shell from library-only to library plus chat
  • hardens local launch behavior so frontend port drift no longer breaks browser fetches

Why

  • PaperChat already launched, ingested PDFs, and managed a local library, but it still stopped short of the core product promise: grounded chat over user-owned papers.
  • Live browser testing also exposed a real runtime paper cut in the launcher/dev-origin path that needed to be fixed before this slice could feel stable.

Changes

  • add backend chat endpoints, typed chat/citation models, deterministic grounded answer generation, and conversation persistence
  • add sqlite-vec retrieval over persisted chunk embeddings and keep the vector index synchronized with chunk lifecycle changes
  • wire the chat service into the FastAPI app and allow local dev CORS origins across localhost and 127.0.0.1 ports
  • split the frontend shell into /app/library and /app/chat, add shared navigation, and add the chat API client
  • ship a transcript-first chat UI with conversation history, source selection, inline source disclosure, and a library-to-chat entrypoint
  • require the expected Vite frontend port during launcher startup and keep launcher tests aligned with that stricter contract

Testing

  • cd backend && uv run ruff check paperchat tests && uv run ruff format --check paperchat tests && uv run ty check && uv run pytest -q
  • cd frontend && pnpm lint && pnpm build
  • uv run --group dev ruff check paperchat_cli tests && uv run --group dev ruff format --check paperchat_cli tests && uv run --group dev pytest tests/test_launcher.py -q
  • uv run paperchat launch and browser smoke the library-to-chat flow with a ready PDF

@kpeez
kpeez merged commit a47d798 into main Mar 25, 2026
@kpeez
kpeez deleted the next-step branch March 25, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant