[Phase 2] Backend Agent: Hono server + Pi Agent + RAG tools + WebSocket #2

Closed
opened 2026-05-21 16:57:17 +02:00 by sleepy · 0 comments
Owner

Implement the backend server and Pi Agent integration.

Acceptance Criteria

  • backend/src/config.ts — loads config.yaml with env var interpolation
  • backend/src/vectordb.ts — LanceDB Node.js client for hybrid search
  • backend/src/tools.tsdnd_rules_search tool, roll_dice tool
  • backend/src/prompts.ts — Reference mode, DM mode, and OOC handler prompts
  • backend/src/agent.ts — Agent factory with transformContext RAG injection
  • backend/src/ws.ts — WebSocket handler streaming agent events
  • backend/src/index.ts — Hono server with REST + WS endpoints
  • backend/src/routes/api.ts — REST endpoints for search, dice, config
  • shared/src/types.ts — shared types (messages, config schema)
  • shared/src/dice.ts — dice notation parser (XdY+Z, kh/kl, etc.)
  • TypeScript compiles without errors

Files to Create/Modify

  • backend/src/*.ts
  • shared/src/*.ts
  • backend/package.json (update deps as needed)

See project.md sections 3, 5, 6, 7, 12 for full spec.

Implement the backend server and Pi Agent integration. ## Acceptance Criteria - [ ] `backend/src/config.ts` — loads `config.yaml` with env var interpolation - [ ] `backend/src/vectordb.ts` — LanceDB Node.js client for hybrid search - [ ] `backend/src/tools.ts` — `dnd_rules_search` tool, `roll_dice` tool - [ ] `backend/src/prompts.ts` — Reference mode, DM mode, and OOC handler prompts - [ ] `backend/src/agent.ts` — Agent factory with `transformContext` RAG injection - [ ] `backend/src/ws.ts` — WebSocket handler streaming agent events - [ ] `backend/src/index.ts` — Hono server with REST + WS endpoints - [ ] `backend/src/routes/api.ts` — REST endpoints for search, dice, config - [ ] `shared/src/types.ts` — shared types (messages, config schema) - [ ] `shared/src/dice.ts` — dice notation parser (XdY+Z, kh/kl, etc.) - [ ] TypeScript compiles without errors ## Files to Create/Modify - `backend/src/*.ts` - `shared/src/*.ts` - `backend/package.json` (update deps as needed) See `project.md` sections 3, 5, 6, 7, 12 for full spec.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/dnd-rag#2
No description provided.