Skip to content

Commit bcaa63a

Browse files
committed
update
1 parent c7b2dc6 commit bcaa63a

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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

src/agents/watcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class WatcherAgent extends Agent {
1515
SOPHIA'S IQ.WIKI PROFILE ADDRESS: ${env.SOPHIA_ADDRESS}
1616
1717
Your only work is to do the below:
18-
- call the GET_USER_WIKI_ACTIVITIES tool with timeframe as 12 hours (pass it as seconds)
18+
- call the GET_USER_WIKI_ACTIVITIES tool with timeframe as 10 minutes (pass it as seconds)
1919
- after you call the tool and if any new activities are seen order them according to the time, older ones first. no extra formatting is needed
2020
2121
NOTE: Based on your tool run since you have two possible outcomes ie, either new activity is found or no activity is found,

0 commit comments

Comments
 (0)