VoidBot is a Discord-native assistant for GameCult.
It can answer from archived Discord history, indexed GameCult repos, and Aetheria lore, then hand deeper work off to Codex when Discord stops being a sane place to do it. The current build already supports real Discord replies, semantic retrieval, source and lore indexing, and Codex handoff flows.
VoidBot's Verse contract is documented in `docs/architecture/voidbot-verse-service-contract.md`: durable agent/service state should be typed CultCache `.cc` or have a `.cc` witness/export, meaningful operator presentation goes through Eve/CultUI DSL published through CultMesh, Odin discovers provider-owned surfaces, and Huginn owns Persona/.cc runtime inspection stewardship. Local browser output is only a lowering, not dashboard authority.
The durable local state is split on purpose: Postgres holds jobs, audit events, and interaction memory, while `.voidbot/` keeps artifacts, archives, logs, and detached indexing status.
There is also a project-memory spine now for future Codex sessions: `state/map.yaml`, `state/scratch.md`, `state/evidence.jsonl`, `notes/fresh-workspace-handoff.md`, and the helper CLIs under `tools/`. The point is to rehydrate from canonical files instead of pretending the transcript will stay coherent forever.
Yggdrasil `voidbot.service` publishes the current swarm Eve/CultUI surface through CultMesh as `cultmesh://voidbot.local/eve/providers/voidbot.swarm`, backed by `.voidbot/status/cultmesh/voidbot-swarm-state.cc`. Odin discovers it, Gjallar embeds it in `gjallar.overview`, and Hermodr/EveCanvas lower that aggregate for graphical clients. The generated `swarm-dashboard.html` is a local debug lowering only. The live service does not restore the lost Discord bot, worker, Persona scheduler, Postgres, Qdrant, or resident cognition body; `voidbot-retrieval.service` remains separate.
`LOCAL_LLM_SOCIAL_READ_OLLAMA_MODEL` is optional. Leave it blank to reuse the main local reply model, or set it when you want the room-reading sidecar on a different model than the public/local response lane.
The default shape is simple on purpose: everyone gets the base cooldown and daily cap, listed users or roles can be made unlimited, and listed users or roles can get a boosted lane that cuts cooldowns and multiplies daily allowance by `VOID_USAGE_BOOST_MULTIPLIER` (default `10`).
VoidBot now keeps queue state, audit events, and interaction memory in Postgres. `npm run stack:start` will launch the local Docker Postgres container automatically for the default local DSN, but you can start it yourself if you want the database up first:
```bash
docker compose -f infra/postgres/docker-compose.yml up -d
Qdrant is the recommended vector backend now. It avoids the pain that comes from stuffing everything into local JSON and then acting surprised when the file turns into a small moon.
Windows helper path:
```bash
npm run qdrant:setup
```
Normal day-to-day startup after that:
```bash
npm run qdrant:up
```
Or run Qdrant manually:
```powershell
docker pull qdrant/qdrant
docker volume create voidbot_qdrant_storage
docker run -p 6333:6333 -p 6334:6334 -v voidbot_qdrant_storage:/qdrant/storage qdrant/qdrant
If you do not want a reboot or fresh logon to leave the bot dead on the floor, install the startup task once:
```bash
npm run state:install-startup-task
```
That creates the `VoidBot Stack Startup` scheduled task, which runs `scripts/start-voidbot-stack.ps1` at logon through the same hidden launcher shim the other ops tasks use.
For `owner_codex`, the worker also needs a working local Codex CLI. If plain `codex` is not invokable from Node on your machine, point `CODEX_EXECUTABLE` and `CODEX_EXEC_ARGS` at the actual install. `CODEX_MODEL` pins the owner Discord lane to a specific model; the default is `gpt-5.4` so older local Codex installs do not faceplant on `gpt-5.5`.
-`@Void what did we decide about the website roadmap last year?`
-`@Void summarize prior discussion about ship movement in nautical`
-`/ask provider:local_llm question: where is the MCP server registering search_sources?`
-`/ask provider:local_llm question: what does Aetheria lore say about FTL corporations?`
-`/search-history query: favorite algorithm`
## How The Main Flows Work
### Owner Discord flow
Default mode is `local_exec_owner_only`:
1. The owner uses `@Void ...` or `/ask`.
2. The bot queues an auto-approved owner job.
3. The worker runs `codex exec` in a read-only, Discord-safe lane.
4. Codex can call Void MCP tools such as `search_history`, `get_message_context`, `search_sources`, `get_source_context`, and `list_indexed_repos`.
5. If the answer is short and safe, the worker posts it back to Discord.
6. If the task needs broader tools, file edits, or a deeper investigation, the worker posts a handoff notice and writes a bundle under `.voidbot/artifacts/<job-id>/`.
`/queue-codex` skips the direct-reply attempt and forces the handoff path.
### Manual fallback
`manual_package` still exists when you want the stricter, explicit workflow:
1. Queue a job.
2. Approve it with `/approve-job`.
3. Let the worker write `request.md` and `request.json`.
4. Run the deeper work manually.
5. Approve any final public reply separately.
### Local Ollama flow
The `local_llm` provider uses Ollama chat completion plus a bounded host-managed read-only tool loop. It can use:
Project, repo, and lore questions should lean on the source-side lookup tools when the answer depends on indexed repo or lore facts. The providers now treat source-grounding hints as advisory instead of letting a dumb lexical hall monitor veto the whole reply before the model can think.
- bot-directed prompts stay in the raw archive but are excluded from default semantic history indexing and lexical fallback, so the bot stops poisoning its own memory with repeated summons
Source indexing is incremental when you run it. The pipeline crawls the repo, compares the current documents to the archived source snapshot, deletes vectors for changed or removed source IDs, and upserts only the changed chunks.
Configure:
-`SOURCE_REPO_ROOT`
-`SOURCE_REPO_PATTERNS`
-`SOURCE_REPO_INCLUDE_PREFIXES`
-`RAG_SOURCE_ARCHIVE_PATH`
-`RAG_SOURCE_QUERY_INSTRUCTION`
Index everything that matches your repo patterns:
```bash
npm run rag:index-sources
```
Target specific repos:
```bash
npm run rag:index-sources -- --repo gamecult-site,AetheriaLore
```
Force a clean reindex for specific repos:
```bash
npm run rag:index-sources -- --repo AetheriaLore --force
That keeps `AetheriaLore` focused on the useful subtree instead of indexing every random byproduct in the repo.
### Git push hook for source indexing
If you want local pushes to kick off source reindexing automatically:
```bash
npm run rag:install-push-hooks
```
Git does not provide a client-side `post-push` hook, so VoidBot installs a chained `pre-push` hook instead. That hook returns quickly, launches a detached incremental reindex for the pushed repo, and preserves any existing `pre-push` hook by backing it up to `pre-push.voidbot.prev` and running it first.
VoidBot now also reconciles the repo set automatically:
-`npm run stack:start` runs `npm run rag:reconcile-sources` before the bot and worker come back
-`npm run state:check` compares discovered repos under `SOURCE_REPO_ROOT` to the indexed archive and will launch detached repair work if new repos exist
- the reconcile pass refreshes hooks, indexes newly discovered repos, and prunes stale repo shards for repos that no longer exist under the configured root
The old “install hooks once and hope forever” story is dead. New repos under the configured root should get picked up by normal startup and watchdog operations without manual babysitting.
### Source archive layout
The source archive is no longer one giant `source-documents.json` blob trying to die dramatically at scale.
-`RAG_SOURCE_ARCHIVE_PATH` now stores a small repo-summary manifest
- per-repo source documents live under the sibling shard directory `source-documents.repos/`
That keeps incremental repo writes bounded to the repo that actually changed instead of rewriting the whole corpus every time one new project appears.
The backup and restore scripts stop the local bot/worker first and restart them afterward if they were already running. Because the local Qdrant node is shared, the backup path snapshots every collection on that node, not just the two VoidBot ones.
- compresses the resulting backup directory into a zip archive
- uploads it over `sftp`
- keeps a bounded number of scheduled local backup directories
- prunes older remote zip archives after upload
- writes status to `.voidbot/status/offsite-backup.json`
- appends logs to `.voidbot/logs/offsite-backup.log`
Install the daily scheduled task:
```bash
npm run state:install-offsite-task
```
Defaults come from `.env` / `.env.example`:
-`OFFSITE_BACKUP_SSH_TARGET`
-`OFFSITE_BACKUP_REMOTE_WINDOWS_DIR`
-`OFFSITE_BACKUP_REMOTE_SFTP_DIR`
-`OFFSITE_BACKUP_LOCAL_KEEP_LATEST`
-`OFFSITE_BACKUP_REMOTE_KEEP_LATEST`
-`OFFSITE_BACKUP_LABEL`
-`OFFSITE_BACKUP_TASK_NAME`
-`OFFSITE_BACKUP_TASK_TIME`
The scheduled task uses `Interactive` logon on Windows so it can see the current user's SSH key material. That means the backup job is intended for a workstation session that stays logged in; it is not pretending to be a hardened headless backup appliance.
If you want an actual local dashboard instead of spelunking JSON by candlelight:
```bash
npm run state:dashboard
```
That renders `.voidbot/status/operations-dashboard.html`, opens it in your default browser, and auto-refreshes every 10 seconds. The watchdog now also writes a live run-state file while it is executing, so a hidden task that wedges should stay visibly stuck on its last known step instead of failing in perfect silence.
Void's moderation, person-shaped rumination, physiology, memory maintenance, and candidate-delivery organs remain source capabilities, but they are not part of the current Yggdrasil `voidbot.service` publisher body.
The moderation heartbeat, person-shaped rumination, physiology, memory maintenance, and candidate-delivery organs are not currently deployed on Yggdrasil. Do not revive local scheduled-task copies or infer their lifecycle from the swarm publisher.
Chronological Discord evidence is acquired by the daemon's bounded evidence source. Semantic retrieval remains available for deeper context, but it does not own the heartbeat clock or cursor.
Agent access to recovered Discord history and indexed sources belongs to the separate read-only retrieval service. The source tree still contains the worker-side streamable-HTTP MCP design and its bridge smoke, but no resident VoidBot worker currently owns `127.0.0.1:17875/mcp` on Yggdrasil.
npm run moderation:recent-repo-activity -- --hours 96 --max-commits 3
```
That gives the loop a compact digest of recent commit motion across every tracked source repo, so Void can notice the broader experiment zoo instead of only sniffing whatever one thread happened to say out loud.
The moderator state is now typed CultCache state, not an editable Ghostlight-shaped JSON projection. The typed documents own profile, moderation cursor/open cases, speech receipts, thought memory/incubation, scheduled runtime, and candidate interventions. The old JSON projection, state template, and context exporter are gone.
The typed rumination runner can still think about GameCult projects, archived Discord seams, indexed repos, recent cross-repo commit motion, and lore, but durable changes must come back as typed operation payloads. The child does not edit state.
Resident physiology owns sleep transitions and emits a typed maintenance intent. The memory-maintenance organ pre-receipts one attempt per nap, runs one bounded tool-free model call when pressure exists, validates the complete operation batch, and fails unless short-term residue is consumed. The consolidated resident-organ smoke proves nap intent, operation boundaries, and residue verification without a PowerShell runner.
Long-term memory is durable, not frozen. Sleep can promote short-term residue into durable memory, and later maintenance can explicitly revise, retire, or crystallize durable memories instead of silently overwriting Void's past thoughts. Use `npm run moderation:memory-lifecycle:fixture` to verify promotion, revision, retirement, and crystallization into an identity memory plus self-profile value. The live language is anchors, not courtroom evidence: a thought needs something that made it real, whether that is room context, repo motion, source/lore retrieval, a prior memory, or self-state pressure.
Agency pressure is also typed state now, not hard-wired behavior. `upsert_agency_pressure` records sustained discomfort, active tension, self-advocacy requests, and world-advocacy requests as first-class pressure; candidate interventions may emerge from that pressure, but they are not the pressure itself.
Directly invoked live replies read the same typed private self-state as a distilled self-state attachment. When the sleep projection says Void is napping, the direct reply path skips the expensive room-read sidecar, avoids normal attentive service-work, and answers in brief sleepy grumbles instead.
The moderation loop now speaks through the local bot token instead of approval-gated side-effecting MCP tools, so unattended runs can DM or post without making Codex stop and ask your permission every time it finds a mouthful of words.
VoidBot is now large enough that transcript memory alone is a stupid way to steer it. The repo carries a small canonical project-state scaffold for future sessions:
-`state/map.yaml`: slow-changing canonical project map and current next action
-`state/scratch.md`: disposable one-subgoal working memory
Some commands are full working paths. Some are still thin MVPs. They exist because the structure is real, not because the system is pretending to be finished.