How daviddudun/ieka-v2 works
This repository contains a Discord chatbot and a separate user-writing-style profile workflow. In the active bot path, a channel message is queued, combined with per-channel history, sent to the chatbot client, and replied to on Discord. The agent and its research, transport, statistics, finance, and calculation tools exist, but the bot’s agent invocation is commented out. The profile workflow is implemented as separate cleaning, filtering, and style-generation scripts; their staged data handoffs are indicated by the filenames in source, not by a shared orchestrator.
Main entry points: bot.py Bot runtime · agent_tools.py Tool executor · generate_user_prompt.py Style analyzer · agent_client.py Agent client
Components 25
Discord chatbot
- Bot runtime
src/bot.py - Request queue
src/bot.py - Channel history
src/conversation_history.py - Chatbot client
src/chatbot/chatbot_client.py
Agent and tools
- Agent client
src/agent/agent_client.py - Tool parser
src/agent/agent_tools.py - Tool executor
src/agent/agent_tools.py - Web and weather
src/agent/web_scraper.py - TfL client
src/agent/api_clients.py - ONS client
src/agent/api_clients.py - Finance client
src/agent/api_clients.py
Profile workflow
- Chat export
- Chat cleaner
profile_maker/clean_data.py - Cleaned chat data
- User filter
profile_maker/filter_user.py - Filtered messages
- Style analyzer
profile_maker/generate_user_prompt.py - Style description
External services
- Discord
- LLM API
- Web and weather services
- TfL API
- ONS API
- Yahoo Finance
Other components
- Discord user
Connections 27
- Discord user → Discord: sends command
- Discord → Bot runtime: delivers message
- Bot runtime → Request queue: enqueues request
- Bot runtime → Channel history: reads and updates
- Bot runtime → Chatbot client: requests response
- Chatbot client → LLM API: sends prompt
- LLM API → Chatbot client: returns response
- Bot runtime → Discord: replies
- Agent client → LLM API: requests tool choice
- Agent client → Tool parser: parses response
- Agent client → Tool executor: executes tool
- Tool executor → Web and weather: calls web tools
- Tool executor → TfL client: calls transport tools
- Tool executor → ONS client: calls statistics tools
- Tool executor → Finance client: calls finance tools
- Web and weather → Web and weather services: fetches information
- TfL client → TfL API: queries journeys and status
- ONS client → ONS API: searches datasets
- Finance client → Yahoo Finance: queries market data
- Chat export → Chat cleaner: reads export
- Chat cleaner → Cleaned chat data: writes cleaned messages
- Cleaned chat data → User filter: reads cleaned text
- User filter → Filtered messages: writes selected messages
- Filtered messages → Style analyzer: reads and chunks
- Style analyzer → LLM API: requests style analysis
- LLM API → Style analyzer: returns style description
- Style analyzer → Style description: writes description