Add SummarizationService that reads hot agent logs (>24h), groups by
session, calls a cheap LLM (gpt-4o-mini default, configurable via
SUMMARIZATION_MODEL) to extract key insights, stores them with
embeddings in the insights table, and transitions processed logs to
warm tier. Add CronService with node-cron for scheduled execution
(summarization every 6h, tier management daily at 3am). Tier
management promotes warm→cold (30d) and purges cold logs (90d).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement AgentLogsRepo with structured log ingest (single + batch),
flexible query builder (filter by session, level, category, tier,
date range), and tiered storage management (hot→warm→cold→purge).
Add getLogsForSummarization() for the summarization pipeline.
Wire LogModule into gateway with REST endpoints at /api/logs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add EmbeddingService using OpenAI-compatible embeddings API (supports
text-embedding-3-small, configurable via EMBEDDING_MODEL and
EMBEDDING_API_URL env vars). Wire embedding generation into insight
creation and semantic search endpoint. POST /api/memory/search now
generates a query embedding and performs cosine distance search via
pgvector when OPENAI_API_KEY is configured.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add memory tables to DB schema (preferences, insights with pgvector
embedding column, agent_logs, skills, summarization_jobs). Implement
PreferencesRepo (CRUD + upsert) and InsightsRepo (CRUD + semantic
search + relevance decay). Define VectorStore and EmbeddingProvider
interfaces for future provider abstraction. Wire MemoryModule into
gateway with REST endpoints at /api/memory/*.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add @Inject() to all gateway constructor params (required without emitDecoratorMetadata)
- AgentService: ProviderService, CoordService
- RoutingService: ProviderService
- ProvidersController: ProviderService, RoutingService
- SessionsController: AgentService
- Fix coord controller ALLOWED_ROOTS to walk up to monorepo root (pnpm-workspace.yaml)
- Gateway now boots and serves all routes correctly
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pi SDK is ESM-only. tsx (esbuild) doesn't emit decorator metadata,
so NestJS constructor injection fails without explicit @Inject().
- Set "type": "module" in gateway package.json
- Switch tsconfig to NodeNext module resolution
- Add @Inject(AgentService) to ChatController and ChatGateway
Tested end-to-end: REST /api/chat → Pi SDK → Anthropic → response OK.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>