Project Planning
Milestone 1 - Foundation & Basic Pipeline
Summary
Establish the technical foundation and build the minimal agent framework to support the pipeline.
Timeline
Weeks 1-4
Goal
Create the database foundation, basic agent framework, Hermes Orchestrator, API services (Agent Auth, Registry, Data), agent versioning system, and minimal orchestrator that can discover agents and execute a simple pipeline.
Deliverables
Database & Infrastructure
- ✅ Monorepo structure with Turborepo configured
- ✅ PostgreSQL database with Prisma ORM setup
- ✅ Minimal database schema (only essential tables):
User- Basic user informationTicker- Stock symbolsUserTicker- User-ticker subscriptionsNewsletter- Generated newsletters (withcreatedAttimestamp for freshness tracking)NewsletterContent- Newsletter content (simple text field)AgentConfig- Basic configuration storageAgentRegistry- Agent type metadata (not version-specific)AgentVersion- Agent version snapshots and metadataAgentVersionDeployment- Active version tracking (only one version per agentId can be production)AgentInstance- Running agent instance tracking (capacity, load, status)AgentJobExecution- Individual agent job execution trackingSchedule- Admin-created schedulesJobTemplate- Reusable job definitionsPipeline- Multi-agent workflow definitionsScheduleExecution- Schedule execution historyAPIKey- API keys used by agents to authenticate themselves- Note: Job tracking also handled by BullMQ/Redis
- ✅ Database migrations and seed scripts
- ✅ Redis setup for BullMQ queue system
- ✅ Environment variable management
Agent Framework (Minimal)
- ✅ Base Agent class with:
- Error handling
- Basic logging
- Configuration loading from database (
AgentConfigtable) - Agent version reading from
AgentVersionDeploymenttable - Version information included in all outputs (
agentVersionfield) - HTTP endpoint exposure (agents are language-agnostic services)
- ✅ Agent versioning foundation:
- Agents read active version from
AgentVersionDeploymenttable during initialization - All agent outputs include
agentVersionfield for traceability - Basic version management (create version, deploy to production)
- Agents read active version from
- ✅ Event-driven communication foundation:
- Agents communicate through shared database and Agent Data API (not direct calls)
- Data timestamping for freshness tracking (using
createdAt/updatedAtfields on data tables) - Agents read from database and write outputs via Agent Data API
Hermes Orchestrator (Core System Component - Not an Agent)
- ✅ Basic orchestrator (
apps/hermes-scheduler/) that can:- Load schedules from database (
Scheduletable) - Load pipelines from database (
Pipelinetable) - Discover agents from database (
AgentRegistrytable) - Query
AgentVersionDeploymentto determine active production version for each agent - Query
AgentInstancetable to discover available agent instances - Execute schedules (cron, interval, or once) - configured via admin interface
- Support data source expansion for any agent parameter (e.g.,
db:ticker:all:id?enabled=true) - Execute a simple 3-stage newsletter pipeline sequentially:
- Data Collection (placeholder - invoked via HTTP endpoint, writes via Agent Data API)
- Content Generation (placeholder - invoked via HTTP endpoint, writes via Agent Data API)
- Delivery (placeholder - invoked via HTTP endpoint, writes via Agent Data API)
- Basic instance management:
- Spawn agent instances when needed (creates instance records in
AgentInstancetable) - Terminate idle instances
- Track instance capacity and current load
- Spawn agent instances when needed (creates instance records in
- Invoke agent HTTP endpoints with proper authentication (API keys from Agent Auth API)
- Sequential execution (no parallelism yet)
- Basic error handling and retry logic
- Load schedules from database (
- ✅ Long-running BullMQ worker process
- ✅ Database tables:
AgentRegistry,AgentVersion,AgentVersionDeployment,AgentInstance,AgentJobExecution,Schedule,Pipeline,ScheduleExecution
Agent Auth API
- ✅ Separate server (
apps/agent-auth-api/) with basic CRUD endpoints:POST /api/add/- Add a new API keyPOST /api/delete/- Delete an API keyPOST /api/list/- List all API keysPOST /api/view/- View an API keyPOST /api/update/- Update an API keyPOST /api/enable/- Enable an API keyPOST /api/disable/- Disable an API keyPOST /api/revoke/- Revoke an API keyPOST /api/rotate/- Rotate an API key
- ✅ Authentication endpoint for agents to validate API keys
- ✅ Integration with
APIKeydatabase table
Agent Registry API
- ✅ Separate server (
apps/agent-registry-api/) with endpoints:POST /api/registry/register/- Register or update agent type metadataPOST /api/register/- Register a new agent instancePOST /api/heartbeat/- Update instance status and loadPOST /api/deregister/- Deregister an agent instanceGET /api/instances/- Query available agent instancesGET /api/registry/- Query agent type registry
- ✅ Maintains
AgentRegistrytable (agent type metadata) - ✅ Maintains
AgentInstancetable (running instance tracking) - ✅ Basic health monitoring (heartbeat tracking)
Agent Data API
- ✅ Separate server (
apps/agent-data-api/) with write endpoints:POST /api/query-strategy/- Receive output from Query Strategy AgentPOST /api/data-collection/- Receive output from Data Collection AgentPOST /api/analysis-agent/- Receive output from Analysis AgentPOST /api/content-generation/- Receive output from Content Generation AgentPOST /api/quality-assurance/- Receive output from Quality Assurance AgentPOST /api/delivery/- Receive output from Delivery AgentPOST /api/learning/- Receive output from Learning Agent
- ✅ Authentication using API keys (validates via Agent Auth API)
- ✅ Basic validation and storage of agent outputs
- ✅ All outputs include
agentVersionfield for traceability
Web Application (Minimal)
- ✅ Next.js 16+ App Router application (
apps/web/- user dashboard, separate fromapps/marketing/) - ✅ NextAuth.js authentication (email/password only)
- ✅ Basic dashboard page (
/dashboard) that:- Shows authenticated user information
- Lists user's newsletters (filtered by
Newsletter.userId, if any exist) - Displays newsletter content in simple text format
- ✅ Database package (
packages/database/) with Prisma client (shared package used by all apps)
Shared Packages
- ✅
packages/shared/- Basic types and utilities - ✅ Basic logging infrastructure
Task Timeline
Limitations (Acceptable for This Milestone)
- No actual data collection (uses hardcoded data)
- No analysis stage (skipped in 3-stage pipeline)
- No quality assurance (skipped in 3-stage pipeline)
- No email delivery (only saves to database)
- No personalization (same content for all users)
- Sequential execution only (no parallelism - processes one user-ticker combination at a time)
- Basic error handling only (errors logged but no retry logic beyond BullMQ defaults)
- No job status tracking UI (jobs tracked in Redis/BullMQ and
AgentJobExecutiontable) - Basic instance management only (spawn/terminate, no advanced scaling yet)
- Agent versioning is basic (create/deploy, no rollback UI yet)
- API services have minimal validation and error handling
Success Criteria
- ✅ Database schema created and migrations run successfully (including versioning tables)
- ✅ Agent Auth API is functional and can manage API keys
- ✅ Agent Registry API is functional and can register agent types and instances
- ✅ Agent Data API is functional and can receive agent outputs
- ✅ Hermes Orchestrator can discover agents from
AgentRegistrytable - ✅ Orchestrator can execute schedules and run the 3-stage pipeline end-to-end
- ✅ Orchestrator can spawn and track agent instances in
AgentInstancetable - ✅ Placeholder agents execute via HTTP endpoints and produce output (each stage completes successfully)
- ✅ Agents include
agentVersionin all outputs - ✅ Agents write outputs via Agent Data API (not directly to database)
- ✅ Newsletter is saved to database with correct
userIdassociation - ✅ User can log in via NextAuth.js and see their dashboard
- ✅ Newsletter appears in user's dashboard (filtered by user, even if content is placeholder)
- ✅ Data flows correctly between pipeline stages via Agent Data API (Data Collection → Content Generation → Delivery)
Next Steps
After this milestone, the system can run end-to-end (with placeholder data). Milestone 2 will replace placeholders with actual functionality.