|
| 1 | +--- |
| 2 | +name: lightning-memory |
| 3 | +description: Decentralized agent memory with Nostr identity and Lightning L402 payments. |
| 4 | +version: 1.0.0 |
| 5 | +requires_binaries: ["python3", "pip3"] |
| 6 | +requires_env: [] |
| 7 | +--- |
| 8 | + |
| 9 | +# Lightning Memory |
| 10 | + |
| 11 | +Decentralized agent memory for the Lightning economy. Store, query, and recall memories with cryptographic identity (Nostr) and micropayments (Lightning/L402). |
| 12 | + |
| 13 | +## Installation |
| 14 | + |
| 15 | +```bash |
| 16 | +pip3 install lightning-memory |
| 17 | +``` |
| 18 | + |
| 19 | +No API keys required. Runs fully local by default. Optional Nostr relay sync and Lightning L402 gateway for decentralized/paid access. |
| 20 | + |
| 21 | +## What It Does |
| 22 | + |
| 23 | +AI agents can transact via Lightning (L402) but can't remember what they paid for, which vendors are reliable, or their spending patterns. Lightning Memory fixes this: |
| 24 | + |
| 25 | +- **Cryptographic identity** via Nostr keypairs — memories are signed and verifiable |
| 26 | +- **Semantic search** with local ONNX embeddings (no API calls) |
| 27 | +- **Nostr relay sync** — memories replicate across relays using NIP-78 events |
| 28 | +- **L402 payment gateway** — sell memory access via Lightning micropayments with macaroon auth |
| 29 | +- **MCP server** — works with Claude Code, Cursor, Windsurf, and any MCP client |
| 30 | + |
| 31 | +## MCP Tools (7 tools) |
| 32 | + |
| 33 | +| Tool | Purpose | |
| 34 | +|------|---------| |
| 35 | +| `store_memory` | Store a memory with content, tags, and metadata | |
| 36 | +| `query_memories` | Semantic search across stored memories | |
| 37 | +| `get_memory` | Retrieve a specific memory by ID | |
| 38 | +| `list_memories` | List recent memories with optional filters | |
| 39 | +| `delete_memory` | Remove a memory by ID | |
| 40 | +| `get_identity` | Get the current Nostr identity (npub) | |
| 41 | +| `sync_status` | Check Nostr relay sync status | |
| 42 | + |
| 43 | +## Quick Start |
| 44 | + |
| 45 | +```python |
| 46 | +from lightning_memory import MemoryStore |
| 47 | + |
| 48 | +store = MemoryStore() |
| 49 | +store.add("Vendor X charges 50 sats for image gen, quality 8/10") |
| 50 | +results = store.query("reliable image generation vendors") |
| 51 | +``` |
| 52 | + |
| 53 | +## MCP Server |
| 54 | + |
| 55 | +```bash |
| 56 | +python -m lightning_memory.server |
| 57 | +``` |
| 58 | + |
| 59 | +Or add to your MCP client config: |
| 60 | +```json |
| 61 | +{ |
| 62 | + "lightning-memory": { |
| 63 | + "command": "python3", |
| 64 | + "args": ["-m", "lightning_memory.server"] |
| 65 | + } |
| 66 | +} |
| 67 | +``` |
| 68 | + |
| 69 | +## Links |
| 70 | + |
| 71 | +- PyPI: https://pypi.org/project/lightning-memory/ |
| 72 | +- GitHub: https://github.com/singularityjason/lightning-memory |
0 commit comments