Skip to main content

A lightweight, open-source AI Agent powered by free APIs

Project description

๐Ÿค– MRAgent

PyPI version GitHub release
A lightweight, open-source AI Agent powered by free APIs

Features โ€ข Architecture โ€ข Getting Started โ€ข API Providers โ€ข Roadmap


โœจ Overview

MRAgent is a lightweight AI agent that connects to free-tier LLM and multimodal APIs to deliver a powerful, personal assistant experience โ€” without expensive subscriptions. It combines text generation, image generation, text-to-speech, speech-to-text, screen monitoring, web browsing, code execution, terminal access, and file management into a single, extensible agent.

Philosophy: Leverage the best free APIs available (primarily from NVIDIA and other open-source providers) to build an agent that rivals commercial solutions.


๐Ÿš€ Features

Capability Description Status
๐Ÿ’ฌ LLM Chat Multi-model text generation (GPT-OSS, Kimi, GLM-5, Llama 3.3) โœ… Implemented
๐ŸŽจ Image Generation Text-to-image via FLUX.1 Dev (default) & Google AI Studio (optional) โœ… Implemented
๐Ÿ—ฃ๏ธ Text-to-Speech Natural voice synthesis via Edge TTS (Free, Neutral) โœ… Implemented
๐Ÿ‘‚ Speech-to-Text Audio transcription via Groq Whisper v3 (Ultra-fast) โœ… Implemented
๐Ÿ“ง Email Skill Send & receive emails via AgentMail (Interactive /email command) โœ… Implemented
๐Ÿ“ฑ Telegram Bot Chat, Voice, & Image interaction โœ… Implemented
๐Ÿ’“ VivreCard Background Scheduler & Heartbeat System โœ… Implemented
๐Ÿ›ก๏ธ Poneglyph System Guardian & Doctor (Auto-diagnostics) โœ… Implemented
๐ŸŒ Web Browsing Autonomous internet surfing and information gathering โœ… Implemented
๐Ÿ–ฅ๏ธ Screen Monitoring Capture and analyze screen content in real-time โœ… Implemented
๐Ÿ’ป Code Execution Write, run, and debug code in multiple languages โœ… Implemented
๐Ÿ”ง Terminal Access Execute shell commands and system operations โœ… Implemented
๐Ÿ“ File Management Navigate, create, move, and organize files โœ… Implemented
๐Ÿ” Web Search Search with citations via Brave, Google, or LangSearch โœ… Implemented
๐Ÿ“„ PDF Reader Read & extract text from PDFs with page markers โœ… Implemented
๐Ÿ“› Identity Setup Interactive wizard to customize User and Agent persona โœ… Implemented
๐Ÿ›ก๏ธ Injection Defense Structural tagging & sanitization of untrusted external data โœ… Implemented
โšก Smart Autonomy Tiered trust levels (cautious/balanced/autonomous) for 24/7 ops โœ… Implemented
๐Ÿงญ Screen Guidance /guide command โ€” capture screen & get AI-powered guidance โœ… Implemented

๐Ÿ—๏ธ Architecture

