How akazdayo/aikyo-discord works
Project Type and Purpose
• This is a lightweight Node.js/TypeScript “Aikyo Companion” template: a small framework that boots multiple conversational AI agents (companions) and wires them together via a Firehose WebSocket server and libp2p for peer-to-peer communication. It serves as a starter kit for launching and orchestrating AI personas (e.g. “kyoko” and “aya”), connecting them to the Anthropic API, and streaming messages to clients.
File Structure Analysis
• Top level
• src/index.ts: main entrypoint, starts companion loops + Firehose server
• src/cards/: persona definitions (prompts, tools, seeded history)
• src/tools/: plugin directory for Aikyo Tools (e.g. knowledge or action modules)
• src/utils/: runtime helpers
– companion.ts: companion loop orchestration
– discordClient.ts: (optional) Discord integration factory
– firehose.ts: Firehose WebSocket server factory
– types/: shared Zod schemas for companion, firehose, Discord, etc.
• Config & Dev
• .env.example / .env: API keys (Anthropic) and other environment variables
• package.json / pnpm-lock.yaml: dependencies & scripts (dev, dev:debug)
• example_request.json: sample client payload for testing via websocat
Key README Insights
• Boot process: “pnpm run dev” → tsx src/index.ts
• By default, it instantiates two agents and listens on WS port 8080
• Supports verbose libp2p logs with DEBUG=libp2p:*
• Encourages adding custom Tools under src/tools/