NL

nonatofabio/luna-agent

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

21 stars 10 forks Качество 62 Тренд 10MIT

Custom minimal AI agent with persistent memory, MCP tools, and Discord

Обзор

A custom minimal AI agent with persistent memory, MCP tool integration, Discord/CLI interface, and structured observability. Runs entirely on local hardware — no cloud API costs. We evaluated existing agent frameworks and rejected them all: - : 400K lines of code, 42K exposed instances on Shodan. Too large to audit, too large to trust. - : 9 days old at time of evaluation. Too immature. - : Too thin — would need to rebuild most of it anyway. The core needs (memory, tools, chat, logging) are individually well-solved problems. No 400K-line framework needed. All LLM traffic flows through a single LLMClient with a configurable endpoint URL. Today it points at localhost:8001 (llama-server). To insert an AI firewall later, change the URL to localhost:9000 — zero code changes required. Luna handles reasoning models (Qwen3.5, etc.) automatically — extracting reasoning_content, falling back to cleaned reasoning when content is empty, and stripping leaked markup ( , , etc.) from output.

README

Показан фрагмент оригинального README. Открыть оригинал.

Luna Agent

A custom minimal AI agent with persistent memory, MCP tool integration, Discord/CLI interface, and structured observability. Runs entirely on local hardware — no cloud API costs.


~2300 lines of Python. No frameworks.

Why Custom

We evaluated existing agent frameworks and rejected them all:

  • OpenClaw: 400K lines of code, 42K exposed instances on Shodan. Too large to audit, too large to trust.
  • ZeroClaw: 9 days old at time of evaluation. Too immature.
  • NanoClaw: Too thin — would need to rebuild most of it anyway.

The core needs (memory, tools, chat, logging) are individually well-solved problems. No 400K-line framework needed.

Architecture

Discord (discord.py)     CLI REPL (no token)
     |                        |
     v                        v
+---------------------------------+
|        Luna Agent Core          |
|                                 |
|  agent.py                       |  agent loop: msg → memory → prompt → LLM → tools → respond
|    ├── llm.py                   |  single LLM client, configurable endpoint
|    ├── memory.py                |  SQLite + FTS5 + sqlite-vec hybrid search
|    ├── tools.py                 |  native tools: bash, files, web, delegate, code_task
|    ├── tool_output.py           |  smart output pipeline for large results
|    ├── mcp_manager.py           |  MCP client for community tool servers
|    └── observe.py               |  structured JSON logging
|                                 |
+---------------------------------+
              |
              v
        llama-server               Qwen3.5-35B-A3B on 2x RTX 3090

All LLM traffic flows through a single LLMClient with a configurable endpoint URL. Today it points at localhost:8001 (llama-server). To insert an AI firewall later, change the URL to localhost:9000 — zero code changes required.

Thinking model support: Luna handles reasoning models (Qwen3.5, etc.) automatically — extracting reasoning_content, falling back to cleaned reasoning when content is empty, and stripping leaked markup (, , etc.) from output.

Hardware

  • Intel i7-13700K, 64GB DDR4
  • 2x NVIDIA RTX 3090 (24GB each, 48GB total)
  • Qwen3.5-35B-A3B Q8_0 via llama-server with layer split across both GPUs
  • 131K context window, Q8_0 KV cache

Quick Start

Открыть полный README на GitHub

Установка

npx -y @playwright/mcp
Новичок в MCP? Начните с руководства на mcpskill.org →