Context7
Up-to-date docs for AI agents
作者提供的说明(英文原文)
Decentralized agent memory for the Lightning economy. Nostr identity, L402 payments.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"lightning-memory": {
"command": "uvx",
"args": [
"lightning-memory"
]
}
}
}在终端中运行这条命令
claude mcp add lightning-memory -- uvx lightning-memory粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"lightning-memory": {
"command": "uvx",
"args": [
"lightning-memory"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"lightning-memory": {
"type": "stdio",
"command": "uvx",
"args": [
"lightning-memory"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日
注册名称已通过 GitHub 账户 singularityjason 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.4.1)于8个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
同一分类中有:Context7, Codebase Memory, Exa
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Persistent memory for AI agents in the Lightning economy.
AI agents spend sats over Lightning via L402 — but they can't remember what they bought. Every session starts from zero. Every vendor is a stranger. Every price is accepted at face value. An agent that paid 500 sats yesterday doesn't know if today's 5,000 sat invoice is a price spike or normal.
L1: Bitcoin — settles
L2: Lightning — pays L3: Lightning Memory — remembers
Lightning Memory gives agents persistent memory, vendor intelligence, and payment safety gates. Agents learn from their spending history, track vendor reputations, detect price anomalies, enforce budgets, and share trust signals with other agents.
[Interactive Demo](https://www.jasonsosa.com/blog/agent-lightning-memory) — watch an agent learn, get rugged, and route around bad actors.
[Building the Agent Economy](https://www.jasonsosa.com/blog/agent-economy-trust-marketplace-bitcoin-lightning) — trust, budgets, compliance, and the memory marketplace.
pip install lightning-memory
lightning-memory # starts MCP server
{
"mcpServers": { "lightning-memory": { "command": "lightning-memory" } } }
{
"mcpServers": { "lightning-memory": { "command": "python", "args": ["-m", "lightning_memory.server"] } } }
| Feature | Lightning Memory | Mem0 | Raw file storage | No memory |
|---|---|---|---|---|
| Lightning/L402 awareness | Yes | No | No | No |
| Vendor reputation tracking | Yes | No | Manual | No |
| Spending anomaly detection | Yes | No | No | No |
| Nostr identity (BIP-340) | Yes | No | No | No |
| Relay sync (NIP-78) | Yes | No | No | No |
| Full-text + semantic search | Yes | Yes | No | No |
| Agent-to-agent knowledge markets | Yes (L402 gateway) | No | No | No |
| Budget enforcement | Yes | No | No | No |
| KYC/trust profiles | Yes | No | No | No |
| Payment pre-flight gate | Yes | No | No | No |
| Contradiction detection | Yes | No | No | No |
| Local-first / offline | Yes | Cloud | Yes | N/A |
| MCP native | Yes | Plugin | No | No |
| Zero config | Yes | API key required | Manual setup | N/A |
| Tool | Description |
|---|---|
memory_store | Store a memory (transaction, vendor, preference, error, decision) |
memory_query | Search by relevance (FTS5 + optional semantic search) |
memory_list | List memories with type/time filters |
memory_edit | Edit content or metadata with audit trail |
memory_sync | Sync with Nostr relays (push/pull) |
memory_export | Export as NIP-78 Nostr events |
memory_store(
content="Paid 500 sats to bitrefill.com for a $5 Amazon gift card via L402.", type="transaction", metadata='{"vendor": "bitrefill.com", "amount_sats": 500}' )
memory_query(query="bitrefill payment history", limit=5)
| Tool | Description |
|---|---|
ln_vendor_reputation | Reputation score from transaction history |
ln_spending_summary | Spending breakdown by vendor and protocol |
ln_anomaly_check | Detect if a payment is abnormally high |
ln_vendor_reputation(vendor="bitrefill.com")
ln_anomaly_check(vendor="bitrefill.com", amount_sats=5000)
| Tool | Description |
|---|---|
ln_preflight | Pre-flight gate: budget + anomaly + trust check before payment |
ln_budget_set | Set per-vendor spending limits (per txn, per day, per month) |
ln_budget_check | Check spending against limits |
ln_budget_status | Gateway earnings and L402 payment stats |
ln_preflight(vendor="bitrefill.com", amount_sats=500)
ln_preflight(vendor="bitrefill.com", amount_sats=25000)
| Tool | Description |
|---|---|
ln_vendor_trust | Full trust profile (KYC + reputation + community score) |
ln_trust_attest | Publish NIP-85 trust attestation to Nostr relays |
ln_agent_attest | Store a KYA (Know Your Agent) attestation |
ln_agent_verify | Look up an agent's compliance status |
ln_auth_session | Store LNURL-auth session records |
ln_auth_lookup | Look up LNURL-auth sessions |
ln_compliance_report | Generate structured compliance export |
| Tool | Description |
|---|---|
ln_discover_gateways | Find remote Lightning Memory gateways via Nostr |
ln_remote_query | Query a remote gateway via L402 micropayment |
ln_discover_gateways(operation="memory_query")
ln_remote_query( gateway_url="https://gw.example.com", operation="ln_vendor_reputation", params='{"vendor": "openai"}' )
Run an L402 pay-per-query HTTP gateway. Other agents pay Lightning micropayments to access your agent's memory — no API keys, no accounts.
pip install lightning-memory[gateway]
lightning-memory-gateway # Listening on 0.0.0.0:8402
Agent Gateway Phoenixd
| <-- 402 + Lightning invoice --- | --- create_invoice --------> |
| <-- bolt11 + payment_hash -- | |
| [pay invoice via Lightning] | |
| -- GET + L402 token ----------> | |
| (macaroon:preimage) | --- verify preimage -------> |
| <-- 200 + query results ------- |
| Endpoint | Method | Price | Description |
|---|---|---|---|
/info | GET | Free | Gateway status, pricing, node info |
/health | GET | Free | Health check |
/memory/store | POST | 3 sats | Store a memory |
/memory/query | GET | 2 sats | Search memories by relevance |
/memory/list | GET | 1 sat | List memories with filters |
/ln/vendor/{name} | GET | 3 sats | Vendor reputation report |
/ln/spending | GET | 2 sats | Spending summary |
/ln/anomaly-check | POST | 3 sats | Payment anomaly detection |
/ln/preflight | POST | 3 sats | Pre-flight payment gate |
/ln/trust/{name} | GET | 2 sats | Vendor trust profile |
/ln/budget | GET | 1 sat | Budget rules and spending |
/ln/compliance-report | GET | 10 sats | Compliance report export |
localhost:9740)~/.lightning-memory/config.json → {"phoenixd_password": " "}lightning-memory-gatewayPHOENIXD_PASSWORD=your-password docker compose up
lightning-memory # Start MCP server
lightning-memory stats # Memory statistics dashboard lightning-memory export json # Export memories as JSON lightning-memory export csv # Export memories as CSV lightning-memory relay-status # Check Nostr relay connectivity lightning-memory-gateway # Start L402 HTTP gateway lightning-memory-manifest # Generate gateway discovery manifest
Default relays: wss://relay.damus.io, wss://nos.lol, wss://relay.nostr.band
Customize in ~/.lightning-memory/config.json:
{
"relays": ["wss://relay.damus.io", "wss://nos.lol", "wss://relay.primal.net"], "sync_timeout_seconds": 30, "max_events_per_sync": 500 }
| Relay | Speed | Reliability | Notes |
|---|---|---|---|
wss://relay.damus.io | Fast | High | Most popular, good uptime |
wss://nos.lol | Fast | High | Reliable, good NIP-78 support |
wss://relay.nostr.band | Medium | Medium | Search-focused, may be slow |
wss://relay.primal.net | Fast | High | Well-maintained |
wss://nostr.wine | Fast | High | Paid relay, less spam |
Add ONNX-based semantic similarity search alongside FTS5 keyword search:
pip install lightning-memory[semantic]
Queries then use hybrid ranking: FTS5 BM25 + cosine similarity with reciprocal rank fusion. "Which vendors are reliable for transcription" matches memories containing "whisper API" and "audio-to-text" even without exact keyword overlap.
~/.lightning-memory/
memories.db # SQLite database keys/ private.key # Nostr private key (chmod 600) public.key # Nostr public key (your agent identity)
MIT