Some checks failed
ci/woodpecker/push/api Pipeline failed
Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
49 lines
1.6 KiB
Markdown
49 lines
1.6 KiB
Markdown
# MS22 — Conversation Archive Module
|
|
|
|
## Objective
|
|
|
|
Implement ConversationArchive module: ingest OpenClaw session logs, store with vector embeddings for semantic search.
|
|
|
|
## Deliverables
|
|
|
|
1. ConversationArchive Prisma model
|
|
2. NestJS module at apps/api/src/conversation-archive/
|
|
3. Endpoints: ingest, search, list, get-by-id
|
|
4. Register in app.module.ts
|
|
5. Migrate, lint, build, commit
|
|
|
|
## Plan
|
|
|
|
- Add model to schema.prisma (end of file)
|
|
- Add relation to Workspace model
|
|
- Create module structure: dto/, service, controller, spec, module
|
|
- Use EmbeddingService from knowledge module (import KnowledgeModule or just PrismaModule + embed inline)
|
|
- Follow pattern: AuthGuard + WorkspaceGuard + PermissionGuard
|
|
- Endpoint prefix: conversations (maps to /api/conversations)
|
|
- Vector search: $queryRaw with <=> operator (cosine distance)
|
|
|
|
## Assumptions
|
|
|
|
- ASSUMPTION: Embedding is stored inline on ConversationArchive (not a separate table) — simpler and sufficient for this use case, matches MemoryEmbedding pattern
|
|
- ASSUMPTION: Import KnowledgeModule to reuse EmbeddingService (it exports it)
|
|
- ASSUMPTION: messageCount computed server-side from messages array length on ingest
|
|
- ASSUMPTION: Permission level WORKSPACE_MEMBER for ingest/search, WORKSPACE_ANY for list/get
|
|
|
|
## Progress
|
|
|
|
- [ ] Schema model
|
|
- [ ] Migration
|
|
- [ ] DTOs
|
|
- [ ] Service
|
|
- [ ] Controller
|
|
- [ ] Spec
|
|
- [ ] Module
|
|
- [ ] app.module.ts registration
|
|
- [ ] Lint + build
|
|
- [ ] Commit
|
|
|
|
## Risks
|
|
|
|
- EmbeddingService exports from knowledge.module — need to import KnowledgeModule
|
|
- Migration requires live DB (may need --skip-generate flag if no DB access)
|