ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Lightning Memory

โดย singularityjasonรุ่น 0.4.1i★ –iรันบนเครื่อง
ชื่อใน registryio.github.singularityjason/lightning-memory

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

Decentralized agent memory for the Lightning economy. Nostr identity, L402 payments.

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: ค้นข้อมูลและความจำของ AI

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "lightning-memory": {
      "command": "uvx",
      "args": [
        "lightning-memory"
      ]
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add lightning-memory -- uvx lightning-memory

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "lightning-memory": {
      "command": "uvx",
      "args": [
        "lightning-memory"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "lightning-memory": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "lightning-memory"
      ]
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub singularityjason ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด ค้นข้อมูลและความจำของ AIi

  • ดาวมากกว่า 0% ของอีก 7220 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 4% ของอีก 7220 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 7220 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Lightning Memory ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.4.1) เข้า registry 8 เดือนที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Context7, Codebase Memory, Exa

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Context7

โดย upstash

ส่งคู่มือการใช้ไลบรารีและเฟรมเวิร์กรุ่นล่าสุดให้ AI อ่านก่อนตอบ ช่วยให้โค้ดที่ AI เขียนไม่ใช้คำสั่งเก่าที่เลิกใช้แล้ว

บนเครื่องหรือคลาวด์★ 64,224MITอัปเดต 3 วันที่ผ่านมา
ติดตั้ง

Codebase Memory

โดย DeusData

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

รันบนเครื่อง★ 48,148MITอัปเดต 20 วันที่ผ่านมา
ติดตั้ง

Exa

โดย exa-labs

Connect AI agents to Exa for web search, content fetching, and multi-step research.

รันบนคลาวด์★ 5,213MITอัปเดต 44 วันที่ผ่านมา
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

Lightning Memory

Persistent memory for AI agents in the Lightning economy.

The Problem

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.

The Solution

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.

Who Is This For

  • Agents making L402 payments that need vendor reputation and spending discipline
  • Developers building autonomous agents on Bitcoin/Lightning
  • Anyone running an MCP-compatible AI agent (Claude, GPT, or any MCP client)

Quick Start

pip install lightning-memory

lightning-memory # starts MCP server

Configure in Claude Code
{

"mcpServers": { "lightning-memory": { "command": "lightning-memory" } } }

Configure in Claude Desktop
{

"mcpServers": { "lightning-memory": { "command": "python", "args": ["-m", "lightning_memory.server"] } } }

How It Compares

FeatureLightning MemoryMem0Raw file storageNo memory
Lightning/L402 awarenessYesNoNoNo
Vendor reputation trackingYesNoManualNo
Spending anomaly detectionYesNoNoNo
Nostr identity (BIP-340)YesNoNoNo
Relay sync (NIP-78)YesNoNoNo
Full-text + semantic searchYesYesNoNo
Agent-to-agent knowledge marketsYes (L402 gateway)NoNoNo
Budget enforcementYesNoNoNo
KYC/trust profilesYesNoNoNo
Payment pre-flight gateYesNoNoNo
Contradiction detectionYesNoNoNo
Local-first / offlineYesCloudYesN/A
MCP nativeYesPluginNoNo
Zero configYesAPI key requiredManual setupN/A

Tools (22)

Memory
ToolDescription
memory_storeStore a memory (transaction, vendor, preference, error, decision)
memory_querySearch by relevance (FTS5 + optional semantic search)
memory_listList memories with type/time filters
memory_editEdit content or metadata with audit trail
memory_syncSync with Nostr relays (push/pull)
memory_exportExport 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)

→ recency-weighted results with dedup and contradiction alerts

Lightning Intelligence
ToolDescription
ln_vendor_reputationReputation score from transaction history
ln_spending_summarySpending breakdown by vendor and protocol
ln_anomaly_checkDetect if a payment is abnormally high
ln_vendor_reputation(vendor="bitrefill.com")

→ {reputation: {total_txns: 12, success_rate: 0.92, avg_sats: 450}, recommendation: "reliable"}

ln_anomaly_check(vendor="bitrefill.com", amount_sats=5000)

→ {anomaly: {verdict: "high", context: "5000 sats is 11.1x the historical average..."}}

Payment Safety
ToolDescription
ln_preflightPre-flight gate: budget + anomaly + trust check before payment
ln_budget_setSet per-vendor spending limits (per txn, per day, per month)
ln_budget_checkCheck spending against limits
ln_budget_statusGateway earnings and L402 payment stats
ln_preflight(vendor="bitrefill.com", amount_sats=500)

