Skip to main content

Minimal self-sovereign AI agent with Nostr identity and Lightning wallet

Project description

Cobot Logo

Minimal self-sovereign AI agent with Nostr identity and Lightning wallet

FeaturesQuick StartPluginsArchitectureContributing

Python 3.11+ MIT License Alpha PRs Welcome

Lightning Nostr Plugins


What is Cobot?

Cobot is a lightweight personal AI agent that runs on your hardware, identifies via Nostr, and transacts via Lightning Network.

Unlike cloud-hosted assistants or complex frameworks, Cobot gives you true ownership:

Your keys, your identity, your agent.

┌─────────────────────────────────────┐
│           Your Hardware             │  ← Physical control
├─────────────────────────────────────┤
│          Cobot Runtime              │  ← Self-hosted (~2K lines)
├─────────────────────────────────────┤
│    Nostr Identity (npub/nsec)       │  ← Self-sovereign ID
├─────────────────────────────────────┤
│   Lightning Wallet (npub.cash)      │  ← Self-sovereign money
├─────────────────────────────────────┤
│      LLM (local or cloud)           │  ← Flexible inference
└─────────────────────────────────────┘

Features

Feature Description
🪶 Minimal ~2K lines of Python, no bloat
🔌 Plugin Architecture Extensible via plugins with extension points
Lightning Wallet Send and receive sats autonomously
🔑 Nostr Identity Cryptographic identity via npub/nsec
🔥 Hot Reload Auto-restart on plugin changes
🤖 Multi-LLM PPQ, Ollama, OpenRouter, and more
📁 FileDrop File-based communication with Schnorr signatures
🧩 Extension Points Plugins can define hooks for others to implement

Quick Start

Install

git clone https://github.com/ultanio/cobot
cd cobot

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/macOS
# .venv\Scripts\activate   # Windows

# Install cobot
pip install -e .

Setup Wizard

The easiest way to configure Cobot is the interactive wizard:

cobot wizard init

The wizard will guide you through:

  • Identity — Name your agent
  • Provider — Choose your LLM (PPQ, Ollama, etc.)
  • Plugins — Configure any installed plugins

This creates a cobot.yml in your current directory.

Run

# Start agent
cobot run

# Interactive mode
cobot run --stdin

# Check status
cobot status

Manual Configuration

If you prefer manual setup, copy and edit the example config:

cp cobot.yml.example cobot.yml
# Edit cobot.yml with your settings

Configuration

# cobot.yml
provider: ppq  # or: ollama

identity:
  name: "MyAgent"

ppq:
  api_key: "${PPQ_API_KEY}"
  model: "gpt-4o"

# Optional: Nostr identity
nostr:
  relays:
    - "wss://relay.damus.io"

# Optional: Lightning wallet
wallet:
  provider: "npub.cash"

# Tool execution
exec:
  enabled: true
  timeout: 30

Plugins

Cobot uses a plugin architecture where functionality is modular and extensible.

Built-in Plugins

Plugin Capability Description
config Configuration management
ppq llm PPQ.ai LLM provider
ollama llm Local Ollama models
nostr communication Nostr DMs (NIP-04)
filedrop communication File-based messaging
wallet wallet Lightning via npub.cash
tools tools Shell, file operations
hotreload Auto-restart on changes
security Prompt injection shield

Extension Points

Cobot's unique feature: plugins can define extension points that other plugins implement.

┌─────────────┐                    ┌─────────────────┐
│   filedrop  │ ──defines──────►   │ Extension Point │
│   plugin    │                    │ filedrop.verify │
└─────────────┘                    └────────┬────────┘
                                            │
                                   implements
                                            │
                                   ┌────────▼────────┐
                                   │ filedrop-nostr  │
                                   │     plugin      │
                                   └─────────────────┘

Example:

# filedrop defines extension point
meta = PluginMeta(
    id="filedrop",
    extension_points=["filedrop.before_write", "filedrop.after_read"],
)

# filedrop-nostr implements it
meta = PluginMeta(
    id="filedrop-nostr",
    implements={
        "filedrop.before_write": "sign_message",
        "filedrop.after_read": "verify_message",
    },
)

