A guide to the Agentis codebase for contributors and developers building on top of it.
| Layer | Technology |
|---|---|
| UI Framework | React 18 + TypeScript |
| Build | Vite 5 |
| Database | IndexedDB via Dexie.js |
| 3D Visualization | Three.js |
| Styling | CSS custom properties (no framework) |
| LLM Streaming | Native fetch with ReadableStream |
agentis/
├── src/
│ ├── components/
│ │ ├── pages/ # One file per page/screen
│ │ └── *.tsx # Shared UI components
│ ├── hooks/
│ │ └── useAgent.ts # Core agent execution hook
│ ├── lib/
│ │ ├── db.ts # IndexedDB schema (Dexie)
│ │ ├── memory.ts # Agent memory system
│ │ ├── analytics.ts # Token usage tracking
│ │ ├── claude.ts # Pipeline builder + streaming
│ │ ├── engine.ts # Workflow execution engine
│ │ ├── multiAgentEngine.ts # Multi-agent orchestration
│ │ ├── agentSkills.ts # skills.sh integration
│ │ ├── approvals.ts # Approval request system
│ │ ├── chatHistory.ts # Session persistence
│ │ └── colors.ts # Agent role color palette
│ ├── data/
│ │ └── templates.ts # Workflow template definitions
│ ├── types/ # Shared TypeScript types
│ └── App.tsx # Root component + routing
├── docs/ # This documentation
├── public/ # Static assets
├── vite.config.ts # Vite + proxy configuration
├── vite-plugin-agentis.ts # Engine daemon plugin
└── SKILL.md # Agentis skill for skills.sh
The core orchestration engine. Handles:
- Provider selection and failover across 12 LLM APIs
- Per-role system prompt construction with skill injection
- Streaming responses with token counting
- Parallel agent execution with phase tracking
Key function: workerSystem(role, providerKey, model) → returns a system prompt for that role.
The single-agent pipeline builder. Handles:
- Persona definitions (dev, writer, analyst, researcher, browser)
- Multi-step pipeline construction from a task
- Tool definitions for browser automation
- Streaming with step-level progress updates
The workflow execution engine for template-based runs. Handles:
- Node dependency resolution
- Parallel group execution
- Artifact extraction from outputs
IndexedDB schema definition using Dexie:
memories: 'id, agentId, key, ts, importance, category, lastAccessed, [agentId+key]'
analytics: 'id, ts, model, persona'
sessions: 'id, ts, persona'React hook that orchestrates a full agent run:
- Calls
buildPipeline()→runAgentStreaming() - Tracks per-step status updates via streaming callbacks
- Auto-saves task memory on completion
- Records token usage to analytics
All external API calls are proxied through Vite to bypass CORS:
| Proxy path | Target |
|---|---|
/anthropic |
api.anthropic.com |
/openai-proxy |
api.openai.com |
/google-proxy |
generativelanguage.googleapis.com |
/github-raw |
raw.githubusercontent.com |
/github-api |
api.github.com |
/skills-sh |
skills.sh |
/agentis-proxy |
Engine daemon (default: localhost:4200) |
/pinchtab |
PinchTab service (localhost:9867) |
| (+ 8 more) | All other LLM providers |
User submits task
│
▼
useAgent.execute(task, personaId)
│
▼
buildPipeline(task, personaId) → PipelineStep[]
│
▼
runAgentStreaming(task, pipeline, apiKey, onChunk)
│
├── For each step: POST /anthropic/v1/messages (streaming)
├── Stream chunks → update pipeline step output in state
└── On all_done:
├── autoSaveTaskMemory() → db.memories
└── addUsageRecord() → db.analytics
User submits task
│
▼
multiAgentEngine.runMultiAgent(task, config)
│
├── Phase 1: Orchestrator plans breakdown
├── Phase 2: Parallel agent execution
│ ├── Researcher (provider A)
│ ├── Analyst (provider B)
│ ├── Coder (provider C)
│ └── Writer (provider A, failover)
└── Phase 3: Summarizer synthesizes all outputs
│
▼
Final output stream
- Add the provider to
PROVIDER_MODELSinsrc/lib/multiAgentEngine.ts - Add a proxy entry in
vite.config.ts - Add the provider card to
PROVIDERSinsrc/components/pages/SettingsPage.tsx - Handle the API format in the streaming function in
src/lib/multiAgentEngine.ts
- Create
src/components/pages/YourPage.tsx - Add it to the navigation in
src/App.tsx - Add a sidebar entry
VITE_OPENFANG_URL=http://localhost:4200 # Engine daemon URL (optional)
VITE_OPENFANG_PORT=4200 # Engine daemon port (optional)
ANTHROPIC_API_KEY=sk-ant-... # Passed to engine daemon (optional)All other provider keys are configured through the UI and stored in localStorage.
- Fork the repo
- Create a branch:
git checkout -b feat/your-feature - Make changes + ensure
npx tsc --noEmitpasses with zero errors - Open a PR against
main
See CONTRIBUTING.md for the full guide.