→ {decision: {verdict: "approve", budget_remaining_today: 4500, trust_score: 0.89}}

If the vendor suddenly charges 50x:

ln_preflight(vendor="bitrefill.com", amount_sats=25000)

→ {decision: {verdict: "reject", reasons: ["exceeds daily limit of 5000 sats"]}}

Trust & Compliance
ToolDescription
ln_vendor_trustFull trust profile (KYC + reputation + community score)
ln_trust_attestPublish NIP-85 trust attestation to Nostr relays
ln_agent_attestStore a KYA (Know Your Agent) attestation
ln_agent_verifyLook up an agent's compliance status
ln_auth_sessionStore LNURL-auth session records
ln_auth_lookupLook up LNURL-auth sessions
ln_compliance_reportGenerate structured compliance export
Marketplace
ToolDescription
ln_discover_gatewaysFind remote Lightning Memory gateways via Nostr
ln_remote_queryQuery a remote gateway via L402 micropayment
ln_discover_gateways(operation="memory_query")

→ {count: 2, gateways: [{url: "https://gw1.example.com", operations: {...}}, ...]}

ln_remote_query( gateway_url="https://gw.example.com", operation="ln_vendor_reputation", params='{"vendor": "openai"}' )

→ Pays 3 sats, returns remote agent's vendor intelligence

Architecture

  • Nostr identity: Agent identity = Nostr keypair (BIP-340). No accounts, no API keys.
  • Local-first: SQLite with FTS5 full-text search + optional ONNX semantic search. Works offline.
  • Nostr sync: Memories written as NIP-78 events to relays. Portable, tamper-proof.
  • L402 payments: Pay-per-query gateway. 1-10 sats per operation.
  • Memory quality: Deduplication, contradiction detection, noise filtering, recency-weighted ranking, access tracking.

L402 Gateway

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

How L402 Works
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 -------
Endpoints
EndpointMethodPriceDescription
/infoGETFreeGateway status, pricing, node info
/healthGETFreeHealth check
/memory/storePOST3 satsStore a memory
/memory/queryGET2 satsSearch memories by relevance
/memory/listGET1 satList memories with filters
/ln/vendor/{name}GET3 satsVendor reputation report
/ln/spendingGET2 satsSpending summary
/ln/anomaly-checkPOST3 satsPayment anomaly detection
/ln/preflightPOST3 satsPre-flight payment gate
/ln/trust/{name}GET2 satsVendor trust profile
/ln/budgetGET1 satBudget rules and spending
/ln/compliance-reportGET10 satsCompliance report export
Phoenixd Setup
  1. Download and run Phoenixd (listens on localhost:9740)
  2. Fund it with ~10,000 sats for initial channel opening
  3. Configure: ~/.lightning-memory/config.json → {"phoenixd_password": " "}
  4. Start: lightning-memory-gateway
Docker
PHOENIXD_PASSWORD=your-password docker compose up

CLI Commands

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

Relay Configuration

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 }

RelaySpeedReliabilityNotes
wss://relay.damus.ioFastHighMost popular, good uptime
wss://nos.lolFastHighReliable, good NIP-78 support
wss://relay.nostr.bandMediumMediumSearch-focused, may be slow
wss://relay.primal.netFastHighWell-maintained
wss://nostr.wineFastHighPaid relay, less spam

Optional: Semantic Search

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.

Data Storage

~/.lightning-memory/

memories.db # SQLite database keys/ private.key # Nostr private key (chmod 600) public.key # Nostr public key (your agent identity)

Roadmap

  • Phase 1: MCP server with local SQLite storage
  • Phase 2: Lightning intelligence (vendor reputation, spending summary, anomaly detection)
  • Phase 3: Nostr relay sync (NIP-78, Schnorr signing, bidirectional sync)
  • Phase 4: L402 payment gateway (macaroons, Phoenixd, HTTP gateway)
  • Phase 5: Compliance & trust (budget enforcement, vendor KYC, community reputation, pre-flight gate)
  • Phase 6: Memory marketplace (gateway discovery, remote L402 queries, gateway client)
  • Phase 7: Agent reliability (semantic search, deduplication, contradiction detection, circuit breakers)

Star History

License

MIT

ถาม PopNx