samarthya-bot 1.1.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +274 -96
- package/backend/.env.example +31 -7
- package/backend/bin/samarthya.js +114 -25
- package/backend/package-lock.json +47 -25
- package/backend/package.json +4 -3
- package/backend/public/assets/index-BFRAq8Y1.js +149 -0
- package/backend/public/assets/index-DdCKkq38.js +149 -0
- package/backend/public/assets/index-kzffNwzo.js +149 -0
- package/backend/public/index.html +1 -1
- package/backend/server.js +70 -22
- package/backend/server.log +29 -0
- package/backend/services/agent/spawnService.js +140 -0
- package/backend/services/discord/discordService.js +188 -0
- package/backend/services/heartbeat/heartbeatService.js +157 -0
- package/backend/services/llm/llmService.js +118 -1
- package/backend/services/security/sandboxService.js +115 -0
- package/backend/services/voice/voiceService.js +151 -0
- package/package.json +2 -2
- package/server.log +35 -0
package/README.md
CHANGED
|
@@ -1,181 +1,359 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/mebishnusahu0595/SamarthyaBot/main/backend/public/logo.png" width="
|
|
3
|
-
<h1>स SamarthyaBot — Your Local Agentic OS</h1>
|
|
4
|
-
|
|
5
|
-
<p>
|
|
6
|
-
<strong>Privacy-First • Multi-Agent • Autonomous • Made in India</strong>
|
|
7
|
-
</p>
|
|
2
|
+
<img src="https://raw.githubusercontent.com/mebishnusahu0595/SamarthyaBot/main/backend/public/logo.png" width="180" height="180" alt="SamarthyaBot Logo">
|
|
8
3
|
|
|
9
|
-
<
|
|
10
|
-
<a href="https://www.npmjs.com/package/samarthya-bot"><img src="https://img.shields.io/npm/v/samarthya-bot?color=FB8C00&style=for-the-badge" alt="NPM Version" /></a>
|
|
11
|
-
<a href="https://github.com/mebishnusahu0595/SamarthyaBot"><img src="https://img.shields.io/github/stars/mebishnusahu0595/SamarthyaBot?style=for-the-badge&color=FFD600" alt="GitHub Stars" /></a>
|
|
12
|
-
<img src="https://img.shields.io/npm/l/samarthya-bot?style=for-the-badge&color=2196F3" alt="License" />
|
|
13
|
-
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge" alt="PRs Welcome" />
|
|
14
|
-
</p>
|
|
4
|
+
<h1>🇮🇳 SamarthyaBot — Your Local Agentic OS</h1>
|
|
15
5
|
|
|
16
|
-
<
|
|
17
|
-
SamarthyaBot is a personal AI assistant you run on your own devices. It answers you on the channels you already use (WhatsApp, Telegram), handles absolute local privacy, and executes multi-step autonomous plans. The Gateway is your control plane — the product is the assistant.
|
|
18
|
-
</p>
|
|
6
|
+
<h3>Privacy-First · Multi-Agent · Autonomous · Made in India 🇮🇳</h3>
|
|
19
7
|
|
|
20
8
|
<p>
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
9
|
+
<img src="https://img.shields.io/badge/Node.js-20_LTS-339933?style=flat&logo=nodedotjs&logoColor=white" alt="Node.js">
|
|
10
|
+
<img src="https://img.shields.io/badge/Go-1.22+-00ADD8?style=flat&logo=go&logoColor=white" alt="Go Worker">
|
|
11
|
+
<img src="https://img.shields.io/badge/React-19-61DAFB?style=flat&logo=react&logoColor=black" alt="React">
|
|
12
|
+
<img src="https://img.shields.io/badge/MongoDB-Local-47A248?style=flat&logo=mongodb&logoColor=white" alt="MongoDB">
|
|
13
|
+
<img src="https://img.shields.io/badge/license-MIT-138808?style=flat" alt="License">
|
|
14
|
+
<br>
|
|
15
|
+
<a href="https://www.npmjs.com/package/samarthya-bot"><img src="https://img.shields.io/npm/v/samarthya-bot?color=FF9933&style=flat&logo=npm&logoColor=white&label=npm" alt="NPM"></a>
|
|
16
|
+
<a href="https://github.com/mebishnusahu0595/SamarthyaBot"><img src="https://img.shields.io/github/stars/mebishnusahu0595/SamarthyaBot?style=flat&color=FFD600&logo=github" alt="Stars"></a>
|
|
17
|
+
<img src="https://img.shields.io/badge/PRs-welcome-FF9933?style=flat" alt="PRs Welcome">
|
|
26
18
|
</p>
|
|
27
19
|
</div>
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
🤖 SamarthyaBot is a **privacy-first personal AI Operating System** that runs entirely on YOUR devices. It's not just a chatbot — it's a **Full RPA (Robotic Process Automation) Agent** that writes code, commits to GitHub, deploys to servers, controls browsers, sends real emails, and handles Indian workflows (GST, UPI, IRCTC) — all from a single Telegram message or a beautiful Web Dashboard.
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
⚡ Powered by a **Go Micro-Worker** for live terminal streaming, **Puppeteer** for real browser control, and multi-provider AI (Gemini, Claude, Ollama, DeepSeek, OpenRouter) — SamarthyaBot is the most feature-rich self-hosted AI agent built for Indian developers.
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
> [!CAUTION]
|
|
28
|
+
> **🚨 SECURITY NOTICE**
|
|
29
|
+
>
|
|
30
|
+
> * SamarthyaBot runs **locally on YOUR machine**. Your data never leaves your device.
|
|
31
|
+
> * All sensitive data (API keys, memories) is encrypted via **AES-256-CBC**.
|
|
32
|
+
> * Dangerous commands (`rm -rf`, `mkfs`, `format`) are **blocked by regex blacklists**.
|
|
33
|
+
> * SamarthyaBot is in active development — use with caution in production.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## ✨ Features
|
|
38
|
+
|
|
39
|
+
| Feature | Description | Status |
|
|
40
|
+
| :--- | :--- | :---: |
|
|
41
|
+
| 🤖 **Full RPA Engine** | Writes code, commits to GitHub, deploys to VPS autonomously | ✅ Live |
|
|
42
|
+
| ⚡ **Go Micro-Worker** | Live terminal streaming — `npm build`, `git push` without freezing Node.js | ✅ Live |
|
|
43
|
+
| 🌍 **SSH Deployments** | Deploy to remote servers via password or PEM key from a chat prompt | ✅ Live |
|
|
44
|
+
| 🕸️ **Browser Controller** | Puppeteer-based real DOM interaction — scrape, click, navigate | ✅ Live |
|
|
45
|
+
| 🛡️ **Zero-Harm Blacklists** | OS regex block-layer protects against dangerous commands | ✅ Live |
|
|
46
|
+
| 🧠 **Autonomous Planner** | ReAct engine breaks complex requests into discrete steps | ✅ Live |
|
|
47
|
+
| 🔐 **Encrypted Memory** | AES-256-CBC encrypted local memory in MongoDB | ✅ Live |
|
|
48
|
+
| 🇮🇳 **Indian Localization** | GST calculator, UPI links, IRCTC, Hindi/Hinglish fluency | ✅ Live |
|
|
49
|
+
| 📧 **Real Email** | Send actual emails via Nodemailer SMTP — not a simulation | ✅ Live |
|
|
50
|
+
| 📁 **File Manager** | Read, write, edit, append, list files in your workspace | ✅ Live |
|
|
51
|
+
| 👁️ **Screen Vision** | Gemini Vision analyzes screenshots for UI/UX understanding | ✅ Live |
|
|
52
|
+
| 📱 **Telegram Bot** | Full two-way Telegram integration with webhook + tunnel | ✅ Live |
|
|
53
|
+
| 🌐 **Web Dashboard** | Beautiful React UI to manage agent, view logs, chat live | ✅ Live |
|
|
54
|
+
| 🔌 **Plugin System** | Drop a `.js` file → new AI skill. Zero restart needed | ✅ Live |
|
|
55
|
+
| 🤖 **Multi-LLM** | Gemini, Claude, DeepSeek, Qwen, OpenRouter, Ollama | ✅ Live |
|
|
56
|
+
| 🎙️ **Voice (Whisper)** | Groq/Whisper transcription for Telegram voice notes | ✅ Live |
|
|
57
|
+
| 💬 **Discord Bot** | Full Discord integration with mention-only mode | ✅ Live |
|
|
58
|
+
| 🔒 **Workspace Sandbox** | File ops restricted to workspace, configurable security | ✅ Live |
|
|
59
|
+
| 💓 **Heartbeat Tasks** | Periodic autonomous tasks from `HEARTBEAT.md` | ✅ Live |
|
|
60
|
+
| 🚀 **Sub-Agent Spawn** | Non-blocking background agents for long-running tasks | ✅ Live |
|
|
61
|
+
|
|
62
|
+
## 🏆 Comparison
|
|
63
|
+
|
|
64
|
+
| | OpenClaw | PicoClaw | **SamarthyaBot** 🇮🇳 |
|
|
65
|
+
| ---------------------- | -------------- | -------------------- | ----------------------------------- |
|
|
66
|
+
| **Language** | TypeScript | Go | **Node.js + Go + React** |
|
|
67
|
+
| **Browser Control** | ❌ None | ❌ Search APIs only | **✅ Real Puppeteer DOM** |
|
|
68
|
+
| **Web Dashboard** | ✅ Yes | ❌ CLI only | **✅ Beautiful React UI** |
|
|
69
|
+
| **Live Terminal** | ❌ No | ❌ Spawn (async) | **✅ Go Worker Streaming** |
|
|
70
|
+
| **Indian Workflows** | ❌ No | ❌ No | **✅ GST/UPI/IRCTC/Hindi** |
|
|
71
|
+
| **Encrypted Memory** | ❌ Plain text | ❌ Markdown files | **✅ AES-256-CBC + MongoDB** |
|
|
72
|
+
| **Voice Transcription**| ❌ No | ✅ Groq Whisper | **✅ Groq Whisper** |
|
|
73
|
+
| **Chat Channels** | 2 | 7 | **Telegram + Discord + Web** |
|
|
74
|
+
| **SSH Deploy** | ❌ No | ❌ No | **✅ Password + PEM Key** |
|
|
75
|
+
| **Plugin System** | ❌ No | Skills folder | **✅ Drop-in JS plugins** |
|
|
76
|
+
| **Startup RAM** | >1GB | <10MB | ~100MB (Full-stack + DB) |
|
|
77
|
+
| **Install Complexity** | High | Single binary | `npm i -g samarthya-bot` ✨ |
|
|
36
78
|
|
|
37
|
-
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 🚀 Quick Start
|
|
82
|
+
|
|
83
|
+
> [!TIP]
|
|
84
|
+
> **Prerequisites:** [Node.js 20 LTS](https://nodejs.org/) · [MongoDB](https://www.mongodb.com/try/download/community) (local)
|
|
85
|
+
> Get API keys: [Gemini](https://aistudio.google.com/api-keys) (Free) · [Ollama](https://ollama.com) (Free, Local)
|
|
86
|
+
> Optional: [Telegram Bot Token](https://t.me/BotFather) · [Groq](https://console.groq.com) (Voice) · [OpenRouter](https://openrouter.ai/keys) (100+ models)
|
|
87
|
+
|
|
88
|
+
### 📦 Install (One Command)
|
|
38
89
|
|
|
39
90
|
```bash
|
|
40
91
|
npm install -g samarthya-bot
|
|
41
92
|
|
|
42
|
-
#
|
|
93
|
+
# Interactive setup wizard
|
|
43
94
|
samarthya onboard
|
|
44
95
|
|
|
45
|
-
# Launch the engine
|
|
96
|
+
# Launch the engine + dashboard (Terminal 1)
|
|
46
97
|
samarthya gateway
|
|
47
98
|
|
|
48
|
-
# Expose to internet &
|
|
99
|
+
# Expose to internet & link Telegram (Terminal 2)
|
|
49
100
|
samarthya tunnel
|
|
50
101
|
```
|
|
51
|
-
*The wizard guides you through API keys (Gemini/Ollama, Telegram Bot Token) and system permissions.*
|
|
52
102
|
|
|
53
|
-
|
|
103
|
+
That's it! 🎉 Open **http://localhost:5000** for the Dashboard.
|
|
54
104
|
|
|
55
|
-
|
|
105
|
+
### 🛠️ From Source (Development)
|
|
56
106
|
|
|
57
107
|
```bash
|
|
58
108
|
git clone https://github.com/mebishnusahu0595/SamarthyaBot.git
|
|
59
109
|
cd SamarthyaBot
|
|
60
110
|
|
|
61
|
-
# Install dependencies
|
|
111
|
+
# Install all dependencies
|
|
62
112
|
npm install
|
|
63
113
|
|
|
64
|
-
#
|
|
114
|
+
# Setup API keys interactively
|
|
65
115
|
samarthya onboard
|
|
66
116
|
|
|
67
|
-
# Start development
|
|
117
|
+
# Start development server
|
|
68
118
|
npm run dev
|
|
69
119
|
```
|
|
70
120
|
|
|
71
121
|
---
|
|
72
122
|
|
|
73
|
-
##
|
|
123
|
+
## 💬 Chat Channels
|
|
74
124
|
|
|
75
|
-
|
|
76
|
-
- � **Control Center UI**: A futuristic dashboard served locally from the gateway. Monitor system vitals, RAM usage, and active agent threads.
|
|
77
|
-
- 🔐 **Encrypted Memory**: Every interaction is stored locally. Sensitive data like API keys are encrypted via **AES-256-CBC** with your custom vault key.
|
|
78
|
-
- 🔌 **Extensible Modules**: Drop any JavaScript plugin into `~/SamarthyaBot_Files/plugins/` and the assistant learns it instantly.
|
|
79
|
-
- 📸 **Visual Intelligence**: Built-in screen understanding for contextual automation.
|
|
80
|
-
- 🇮🇳 **Indian Localization**: Specialized tools for **GST**, **IRCTC**, **UPI** links, and native **Hinglish/Hindi** fluency.
|
|
125
|
+
Talk to SamarthyaBot on your favorite platform:
|
|
81
126
|
|
|
82
|
-
|
|
127
|
+
| Channel | Setup | Status |
|
|
128
|
+
| :--- | :--- | :---: |
|
|
129
|
+
| **Telegram** | Easy — just a bot token + `samarthya tunnel` | ✅ Live |
|
|
130
|
+
| **Discord** | Bot token + intents + invite URL | ✅ Live |
|
|
131
|
+
| **Web Dashboard** | Built-in at `http://localhost:5000` | ✅ Live |
|
|
132
|
+
| **WhatsApp** | Business API integration | 🔜 Coming |
|
|
133
|
+
| **Slack** | Webhook + App | 📋 Planned |
|
|
83
134
|
|
|
84
|
-
|
|
135
|
+
<details>
|
|
136
|
+
<summary><b>📱 Telegram Setup</b> (Recommended)</summary>
|
|
85
137
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
138
|
+
**1. Create a bot**
|
|
139
|
+
* Open Telegram → search `@BotFather`
|
|
140
|
+
* Send `/newbot`, follow prompts
|
|
141
|
+
* Copy the token
|
|
142
|
+
|
|
143
|
+
**2. Configure** — Add to your `.env`:
|
|
144
|
+
```bash
|
|
145
|
+
TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**3. Run**
|
|
149
|
+
```bash
|
|
150
|
+
# Terminal 1
|
|
151
|
+
samarthya gateway
|
|
152
|
+
|
|
153
|
+
# Terminal 2 (new terminal!)
|
|
154
|
+
samarthya tunnel
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The tunnel automatically sets the webhook URL. You're live! 🚀
|
|
158
|
+
|
|
159
|
+
</details>
|
|
160
|
+
|
|
161
|
+
<details>
|
|
162
|
+
<summary><b>💬 Discord Setup</b></summary>
|
|
163
|
+
|
|
164
|
+
**1. Create a bot**
|
|
165
|
+
* Go to https://discord.com/developers/applications
|
|
166
|
+
* Create Application → Bot → Copy Token
|
|
167
|
+
|
|
168
|
+
**2. Enable Intents** — In Bot settings:
|
|
169
|
+
* ✅ MESSAGE CONTENT INTENT
|
|
170
|
+
* ✅ SERVER MEMBERS INTENT (optional)
|
|
171
|
+
|
|
172
|
+
**3. Configure** — Add to your `.env`:
|
|
173
|
+
```bash
|
|
174
|
+
DISCORD_BOT_TOKEN=YOUR_BOT_TOKEN
|
|
175
|
+
DISCORD_ALLOW_FROM=YOUR_USER_ID
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**4. Invite the bot**
|
|
179
|
+
* OAuth2 → URL Generator → Scope: `bot`
|
|
180
|
+
* Permissions: `Send Messages`, `Read Message History`
|
|
181
|
+
* Open the generated URL → add to your server
|
|
182
|
+
|
|
183
|
+
**5. Run**
|
|
184
|
+
```bash
|
|
185
|
+
samarthya gateway
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</details>
|
|
94
189
|
|
|
95
190
|
---
|
|
96
191
|
|
|
97
|
-
## ⚙️
|
|
192
|
+
## ⚙️ Configuration
|
|
98
193
|
|
|
99
|
-
|
|
194
|
+
All configuration is in `backend/.env`:
|
|
100
195
|
|
|
101
196
|
```bash
|
|
102
|
-
#
|
|
103
|
-
GEMINI_API_KEY=
|
|
197
|
+
# ═══════════════ REQUIRED ═══════════════
|
|
198
|
+
GEMINI_API_KEY=your_gemini_api_key
|
|
104
199
|
MEMORY_ENCRYPTION_KEY=your_32_char_secret_key
|
|
105
200
|
|
|
106
|
-
#
|
|
107
|
-
|
|
201
|
+
# ═══════════════ AI PROVIDERS ═══════════════
|
|
202
|
+
ACTIVE_PROVIDER=gemini # gemini | ollama | anthropic | deepseek | openrouter | qwen
|
|
203
|
+
ACTIVE_MODEL=gemini-2.5-flash
|
|
108
204
|
|
|
109
|
-
#
|
|
205
|
+
# Provider API Keys (set the one you use)
|
|
206
|
+
ANTHROPIC_API_KEY=
|
|
207
|
+
DEEPSEEK_API_KEY=
|
|
208
|
+
OPENROUTER_API_KEY=
|
|
209
|
+
QWEN_API_KEY=
|
|
210
|
+
|
|
211
|
+
# Ollama (local, free, offline)
|
|
212
|
+
USE_OLLAMA=false
|
|
213
|
+
|
|
214
|
+
# ═══════════════ CHANNELS ═══════════════
|
|
215
|
+
TELEGRAM_BOT_TOKEN=your_telegram_token
|
|
216
|
+
DISCORD_BOT_TOKEN=your_discord_token
|
|
217
|
+
|
|
218
|
+
# ═══════════════ VOICE ═══════════════
|
|
219
|
+
GROQ_API_KEY=your_groq_key # For Whisper voice transcription
|
|
220
|
+
|
|
221
|
+
# ═══════════════ SECURITY ═══════════════
|
|
222
|
+
RESTRICT_TO_WORKSPACE=true # Sandbox all file/exec operations
|
|
223
|
+
HEARTBEAT_INTERVAL=30 # Minutes between periodic tasks
|
|
224
|
+
|
|
225
|
+
# ═══════════════ DATABASE ═══════════════
|
|
110
226
|
MONGO_URI=mongodb://localhost:27017/samarthya
|
|
111
227
|
PORT=5000
|
|
112
|
-
USE_OLLAMA=false
|
|
113
|
-
ACTIVE_PROVIDER=gemini # or ollama
|
|
114
228
|
```
|
|
115
229
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## 🛠️ CLI Commands
|
|
233
|
+
|
|
234
|
+
| Command | Action |
|
|
235
|
+
| :--- | :--- |
|
|
236
|
+
| `samarthya onboard` | Interactive setup wizard — API keys, permissions, everything |
|
|
237
|
+
| `samarthya gateway` | Start the backend engine + serve the Dashboard |
|
|
238
|
+
| `samarthya tunnel` | Expose to internet & auto-link Telegram webhook |
|
|
239
|
+
| `samarthya status` | Show status of background jobs and the engine |
|
|
240
|
+
| `samarthya stop` | Gracefully kill all autonomous background agents |
|
|
241
|
+
| `samarthya model` | Swap LLM provider (gemini, ollama, claude, deepseek...) |
|
|
123
242
|
|
|
124
243
|
---
|
|
125
244
|
|
|
126
245
|
## 🔌 Developing Plugins
|
|
127
246
|
|
|
128
|
-
|
|
247
|
+
Give your AI new superpowers — just drop a `.js` file:
|
|
129
248
|
|
|
130
249
|
```javascript
|
|
131
|
-
// ~/SamarthyaBot_Files/plugins/
|
|
250
|
+
// ~/SamarthyaBot_Files/plugins/weather.js
|
|
132
251
|
module.exports = {
|
|
133
|
-
name: '
|
|
134
|
-
description: '
|
|
252
|
+
name: 'get_weather',
|
|
253
|
+
description: 'Gets current weather for a city',
|
|
135
254
|
parameters: {
|
|
136
|
-
|
|
255
|
+
city: { type: 'string', required: true }
|
|
137
256
|
},
|
|
138
257
|
execute: async (args) => {
|
|
139
|
-
|
|
258
|
+
const res = await fetch(`https://wttr.in/${args.city}?format=j1`);
|
|
259
|
+
const data = await res.json();
|
|
260
|
+
return {
|
|
261
|
+
success: true,
|
|
262
|
+
result: `${args.city}: ${data.current_condition[0].temp_C}°C, ${data.current_condition[0].weatherDesc[0].value}`
|
|
263
|
+
};
|
|
140
264
|
}
|
|
141
265
|
};
|
|
142
266
|
```
|
|
143
|
-
|
|
267
|
+
|
|
268
|
+
Restart the gateway — the agent can now check weather autonomously! 🌦️
|
|
144
269
|
|
|
145
270
|
---
|
|
146
271
|
|
|
147
|
-
##
|
|
272
|
+
## 💓 Heartbeat (Periodic Tasks)
|
|
273
|
+
|
|
274
|
+
Create `~/SamarthyaBot_Files/HEARTBEAT.md` to schedule autonomous tasks:
|
|
275
|
+
|
|
276
|
+
```markdown
|
|
277
|
+
# Periodic Tasks
|
|
278
|
+
|
|
279
|
+
- Check my email for important messages
|
|
280
|
+
- Search web for latest AI news and summarize
|
|
281
|
+
- Remind me about today's calendar events
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
SamarthyaBot reads this file every 30 minutes (configurable) and executes each task using available tools. Results are sent via your active channel (Telegram/Discord/Dashboard).
|
|
148
285
|
|
|
149
|
-
|
|
286
|
+
---
|
|
150
287
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
288
|
+
## 🔒 Security & Privacy
|
|
289
|
+
|
|
290
|
+
| Feature | Description |
|
|
291
|
+
| :--- | :--- |
|
|
292
|
+
| **🏠 Local Control Plane** | Gateway runs on YOUR machine — zero cloud dependency |
|
|
293
|
+
| **🔐 AES-256-CBC Encryption** | All memories and API keys encrypted at rest |
|
|
294
|
+
| **🛡️ Command Blacklists** | `rm -rf`, `mkfs`, `format`, `dd if=` — all blocked |
|
|
295
|
+
| **📁 Workspace Sandbox** | File/exec operations restricted to workspace folder |
|
|
296
|
+
| **🔌 Ollama Offline Mode** | 100% offline AI — zero data leakage |
|
|
297
|
+
| **🚨 Emergency Kill Switch** | `samarthya stop` — instant shutdown from CLI or Dashboard |
|
|
155
298
|
|
|
156
299
|
---
|
|
157
300
|
|
|
158
301
|
## 🏗️ Architecture
|
|
159
302
|
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
│
|
|
166
|
-
│
|
|
167
|
-
│
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
303
|
+
```
|
|
304
|
+
Telegram / Discord / WebUI / CLI
|
|
305
|
+
│
|
|
306
|
+
▼
|
|
307
|
+
┌──────────────────────────────────────────┐
|
|
308
|
+
│ SamarthyaBot Gateway │
|
|
309
|
+
│ (The Control Plane) │
|
|
310
|
+
│ http://localhost:5000 │
|
|
311
|
+
├──────────────────────────────────────────┤
|
|
312
|
+
│ │
|
|
313
|
+
│ ┌─────────┐ ┌──────────┐ ┌────────┐ │
|
|
314
|
+
│ │ Planner │ │ LLM Hub │ │ Tools │ │
|
|
315
|
+
│ │ (ReAct) │ │ (Multi) │ │ Engine │ │
|
|
316
|
+
│ └────┬────┘ └────┬─────┘ └───┬────┘ │
|
|
317
|
+
│ │ │ │ │
|
|
318
|
+
│ ┌────┴────────────┴─────────────┴────┐ │
|
|
319
|
+
│ │ Go Micro-Worker │ │
|
|
320
|
+
│ │ (Live Terminal Streaming) │ │
|
|
321
|
+
│ └───────────────────────────────────┘ │
|
|
322
|
+
│ │
|
|
323
|
+
│ ┌─────────┐ ┌──────────┐ ┌────────┐ │
|
|
324
|
+
│ │ Memory │ │ Browser │ │ Cron / │ │
|
|
325
|
+
│ │ (AES) │ │(Puppeteer│ │Hearbeat│ │
|
|
326
|
+
│ └─────────┘ └──────────┘ └────────┘ │
|
|
327
|
+
│ │
|
|
328
|
+
└──────────────────────────────────────────┘
|
|
329
|
+
│
|
|
330
|
+
▼
|
|
331
|
+
MongoDB (Local, Encrypted)
|
|
174
332
|
```
|
|
175
333
|
|
|
176
334
|
---
|
|
177
335
|
|
|
336
|
+
## 🗺️ Roadmap
|
|
337
|
+
|
|
338
|
+
- [x] Full RPA Engine (Code → Commit → Deploy)
|
|
339
|
+
- [x] Go Micro-Worker (Live Terminal Streaming)
|
|
340
|
+
- [x] Puppeteer Browser DOM Controller
|
|
341
|
+
- [x] Telegram Integration + Auto Tunnel
|
|
342
|
+
- [x] Multi-Provider LLM (Gemini, Claude, DeepSeek, Qwen, OpenRouter, Ollama)
|
|
343
|
+
- [x] Discord Bot Integration
|
|
344
|
+
- [x] Groq/Whisper Voice Transcription
|
|
345
|
+
- [x] Workspace Security Sandbox
|
|
346
|
+
- [x] Heartbeat Periodic Tasks
|
|
347
|
+
- [x] Sub-Agent Spawn (Background Workers)
|
|
348
|
+
- [ ] WhatsApp Business API
|
|
349
|
+
- [ ] Slack Integration
|
|
350
|
+
- [ ] Docker Compose deployment
|
|
351
|
+
- [ ] Mobile companion app
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
178
355
|
## 📄 License
|
|
179
|
-
MIT License • Built with ❤️ in India by **Bishnu Sahu**
|
|
180
356
|
|
|
181
|
-
|
|
357
|
+
**MIT License** — Built with ❤️ in India 🇮🇳 by **Bishnu Sahu**
|
|
358
|
+
|
|
359
|
+
[GitHub](https://github.com/mebishnusahu0595) · [NPM](https://www.npmjs.com/package/samarthya-bot)
|
package/backend/.env.example
CHANGED
|
@@ -5,19 +5,43 @@ PORT=5000
|
|
|
5
5
|
# Security (Required for Encrypted Vault)
|
|
6
6
|
MEMORY_ENCRYPTION_KEY=generate_a_random_32_character_string_here
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
|
|
8
|
+
# ═══════════════ AI PROVIDER SELECTION ═══════════════
|
|
9
|
+
# Supported: gemini | ollama | anthropic | deepseek | qwen | openrouter | groq | openai | mistral
|
|
10
|
+
ACTIVE_PROVIDER=gemini
|
|
11
|
+
ACTIVE_MODEL=gemini-2.5-flash
|
|
11
12
|
|
|
12
|
-
#
|
|
13
|
+
# ═══════════════ PROVIDER API KEYS ═══════════════
|
|
14
|
+
# Set the key for whichever provider you use
|
|
15
|
+
ANTHROPIC_API_KEY=your_anthropic_api_key
|
|
16
|
+
DEEPSEEK_API_KEY=your_deepseek_api_key
|
|
17
|
+
OPENROUTER_API_KEY=your_openrouter_api_key
|
|
18
|
+
QWEN_API_KEY=your_qwen_api_key
|
|
19
|
+
GROQ_API_KEY=your_groq_api_key
|
|
20
|
+
|
|
21
|
+
# Ollama (local, free, offline — no API key needed)
|
|
13
22
|
USE_OLLAMA=false
|
|
14
23
|
OLLAMA_URL=http://localhost:11434
|
|
15
24
|
OLLAMA_MODEL=llama3.2
|
|
16
|
-
ACTIVE_PROVIDER=gemini
|
|
17
|
-
ACTIVE_MODEL=gemini-2.5-flash-lite
|
|
18
25
|
|
|
19
|
-
#
|
|
26
|
+
# ═══════════════ CHANNELS ═══════════════
|
|
27
|
+
# Telegram
|
|
20
28
|
TELEGRAM_BOT_TOKEN=your_telegram_bot_api_key
|
|
21
29
|
|
|
30
|
+
# Discord
|
|
31
|
+
DISCORD_BOT_TOKEN=your_discord_bot_token
|
|
32
|
+
DISCORD_ALLOW_FROM=your_discord_user_id
|
|
33
|
+
|
|
34
|
+
# ═══════════════ VOICE TRANSCRIPTION ═══════════════
|
|
35
|
+
# Groq Whisper — for Telegram voice note transcription
|
|
36
|
+
# GROQ_API_KEY already set above — same key works for both LLM and Whisper
|
|
37
|
+
|
|
38
|
+
# ═══════════════ SECURITY ═══════════════
|
|
39
|
+
RESTRICT_TO_WORKSPACE=true
|
|
40
|
+
HEARTBEAT_INTERVAL=30
|
|
41
|
+
|
|
42
|
+
# ═══════════════ EMAIL (Optional) ═══════════════
|
|
43
|
+
# SMTP_EMAIL=your_email@gmail.com
|
|
44
|
+
# SMTP_PASSWORD=your_16_char_app_password
|
|
45
|
+
|
|
22
46
|
# Node Environment
|
|
23
47
|
NODE_ENV=production
|