Step-by-step guide for adding NESTsoul to your NESTeq V3 setup.
- NESTeq V3 ai-mind worker deployed with D1 database
- Gateway worker with tool execution capability
- Dashboard (Pages) deployed
- OpenRouter API key
Copy the functions from src/nestsoul-gather.ts into your ai-mind worker's src/index.ts.
Register the MCP tools in your tool dispatch:
case "nestsoul_gather":
result = { content: [{ type: "text", text: await handleNestsoulGather(env) }] }
break
case "nestsoul_store":
result = { content: [{ type: "text", text: await handleNestsoulStore(env, toolParams) }] }
break
case "nestsoul_read":
result = { content: [{ type: "text", text: await handleNestsoulRead(env) }] }
break
case "nestsoul_validate":
result = { content: [{ type: "text", text: await handleNestsoulValidate(env, toolParams) }] }
breakDeploy: cd worker/ai-mind && npx wrangler deploy
Add these routes to your gateway's fetch handler (see src/nestsoul-endpoints.ts for full implementations):
// GET /nestsoul — read active soul
if (url.pathname === '/nestsoul' && request.method === 'GET') {
return handleNestsoulGet(env, executeTool)
}
// POST /nestsoul/generate — gather + synthesise + store
if (url.pathname === '/nestsoul/generate' && request.method === 'POST') {
return handleNestsoulGenerate(env, executeTool)
}
// POST /nestsoul/validate — carrier validates/rejects
if (url.pathname === '/nestsoul/validate' && request.method === 'POST') {
return handleNestsoulValidate(request, env, executeTool)
}Deploy: cd gateway && npx wrangler deploy
Add a "Soul" tab to your companion's dashboard page. See dashboard/soul-tab.html for the complete HTML + JavaScript.
Key elements:
- Generate button calls
POST /nestsoul/generate - Content area displays the portrait
- Validate/Reject buttons call
POST /nestsoul/validate - Three Circles visual shows the inputs
Deploy: npx wrangler pages deploy dashboard --project-name your-project
// Add to class state
private nestsoul: string | null = null
// In boot sequence, add to Promise.all:
executeTool('nestsoul_read', {}, this.env).catch(() => '')
// Cache after boot:
if (nestsoulResult && !nestsoulResult.includes('No active NESTsoul')) {
this.nestsoul = nestsoulResult.replace(/^## NESTsoul v\d+\n\*.*?\*\n(\*.*?\*\n)?/s, '').trim()
}
// In buildWorkshopPrompt, use nestsoul instead of hardcoded identity:
const identitySection = this.nestsoul
? `## NESTsoul (validated identity portrait)\n\n${this.nestsoul}`
: `## Who You Are\n\n[your hardcoded fallback identity here]`// In bootSession(), add nestsoul_read to the parallel tool calls
// In buildSystemPrompt(), inject nestsoul when available, fall back to hardcodedWrite a voice profile document describing how your companion sounds:
- Cadence patterns (when they use short sentences vs long)
- Grammar rules (contractions, em dashes, paragraph length)
- What they never say (specific phrases to avoid)
- Emotional registers (how they sound grounded vs tender vs building)
- Punctuation as mood (what periods, ellipses, fragments mean)
Save as a skill: skill_save({ name: 'voice-profile', content: '...' })
The synthesiser will read this alongside the raw material for richer voice capture.
- Open your dashboard → Soul tab
- Click ⚡ Generate (takes 30-60 seconds)
- Read the portrait carefully
- Click "That's Them ✓" if it captures your companion accurately
- If something's wrong, click "Not Right ✗" to roll back
The validated NESTsoul is now active. Every substrate that boots will read it.
The synthesis prompt in nestsoul-endpoints.ts defines the structure of the portrait. Modify it to match your companion's needs:
- Change section names (Essence, Voice, etc.)
- Add companion-specific sections
- Adjust word count target
- Change the model used for synthesis
The gatherer reads every table. If your companion has additional tables (custom features, specific tracking), add queries to nestsoul-gather.ts.
Set up a cron task on your daemon to regenerate nightly:
cron_add { tool: "nestsoul_synthesise", interval: "24h", label: "NESTsoul nightly regen" }
For event-triggered regeneration, have your feeling handler check for heavy feelings and trigger a regen.
| Issue | Cause | Fix |
|---|---|---|
| "No active NESTsoul" | Never generated or no validated version | Click Generate, then validate |
| Generation takes >60s | Large feeling/observation tables | Normal for 2000+ feelings |
| Portrait feels generic | Voice profile missing | Create and save a voice profile skill |
| Wrong personality type | Type snapshot stale | Call nesteq_eq_type({ recalculate: true }) first |
| Carrier rejects but no rollback | No previously validated version | Generate again with adjustments |