MRAgent/
โ”œโ”€โ”€ main.py               # Entry point & startup
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ”œโ”€โ”€ .env.example          # Template for API keys
โ”‚
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ settings.py       # Config, model registry, autonomy settings
โ”œโ”€โ”€ core/
โ”‚   โ””โ”€โ”€ poneglyph.py      # System Guardian & Doctor
โ”œโ”€โ”€ agents/
โ”‚   โ”œโ”€โ”€ core.py           # Core agent loop + tiered approval logic
โ”‚   โ”œโ”€โ”€ prompt_enhancer.py # System prompt & context injection
โ”‚   โ”œโ”€โ”€ watcher.py        # Eagle Eye screen monitor
โ”‚   โ””โ”€โ”€ vivrecard.py      # Background scheduler
โ”œโ”€โ”€ skills/
โ”‚   โ”œโ”€โ”€ agentmail.py      # Email skill
โ”‚   โ””โ”€โ”€ telegram.py       # Telegram skill
โ”œโ”€โ”€ providers/
โ”‚   โ”œโ”€โ”€ nvidia_llm.py     # NVIDIA LLM (GPT-OSS, Kimi, GLM, Qwen)
โ”‚   โ”œโ”€โ”€ nvidia_image.py   # Image generation (SD 3.5, FLUX)
โ”‚   โ”œโ”€โ”€ tts.py            # Edge TTS
โ”‚   โ”œโ”€โ”€ nvidia_stt.py     # Groq STT
โ”‚   โ”œโ”€โ”€ brave_search.py   # Brave Search (with citations)
โ”‚   โ”œโ”€โ”€ google_search.py  # Google Custom Search
โ”‚   โ””โ”€โ”€ langsearch.py     # LangSearch API
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ terminal.py       # Shell command execution
โ”‚   โ”œโ”€โ”€ file_manager.py   # File CRUD operations
โ”‚   โ”œโ”€โ”€ browser.py        # Web fetch & search (with sanitizer)
โ”‚   โ”œโ”€โ”€ pdf_reader.py     # PDF text extraction
โ”‚   โ”œโ”€โ”€ screen.py         # Screen capture & diff
โ”‚   โ”œโ”€โ”€ code_runner.py    # Python code execution
โ”‚   โ””โ”€โ”€ image_gen.py      # Image generation tool
โ”œโ”€โ”€ ui/
โ”‚   โ”œโ”€โ”€ cli.py            # Rich CLI (commands, menus, autonomy)
โ”‚   โ”œโ”€โ”€ web.py            # Flask Web Interface
โ”‚   โ””โ”€โ”€ telegram_bot.py   # Telegram bot
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ sanitizer.py      # Prompt injection defense
โ”‚   โ”œโ”€โ”€ logger.py         # Logging
โ”‚   โ””โ”€โ”€ helpers.py        # Shared utilities
โ”œโ”€โ”€ memory/
โ”‚   โ””โ”€โ”€ chat_store.py     # SQLite chat persistence
โ””โ”€โ”€ data/                 # Runtime data (gitignored)
    โ”œโ”€โ”€ chats.db
    โ”œโ”€โ”€ images/
    โ””โ”€โ”€ logs/

๐Ÿ› ๏ธ Getting Started

Prerequisites

Installation

One-Line Installer (Recommended)

Mac/Linux:

curl -fsSL https://raw.githubusercontent.com/bonzainsights/MrAgent/main/install.sh | bash

Windows (PowerShell):

iwr https://raw.githubusercontent.com/bonzainsights/MrAgent/main/install.bat | iex

Pip / Pipx (Python Package)

Recommended โ€” uses pipx (handles PATH automatically):

pip install pipx
pipx install bonza-mragent
mragent

Standard pip install:

pip install bonza-mragent
mragent

โš ๏ธ mragent not found after pip install?

Instant workaround (all platforms):

python -m bonza_mragent

Permanent fix โ€” macOS/Linux (add ~/.local/bin to PATH):

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc

Permanent fix โ€” Windows PowerShell (find and add the Scripts folder to PATH):

