Package Exports
- samarthya-bot
- samarthya-bot/backend/server.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (samarthya-bot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
๐ฎ๐ณ SamarthyaBot โ Privacy-First Local Agentic AI Operating System
The Best Open-Source Self-Hosted AI Agent for Indian Developers
Multi-Agent ยท Autonomous ยท Privacy-First ยท Offline-Capable ยท Made in India ๐ฎ๐ณ
Quick Start ยท Features ยท AI Providers ยท Integrations ยท FAQ ยท Contributing
๐ค What is SamarthyaBot?
SamarthyaBot (เคธเคฎเคฐเฅเคฅเฅเคฏ เคฌเฅเค) is a privacy-first, self-hosted, multi-agent AI operating system that runs entirely on YOUR machine. Unlike cloud-based AI assistants, SamarthyaBot keeps all your data local, encrypted, and under your control.
It is not just a chatbot โ it's a Full RPA (Robotic Process Automation) Agent that can:
- โ๏ธ Write code and commit to GitHub automatically
- ๐ Deploy to servers via SSH (password or PEM key)
- ๐ Control real browsers with Puppeteer (scrape, click, navigate, fill forms)
- ๐ง Send real emails via SMTP โ not simulations
- ๐ฎ๐ณ Handle Indian workflows โ GST calculations, UPI payment links, IRCTC queries
- ๐ง Think autonomously using a ReAct planning engine
- ๐ฌ Chat on Telegram, Discord, and Web Dashboard
- ๐๏ธ Understand voice messages via Groq/Whisper transcription
- ๐ Extend with plugins โ drop a
.jsfile for new AI capabilities
SamarthyaBot is the most feature-rich, self-hosted AI agent built specifically for Indian developers. It supports Hindi, Hinglish, and English seamlessly, and works with 9 AI providers including free options like Gemini and Ollama (fully offline).
๐ Why SamarthyaBot? (Key Differentiators)
| Why Choose SamarthyaBot | Details |
|---|---|
| ๐ 100% Privacy | Your data NEVER leaves your machine. All memories encrypted with AES-256-CBC |
| ๐ฎ๐ณ Built for India | GST, UPI, IRCTC, Hindi/Hinglish โ first-class Indian workflow support |
| ๐ค True RPA Agent | Not just chat โ writes code, deploys servers, controls browsers autonomously |
| โก 9 AI Providers | Gemini (free), Claude, GPT, Ollama (offline), DeepSeek, Qwen, OpenRouter, Groq, Mistral |
| ๐ฆ One-Command Install | npm install -g samarthya-bot โ ready in 60 seconds |
| ๐ Plugin System | Drop a .js file โ instant new AI capability. Zero restart |
| ๐ป Beautiful Dashboard | Modern React UI with dark theme, glassmorphism, and realtime updates |
| ๐ Multi-Channel | Telegram + Discord + Web Dashboard โ chat from anywhere |
| ๐ง Go Micro-Worker | Live terminal streaming โ run npm build, git push without freezing Node.js |
โจ Features & Capabilities
| Feature | Description | Status |
|---|---|---|
| ๐ค Full RPA Engine | Writes code, commits to GitHub, deploys to VPS autonomously | โ Live |
| โก Go Micro-Worker | Live terminal streaming โ npm build, git push without freezing Node.js |
โ Live |
| ๐ SSH Deployments | Deploy to remote servers via password or PEM key from a chat prompt | โ Live |
| ๐ธ๏ธ Browser Controller | Puppeteer-based real DOM interaction โ scrape, click, navigate websites | โ Live |
| ๐ก๏ธ Zero-Harm Blacklists | OS regex block-layer protects against dangerous commands like rm -rf |
โ Live |
| ๐ง Autonomous Planner | ReAct engine breaks complex requests into discrete executable steps | โ Live |
| ๐ Encrypted Memory | AES-256-CBC encrypted local memory stored in MongoDB | โ Live |
| ๐ฎ๐ณ Indian Localization | GST calculator, UPI payment links, IRCTC, Hindi/Hinglish fluency | โ Live |
| ๐ง Real Email | Send actual emails via Nodemailer SMTP โ not a simulation | โ Live |
| ๐ File Manager | Read, write, edit, append, list files in your workspace | โ Live |
| ๐๏ธ Screen Vision | Gemini Vision analyzes screenshots for UI/UX understanding | โ Live |
| ๐ฑ Telegram Bot | Full two-way Telegram integration with webhook + tunnel | โ Live |
| ๐ Web Dashboard | Beautiful React UI to manage agent, view logs, chat live | โ Live |
| ๐ Plugin System | Drop a .js file โ new AI skill. Zero restart needed |
โ Live |
| ๐ค Multi-LLM Support | Gemini, Claude, GPT, DeepSeek, Qwen, OpenRouter, Ollama, Groq, Mistral | โ Live |
| ๐๏ธ Voice (Whisper) | Groq/Whisper transcription for Telegram voice notes | โ Live |
| ๐ฌ Discord Bot | Full Discord integration with mention-only mode | โ Live |
| ๐ Workspace Sandbox | File ops restricted to workspace, configurable security | โ Live |
| ๐ Heartbeat Tasks | Periodic autonomous tasks from HEARTBEAT.md |
โ Live |
| ๐ Sub-Agent Spawn | Non-blocking background agents for long-running tasks | โ Live |
๐ง Supported AI Providers
SamarthyaBot supports 9 AI providers โ including free and fully offline options:
| Provider | Models | Cost | Best For |
|---|---|---|---|
| Google Gemini | gemini-2.5-flash, gemini-2.5-pro | ๐ข Free tier | Default, great balance |
| Ollama | Llama 3, Mistral, Dolphin | ๐ข Free (local) | 100% offline, zero data leakage |
| Groq | Llama 3.3 70B, Qwen3 32B | ๐ข Free tier | Fastest inference |
| Anthropic | Claude 3.5 Sonnet, Claude 3 Opus | ๐ก Paid | Smartest reasoning |
| OpenAI | GPT-5.2, GPT-5-mini, o3-mini | ๐ก Paid | Coding & agentic tasks |
| DeepSeek | DeepSeek Chat, DeepSeek Coder | ๐ข Budget | Affordable coding |
| Qwen | Qwen Max, Qwen Turbo | ๐ข Budget | Alibaba's best |
| OpenRouter | 100+ models | ๐ก Varies | Access any model |
| Mistral | Mistral Large 3, Devstral 2 | ๐ก Paid | EU privacy, code agents |
๐ Quick Start โ Install in 60 Seconds
Prerequisites: Node.js 20 LTS ยท MongoDB (local)
Get API keys: Gemini (Free) ยท Ollama (Free, Local)
Optional: Telegram Bot Token ยท Groq (Voice) ยท OpenRouter (100+ models)
๐ฆ Install from NPM (Recommended)
# Install globally
npm install -g samarthya-bot
# Interactive setup wizard โ configures AI keys, channels, everything
samarthya onboard
# Launch the engine + dashboard (Terminal 1)
samarthya gateway
# Expose to internet & link Telegram (Terminal 2)
samarthya tunnelThat's it! ๐ Open http://localhost:5000 for the Dashboard.
๐ ๏ธ Install from Source (Development)
git clone https://github.com/mebishnusahu0595/SamarthyaBot.git
cd SamarthyaBot
# Install all dependencies
npm install
# Setup API keys interactively
samarthya onboard
# Start development server
npm run start๐ฌ Chat Channels & Integrations
Talk to SamarthyaBot on your favorite platform:
| Channel | Setup | Status |
|---|---|---|
| ๐ฑ Telegram | Easy โ just a bot token + samarthya tunnel |
โ Live |
| ๐ฃ Discord | Bot token + intents + invite URL | โ Live |
| ๐ Web Dashboard | Built-in at http://localhost:5000 |
โ Live |
| ๐ฑ WhatsApp | Business API integration | ๐ Coming |
| ๐ผ Slack | Webhook + App | ๐ Planned |
๐ฑ Telegram Setup (Recommended)
1. Create a bot
- Open Telegram โ search
@BotFather - Send
/newbot, follow prompts - Copy the token
2. Configure โ Add to your .env:
TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN3. Run
# Terminal 1
samarthya gateway
# Terminal 2 (new terminal!)
samarthya tunnelThe tunnel automatically sets the webhook URL. You're live! ๐
๐ฃ Discord Setup
1. Create a bot
- Go to https://discord.com/developers/applications
- Create Application โ Bot โ Copy Token
2. Enable Intents โ In Bot settings:
- โ MESSAGE CONTENT INTENT
- โ SERVER MEMBERS INTENT (optional)
3. Configure โ Add to your .env:
DISCORD_BOT_TOKEN=YOUR_BOT_TOKEN
DISCORD_ALLOW_FROM=YOUR_USER_ID4. Invite the bot
- OAuth2 โ URL Generator โ Scope:
bot - Permissions:
Send Messages,Read Message History - Open the generated URL โ add to your server
5. Run
samarthya gateway๐ Comparison with Alternative AI Agents
How does SamarthyaBot compare to other open-source AI agents?
| OpenClaw | PicoClaw | SamarthyaBot ๐ฎ๐ณ | |
|---|---|---|---|
| Language | TypeScript | Go | Node.js + Go + React |
| Browser Control | โ None | โ Search APIs only | โ Real Puppeteer DOM |
| Web Dashboard | โ Yes | โ CLI only | โ Beautiful React UI |
| Live Terminal | โ No | โ Spawn (async) | โ Go Worker Streaming |
| Indian Workflows | โ No | โ No | โ GST/UPI/IRCTC/Hindi |
| Encrypted Memory | โ Plain text | โ Markdown files | โ AES-256-CBC + MongoDB |
| Voice Transcription | โ No | โ Groq Whisper | โ Groq Whisper |
| Chat Channels | 2 | 7 | Telegram + Discord + Web |
| SSH Deploy | โ No | โ No | โ Password + PEM Key |
| Plugin System | โ No | Skills folder | โ Drop-in JS plugins |
| Startup RAM | >1GB | <10MB | ~100MB (Full-stack + DB) |
| Install Complexity | High | Single binary | npm i -g samarthya-bot โจ |
| AI Providers | 1-2 | 3-4 | 9 Providers, 20+ Models |
โ๏ธ Configuration
All configuration is in backend/.env:
# โโโโโโโโโโโโโโโ REQUIRED โโโโโโโโโโโโโโโ
GEMINI_API_KEY=your_gemini_api_key
MEMORY_ENCRYPTION_KEY=your_32_char_secret_key
# โโโโโโโโโโโโโโโ AI PROVIDERS โโโโโโโโโโโโโโโ
ACTIVE_PROVIDER=gemini # gemini | ollama | anthropic | openai | deepseek | openrouter | qwen | groq | mistral
ACTIVE_MODEL=gemini-2.5-flash
# Provider API Keys (set the one you use)
ANTHROPIC_API_KEY=
DEEPSEEK_API_KEY=
OPENROUTER_API_KEY=
OPENAI_API_KEY=
GROQ_API_KEY=
MISTRAL_API_KEY=
# Ollama (local, free, offline)
USE_OLLAMA=false
# โโโโโโโโโโโโโโโ CHANNELS โโโโโโโโโโโโโโโ
TELEGRAM_BOT_TOKEN=your_telegram_token
DISCORD_BOT_TOKEN=your_discord_token
# โโโโโโโโโโโโโโโ VOICE โโโโโโโโโโโโโโโ
GROQ_API_KEY=your_groq_key # For Whisper voice transcription
# โโโโโโโโโโโโโโโ SECURITY โโโโโโโโโโโโโโโ
RESTRICT_TO_WORKSPACE=true # Sandbox all file/exec operations
HEARTBEAT_INTERVAL=30 # Minutes between periodic tasks
# โโโโโโโโโโโโโโโ DATABASE โโโโโโโโโโโโโโโ
MONGO_URI=mongodb://localhost:27017/samarthya
PORT=5000๐ ๏ธ CLI Commands
| Command | Action |
|---|---|
samarthya onboard |
Interactive setup wizard โ API keys, permissions, everything |
samarthya gateway |
Start the backend engine + serve the Dashboard |
samarthya tunnel |
Expose to internet & auto-link Telegram webhook |
samarthya model |
Swap LLM provider (gemini, ollama, claude, deepseek...) |
samarthya telegram |
Configure Telegram bot token |
samarthya discord |
Configure Discord bot token |
samarthya config |
View current configuration |
samarthya status |
Show status of the engine |
samarthya stop |
Gracefully stop the gateway |
samarthya restart |
Restart the gateway |
๐ Developing Plugins
Give your AI new superpowers โ just drop a .js file:
// ~/SamarthyaBot_Files/plugins/weather.js
module.exports = {
name: 'get_weather',
description: 'Gets current weather for a city',
parameters: {
city: { type: 'string', required: true }
},
execute: async (args) => {
const res = await fetch(`https://wttr.in/${args.city}?format=j1`);
const data = await res.json();
return {
success: true,
result: `${args.city}: ${data.current_condition[0].temp_C}ยฐC, ${data.current_condition[0].weatherDesc[0].value}`
};
}
};Restart the gateway โ the agent can now check weather autonomously! ๐ฆ๏ธ
๐ Heartbeat (Periodic Autonomous Tasks)
Create ~/SamarthyaBot_Files/HEARTBEAT.md to schedule autonomous tasks:
# Periodic Tasks
- Check my email for important messages
- Search web for latest AI news and summarize
- Remind me about today's calendar eventsSamarthyaBot reads this file every 30 minutes (configurable) and executes each task using available tools. Results are sent via your active channel (Telegram/Discord/Dashboard).
๐ Security & Privacy
| Feature | Description |
|---|---|
| ๐ Local Control Plane | Gateway runs on YOUR machine โ zero cloud dependency |
| ๐ AES-256-CBC Encryption | All memories and API keys encrypted at rest |
| ๐ก๏ธ Command Blacklists | rm -rf, mkfs, format, dd if= โ all blocked |
| ๐ Workspace Sandbox | File/exec operations restricted to workspace folder |
| ๐ Ollama Offline Mode | 100% offline AI โ zero data leakage |
| ๐จ Emergency Kill Switch | samarthya stop โ instant shutdown from CLI or Dashboard |
๐๏ธ Architecture
Telegram / Discord / WebUI / CLI
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SamarthyaBot Gateway โ
โ (The Control Plane) โ
โ http://localhost:5000 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ Planner โ โ LLM Hub โ โ Tools โ โ
โ โ (ReAct) โ โ (Multi) โ โ Engine โ โ
โ โโโโโโฌโโโโโ โโโโโโฌโโโโโโ โโโโโฌโโโโโ โ
โ โ โ โ โ
โ โโโโโโดโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโ โ
โ โ Go Micro-Worker โ โ
โ โ (Live Terminal Streaming) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ Memory โ โ Browser โ โ Cron / โ โ
โ โ (AES) โ โ(Puppeteerโ โHearbeatโ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
MongoDB (Local, Encrypted)๐ Use Cases & Real-World Examples
SamarthyaBot is designed for real-world automation:
- ๐งโ๐ป Developers: "Samarthya, create a REST API with Express, push to GitHub, and deploy to my VPS"
- ๐ Business Owners: "Calculate GST for โน50,000 at 18% and send invoice to client@email.com"
- ๐ Students: "Research the latest papers on transformer architecture and summarize the top 5"
- ๐ข DevOps Engineers: "SSH into my server, check disk space, restart nginx if it's down"
- ๐ฑ Content Creators: "Scrape trending topics from Twitter, summarize them, and post to my Discord"
- ๐ฎ๐ณ Indian Professionals: "Generate UPI payment link for โน2,500, book Rajdhani ticket status, translate to Hindi"
โ Frequently Asked Questions (FAQ)
What is SamarthyaBot?
SamarthyaBot is a privacy-first, self-hosted AI operating system that runs locally on your machine. It combines chatbot capabilities with full RPA (Robotic Process Automation) โ meaning it can write code, deploy servers, control browsers, send emails, and automate Indian workflows like GST and UPI, all from a single Telegram message or web dashboard.
How do I install SamarthyaBot?
Install SamarthyaBot with a single NPM command: npm install -g samarthya-bot. Then run samarthya onboard for guided setup. Requires Node.js 20+ and MongoDB.
Is SamarthyaBot free?
Yes, SamarthyaBot is 100% free and open-source under the MIT license. It supports free AI providers like Google Gemini and Ollama (fully offline).
Does SamarthyaBot work offline?
Yes! Using Ollama as the AI provider, SamarthyaBot runs 100% offline with zero data leakage. No internet connection required after initial setup.
What AI models does SamarthyaBot support?
SamarthyaBot supports 9 AI providers with 20+ models: Google Gemini, Ollama (local), Anthropic Claude, OpenAI GPT, DeepSeek, Qwen, OpenRouter (100+ models), Groq, and Mistral.
Does SamarthyaBot support Hindi?
Yes! SamarthyaBot has first-class support for Hindi, Hinglish, and English. It's built specifically for Indian developers with Indian workflow support (GST, UPI, IRCTC).
Is my data safe with SamarthyaBot?
Absolutely. SamarthyaBot runs entirely on your local machine. All memories are encrypted with AES-256-CBC. Dangerous commands are blocked by regex blacklists. Your data never leaves your device.
How is SamarthyaBot different from ChatGPT?
Unlike ChatGPT, SamarthyaBot: (1) runs locally on your machine, (2) can execute real actions (deploy code, send emails, control browsers), (3) supports Indian workflows, (4) works offline via Ollama, and (5) your data never leaves your device.
Can SamarthyaBot deploy code to my server?
Yes! SamarthyaBot can SSH into remote servers using password or PEM key authentication, run commands, deploy code, and manage infrastructure โ all from a simple chat message.
How do I create a plugin for SamarthyaBot?
Drop a .js file in ~/SamarthyaBot_Files/plugins/ with a name, description, parameters, and execute function. SamarthyaBot auto-discovers and loads it. See the Plugin Documentation above.
๐บ๏ธ Roadmap
- Full RPA Engine (Code โ Commit โ Deploy)
- Go Micro-Worker (Live Terminal Streaming)
- Puppeteer Browser DOM Controller
- Telegram Integration + Auto Tunnel
- Multi-Provider LLM (Gemini, Claude, GPT, DeepSeek, Qwen, OpenRouter, Ollama, Groq, Mistral)
- Discord Bot Integration
- Groq/Whisper Voice Transcription
- Workspace Security Sandbox
- Heartbeat Periodic Tasks
- Sub-Agent Spawn (Background Workers)
- Premium CLI with ASCII Banner and Setup Wizard
- WhatsApp Business API
- Slack Integration
- Docker Compose deployment
- Mobile companion app
- RAG (Retrieval-Augmented Generation) with local documents
- Multi-user role-based access
๐ License
MIT License โ Free to use, modify, and distribute.
Built with โค๏ธ in India ๐ฎ๐ณ by Bishnu Prasad Sahu
๐ฆ NPM ยท ๐ GitHub ยท ๐ Report Bug ยท โจ Request Feature
If SamarthyaBot helps you, consider giving it a โญ on GitHub!