Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

@renseiai/agentfactory-server

Redis-backed infrastructure for AgentFactory. Provides work queue, session storage, worker pool management, issue locking, and webhook idempotency.

Installation

npm install @renseiai/agentfactory-server

Requires a Redis instance (works with Redis, Upstash, Vercel KV, or any Redis-compatible store).

What It Provides

Component Description
WorkQueue Priority queue with atomic claim/release (sorted sets)
SessionStorage Key-value session state (status, cost, timestamps)
WorkerStorage Worker registration, heartbeat, capacity tracking
IssueLock Per-issue mutex with pending queue
AgentTracking QA attempt counts, agent-worked history
WebhookIdempotency Dedup webhook deliveries with TTL
TokenStorage OAuth token storage and retrieval
RateLimit Token bucket rate limiting
WorkerAuth API key verification for workers
RedisEventBus Governor event bus backed by Redis Streams (consumer groups, MAXLEN trim)
RedisEventDeduplicator Governor event dedup using SETNX with TTL
RedisOverrideStorage Governor human override state (HOLD, PRIORITY)
RedisProcessingStateStorage Top-of-funnel phase tracking (research, backlog-creation)

Quick Start

import { createRedisClient, enqueueWork, claimWork } from '@renseiai/agentfactory-server'

// Redis client (auto-reads REDIS_URL from env)
const redis = createRedisClient()

// Enqueue a work item with priority
await enqueueWork({
  issueId: 'issue-uuid',
  identifier: 'PROJ-123',
  workType: 'development',
  priority: 2,
  prompt: 'Implement the login feature...',
})

// Worker claims next item
const work = await claimWork('worker-1')
if (work) {
  console.log(`Claimed: ${work.identifier} [${work.workType}]`)
}

Environment Variables

Variable Required Description
REDIS_URL Yes Redis connection URL (e.g., redis://localhost:6379)

Related Packages

Package Description
@renseiai/agentfactory Core orchestrator
@renseiai/agentfactory-cli CLI tools (worker, orchestrator)
@renseiai/agentfactory-nextjs Next.js webhook server

License

MIT