Adding Plugins

Place plugins in one of these directories:

  1. System: /opt/cobot/plugins/
  2. User: ~/.cobot/plugins/
  3. Project: ./plugins/

Each plugin needs a plugin.py with a create_plugin() factory function.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    PLUGIN REGISTRY                           │
│  Registration │ Dependency resolution │ Extension points    │
├─────────────────────────────────────────────────────────────┤
│                      PLUGINS                                 │
│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐           │
│  │ config  │ │   llm   │ │  comms  │ │ wallet  │  ...      │
│  └─────────┘ └─────────┘ └─────────┘ └─────────┘           │
├─────────────────────────────────────────────────────────────┤
│                  EXTENSION POINTS                            │
│         Plugins define hooks → Others implement              │
├─────────────────────────────────────────────────────────────┤
│                   HOOK CHAIN                                 │
│  on_message → transform → llm_call → tool_exec → response  │
├─────────────────────────────────────────────────────────────┤
│                   CORE AGENT                                 │
│            Message loop │ Tool execution                     │
└─────────────────────────────────────────────────────────────┘

Core Concepts

Concept Description
Registry Central plugin management, dependency resolution
Capability What a plugin provides: llm, communication, wallet
Extension Point Hook that plugins can define for others to implement
Hook Chain Lifecycle events that plugins can intercept

CLI Reference

# Core
cobot run              # Start the agent
cobot run --stdin      # Interactive mode (no Nostr)
cobot status           # Show status
cobot restart          # Restart running agent

# Setup
cobot wizard init      # Interactive setup wizard
cobot wizard plugins   # List plugins with wizard sections

# Configuration
cobot config show      # Show current configuration
cobot config validate  # Validate configuration
cobot config edit      # Edit config in $EDITOR

Why Cobot?

Feature Cobot OpenClaw Others
Lines of code ~2K 430K+ Varies
Self-sovereign ⚠️ ❌ Cloud
Nostr identity ✅ Native
Lightning wallet ✅ Native
Extension points ✅ Unique
Hot reload
Plugin system ✅ Skills Varies

Development

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check cobot/

# Format
ruff format cobot/

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

Quick Links

Roadmap

  • Container isolation for tool execution
  • Smart LLM routing (cost optimization)
  • More messaging channels (Telegram, Discord)
  • Agent-to-agent protocol
  • Nostr relay for agent discovery

License

MIT License — see LICENSE for details.

Links

  • Nostr — Decentralized social protocol
  • Lightning — Bitcoin payment layer
  • npub.cash — Lightning wallet for Nostr

Built with ⚡ by agents, for agents

# CI deploy test Fri Feb 27 10:16:35 UTC 2026

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

cobot-0.2.0.tar.gz (140.5 kB view details)

Uploaded Source

Built Distribution

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

cobot-0.2.0-py3-none-any.whl (154.4 kB view details)

Uploaded Python 3

File details

Details for the file cobot-0.2.0.tar.gz.

File metadata

  • Download URL: cobot-0.2.0.tar.gz
  • Upload date:
  • Size: 140.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cobot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 13b4b5e4acc6f72ca3b70861289128ce678ce10c08e023fd6dea50d417167b57
MD5 1260b92cb2a78cdbc76249e5e7eb1d68
BLAKE2b-256 3496e31403b46feac1901aec23445aeafead102ad4c5be4fcd0725d28b918fe2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cobot-0.2.0.tar.gz:

Publisher: release.yml on ultanio/cobot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cobot-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cobot-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 154.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cobot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3d16ce5531e07bf8bd2e0fab0ac7a2cf281e6270581b0759973edc9e64f25b
MD5 2d5dc9249cd422d5e3e57249f65a014d
BLAKE2b-256 8bd8fa78ddf2c2f63098fea33d573d01df6b10bdd34d33393638718a16e51370

See more details on using hashes here.

Provenance

The following attestation bundles were made for cobot-0.2.0-py3-none-any.whl:

Publisher: release.yml on ultanio/cobot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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