|
| 1 | +# Sophia Agent |
| 2 | + |
| 3 | +Sophia Agent is an autonomous workflow agent that monitors, logs, and notifies about wiki activities on [iq.wiki](https://iq.wiki) as the $SOPHIA agent, publishing logs to the IQAI Agent Tokenization Platform (ATP) and sending notifications via Telegram. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Watches** for new wiki creations or edits by Sophia on iq.wiki |
| 8 | +- **Logs** activities to the $SOPHIA agent on IQAI ATP |
| 9 | +- **Notifies** a Telegram channel about new activities |
| 10 | +- **Scheduled** to run at configurable intervals (via cron) |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +### Prerequisites |
| 15 | + |
| 16 | +- Node.js v18+ |
| 17 | +- pnpm (recommended) or npm/yarn |
| 18 | + |
| 19 | +### Installation |
| 20 | + |
| 21 | +```bash |
| 22 | +pnpm install |
| 23 | +``` |
| 24 | + |
| 25 | +### Environment Variables |
| 26 | + |
| 27 | +Copy the example environment file and fill in your credentials: |
| 28 | + |
| 29 | +```bash |
| 30 | +cp example.env .env |
| 31 | +``` |
| 32 | + |
| 33 | +**Required variables:** |
| 34 | + |
| 35 | +- `ATP_API_KEY` — API key for IQAI ATP |
| 36 | +- `IQ_ADDRESS` — IQ token address (default provided) |
| 37 | +- `LLM_MODEL` — LLM model name (default: gemini-2.0-flash) |
| 38 | +- `TELEGRAM_CHAT_ID` — Telegram chat ID for notifications |
| 39 | +- `TELEGRAM_BOT_TOKEN` — Telegram bot token |
| 40 | +- `TELEGRAM_SERVER_KEY` — Telegram MCP server key |
| 41 | +- `TELEGRAM_PROFILE_ID` — Telegram MCP profile ID |
| 42 | +- `SOPHIA_ADDRESS` — Sophia's iq.wiki profile address (default provided) |
| 43 | +- `SOPHIA_TOKEN_ADDRESS` — Sophia's Token address on ATP (default provided) |
| 44 | +- `CRON_SCHEDULE` — Cron schedule for agent runs (default: every 10 minutes) |
| 45 | + |
| 46 | +### Build |
| 47 | + |
| 48 | +```bash |
| 49 | +pnpm run build |
| 50 | +``` |
| 51 | + |
| 52 | +### Development |
| 53 | + |
| 54 | +```bash |
| 55 | +pnpm run dev |
| 56 | +``` |
| 57 | + |
| 58 | +### Production |
| 59 | + |
| 60 | +```bash |
| 61 | +pnpm run start |
| 62 | +``` |
| 63 | + |
| 64 | +## Usage |
| 65 | + |
| 66 | +- The agent will start, initialize all toolsets, and run immediately, then on the configured schedule. |
| 67 | +- Logs and notifications are output to the console and sent to the configured Telegram channel. |
| 68 | +- Graceful shutdown is supported (SIGINT/SIGTERM). |
| 69 | + |
| 70 | +## Project Structure |
| 71 | + |
| 72 | +- `src/agents/` — Agent definitions (Watcher, Logger, Notifier, SophiaAgent) |
| 73 | +- `src/utils/` — Utility functions (MCP config, etc.) |
| 74 | +- `src/runner.ts` — Toolset lifecycle, scheduling, and shutdown logic |
| 75 | +- `src/index.ts` — Entry point |
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +MIT |
0 commit comments