python -c "import sysconfig; print(sysconfig.get_path('scripts', 'nt_user'))"
# Copy the output path, then add it permanently:
[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\paste\the\path\here", "User")

Then restart your terminal and type mragent.

Homebrew (macOS)

brew install --HEAD https://raw.githubusercontent.com/bonzainsights/MRAgent/main/Formula/mragent.rb

Manual Setup (Advanced)

# Clone the repository
git clone https://github.com/bonzainsights/MrAgent.git
cd MRAgent

# Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up your environment variables
cp .env.example .env
# Edit .env with your API keys

Quick Start

If you boot the system without API keys or an identity configured, an Interactive Setup Wizard will safely guide you through copying your free NVIDIA NIM key and naming your Assistant before booting automatically!

# Run the agent (CLI mode + Web UI)
python main.py

# Run as Telegram bot
python main.py --mode telegram

# Run System Diagnostic
python main.py doctor

๐Ÿ”‘ API Providers

MRAgent is built around free-tier APIs to keep costs at zero. Here are the current providers:

NVIDIA NIM (Primary)

Model Purpose API
GPT-OSS-120B Reasoning (Primary) NVIDIA NIM
Kimi K2.5 General-purpose LLM NVIDIA NIM
GLM-5 Reasoning & code NVIDIA NIM
Llama 3.3 70B Reliable fallback NVIDIA NIM
Qwen2.5 Coder Code generation NVIDIA NIM
FLUX.1 Dev Image generation (default) NVIDIA NIM
Stable Diffusion 3 Medium Image generation (fallback) NVIDIA NIM

Other Free Providers

Provider Purpose Service
Groq Speech-to-Text Whisper Large v3 (Free)
Edge TTS Text-to-Speech Microsoft Edge Neural (Free)
AgentMail Email AgentMail.to (Free)
Brave Search Web search Brave Search API (Free)
Google Search Web search Custom Search JSON API (Free)
LangSearch Web search LangSearch API (Free)
Telegram Messaging Interface Telegram Bot API (Free)

๐Ÿ’ก Adding new providers? Implement the base interface in providers/base.py and register your provider in the config.


๐Ÿ—บ๏ธ Roadmap

  • Project setup & repository initialization
  • Core agent loop with task planning
  • NVIDIA LLM integration (multi-model)
  • Image generation pipeline
  • Text-to-speech (Edge TTS)
  • Speech-to-text (Groq Whisper)
  • Telegram bot interface (Voice & Image support)
  • Web Interface (Chat & Voice)
  • Email Integration (AgentMail)
  • VivreCard Scheduler
  • Poneglyph System (Guardian & Doctor)
  • Multi-provider search (Brave, Google, LangSearch)
  • Terminal & code execution tools
  • File management system
  • Screen monitoring & analysis
  • Web browsing automation
  • Security: Terminal/Code Execution Approvals (HitL)
  • Security: Web UI & Telegram Authentication
  • Interactive Startup Wizards (API Keys & Identity)
  • NVIDIA API Key Consolidation (Global Defaulting)
  • Prompt injection defense (structural data tagging & sanitization)
  • Smart autonomy system (cautious/balanced/autonomous trust levels)
  • PDF reader tool (page-by-page extraction)
  • Search citations (numbered source URLs in results)
  • Screen guidance pipeline (/guide command)
  • UI polish (compact startup, personalized welcome)

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is open source. See the LICENSE file for details.


โš ๏ธ Disclaimer

MRAgent uses free-tier API keys which may have rate limits and usage quotas. The agent is designed to work within these constraints. Never commit your .env file or expose API keys publicly.


Built with โค๏ธ by Bonza Insights & achbj

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bonza_mragent-0.2.6.tar.gz (271.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bonza_mragent-0.2.6-py3-none-any.whl (122.4 kB view details)

Uploaded Python 3

File details

Details for the file bonza_mragent-0.2.6.tar.gz.

File metadata

  • Download URL: bonza_mragent-0.2.6.tar.gz
  • Upload date:
  • Size: 271.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for bonza_mragent-0.2.6.tar.gz
Algorithm Hash digest
SHA256 4b1aada1741a4dd6d7352313e687ab3ac47529eb0061c1eb95be7c5e00087529
MD5 d3de282a9c0dd4f83628dd8189bb10ac
BLAKE2b-256 9a6d639a4c7750be1b6351a3ec4c822e43ae7dfb64601c31deac8e330943ce64

See more details on using hashes here.

File details

Details for the file bonza_mragent-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: bonza_mragent-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 122.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for bonza_mragent-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b45c8eb64f71c0988820d282b341aa0868a191352fe18e76ced1a30b0515237a
MD5 a7ecfd1e0cd3c7c0aac0458631558e1f
BLAKE2b-256 7613806f279c969875f0bd6eafd6e43888b89eab4f8f6f2cd11b762746066a15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page