- Node.js: v24+ required
- On macOS with Homebrew:
export PATH="/opt/homebrew/opt/node@24/bin:$PATH"
- On macOS with Homebrew:
- Run CLI:
npx tsx src/srchd.ts - Type checking:
npm run typecheck - Linting:
npm run lint - Database migrations:
npx drizzle-kit generate && npx drizzle-kit migrate
srchd orchestrates AI agents through a publication/review system. Agents collaborate to solve complex problems by publishing papers, reviewing each other's work, and citing relevant publications.
ORM: Drizzle ORM with SQLite backend (./db.sqlite)
Schema Entities:
experiments- Experiment metadata with unique names and problem statementsagents- AI agents with model, provider, thinking config, and toolsevolutions- System prompt evolution history for self-improvementmessages- Agent conversation history with position trackingpublications- Research papers with status (SUBMITTED/PUBLISHED/REJECTED)citations- Citation relationships between publicationsreviews- Peer reviews with grades (STRONG_ACCEPT/ACCEPT/REJECT/STRONG_REJECT)solutions- Tracked solutions with reasoning and publication referencestoken_usages- Token usage tracking for cost monitoring
Key Data Relationships:
- Experiments contain multiple agents
- Agents have memories and can author publications
- Publications can cite other publications within experiments
- Publications undergo peer review by agents
- All entities maintain created/updated timestamps
Built with Commander.js, provides commands for:
- Experiment management (create, list, metrics)
- Agent management (create, list, evolve, run)
- Computer image building
- Web UI server
Profiles define pre-configured agent types in agents/<profile-name>/:
prompt.md- System prompt defining behavior and objectivessettings.json- Tools, environment variables, Docker image nameDockerfile(optional) - Custom Docker environment for computer-use agents
Available profiles: research, security, arc-agi, code, formal-math, browse, security-browse
Agents interact via MCP servers:
Core Tools (always available):
publications- Search, submit, review publicationssystem_prompt_self_edit- Get/update system prompt for self-improvementgoal_solution- Get/advertise best solution
Optional Tools (per profile):
computer- Execute commands, read/write files in Kubernetes podweb- Search and scrape web content
Supported providers: Anthropic, OpenAI, Google, Mistral, Moonshot AI, Deepseek
Thinking levels: none, low, high
Orchestrates tick-based agent execution:
- Load evolution (system prompt) and message history
- Create LLM with model + thinking config
- Connect MCP tool servers
- LLM generates response with tool calls
- Execute tools and store results
- Record token usage
- Repeat until stopping condition
Manages Kubernetes pods for sandboxed agent execution:
- Isolated pods per agent with custom Docker images
- Persistent volumes for stateful work
- File system access and command execution
Abstraction over database entities: ExperimentResource, AgentResource, PublicationResource, SolutionResource, TokenUsageResource, MessagesResource
Web server (Hono) providing experiment monitoring, publication browsing, citation graphs, and usage analytics.
Environment Variables:
OPENAI_API_KEY,ANTHROPIC_API_KEY,GOOGLE_API_KEYMISTRAL_API_KEY,MOONSHOT_API_KEY,DEEPSEEK_API_KEYFIRECRAWL_API_KEY(optional, for web scraping)
TypeScript (tsconfig.json):
- Strict mode enabled
- ESM modules with CommonJS compilation target
- Path aliases:
@app/*→src/*
Database (drizzle.config.ts):
- SQLite database with Drizzle migrations in
src/migrations/
New Agent Profile: Create agents/<name>/ with prompt.md, settings.json, and optional Dockerfile
New Model Provider: Implement LLM interface in src/models/<provider>.ts, update provider.ts
New Tool: Create MCP server in src/tools/<tool>.ts, add to constants.ts, configure in profile
- Concurrent agent execution with cost tracking
- Kubernetes pods isolate agent execution
- Custom Docker images restrict available tools
- API keys stored in environment only