AgentSkillsCN

ulmemory-cli

在使用Ultramemory混合内存系统、进行信息存储与检索、管理多代理内存操作、借助Tavily进行网络研究,或通过BrowserX MCP工具安排自动化任务时使用此功能。

SKILL.md
--- frontmatter
name: ulmemory-cli
description: Use when working with Ultramemory hybrid memory system, storing/retrieving information, managing multi-agent memory operations, web research with Tavily, or scheduling automated tasks

Ulmemory CLI

Overview

CLI para el sistema de memoria híbrida Ultramemory que combina almacenamiento vectorial (Qdrant), grafos temporales (FalkorDB) y caché (Redis) con soporte multi-LLM, investigación web (Tavily), CodeWiki y scheduler integrado.

When to Use

  • Almacenar información para recuperación semántica
  • Buscar/recuperar memories previas
  • Investigar en web con Tavily API
  • Investigar repositorios GitHub con CodeWiki
  • Gestionar servicios Docker del sistema
  • Crear/configurar agentes personalizados con skills
  • Programar tareas automáticas de limpieza/investigación
  • Analizar salud de la memoria

🆕 Novedades v0.3.0

Sistema de Agentes Completos

  • ConsultantAgent: Búsqueda ordenada por relevancia/fecha/fuente
  • ProactiveAgent: Ejecuta tareas del heartbeat.md cada 30 min
  • TerminalAgent: Dashboard interactivo y diagnóstico
  • PRDGeneratorAgent: Convierte investigaciones en PRDs ejecutables
  • Heartbeat System: Gestión de tareas desde archivo markdown

Scheduler Automático

bash
ulmemory schedule add-proactive        # Cada 30 min
ulmemory schedule add-researcher        # Cada hora
ulmemory schedule add-consolidator     # Diario 5am

🆕 Novedades v0.2.0

Web Search Integration

bash
# Buscar en memoria + web
ulmemory agent run researcher "AI agents" --web

# Especificar fuentes
ulmemory agent run researcher "topic" --sources web,memory,codewiki

# Deep research con expansión de queries
ulmemory agent run researcher "topic" --deep

Agent Skills System

bash
ulmemory agent skills                    # Ver skills disponibles
ulmemory agent skills researcher         # Ver skills de un agente
ulmemory agent add-skill mi-agente web_search
ulmemory agent edit mi-agente --schedule "0 9 * * *"

Enhanced Auto-Researcher

bash
# Investigación profunda con web + codewiki
ulmemory agent run auto-researcher "topic:AI,topic:ML" --deep

Quick Reference

Gestión de Servicios

ComandoDescripción
ulmemory upIniciar todos los servicios Docker
ulmemory downDetener servicios
ulmemory restartReiniciar servicios
ulmemory statusEstado detallado de agentes y servicios
ulmemory healthHealth check rápido
ulmemory testProbar conexiones

Memoria

ComandoDescripción
ulmemory memory add "texto"Agregar contenido a memoria
ulmemory memory add "texto" -m "key=value"Agregar con metadata
ulmemory memory add /path/to/fileIndexar archivo (PDF, CSV, MD, etc.)
ulmemory memory query "búsqueda"Buscar en memoria vectorial
ulmemory memory query "term" --limit 10Buscar con límite
ulmemory memory countContar memorias totales
ulmemory memory analyzeAnálisis completo de salud
ulmemory memory consolidateLimpiar duplicados y mal indexados
ulmemory memory delete "query" --confirmEliminar por búsqueda
ulmemory memory delete-all --confirm -fEliminar TODAS las memorias
ulmemory memory research --topics "AI,ML"Investigación automática

Code Index (Repos GitHub)

ComandoDescripción
ulmemory code-index owner/repoIndexar repo (usa categoría guardada o personal)
ulmemory code-index owner/repo -c opensourceIndexar con categoría específica
ulmemory code-index owner/repo -fForzar re-index completo
ulmemory code-index owner/repo -l 50Limitar archivos a indexar
ulmemory code-index owner/repo -e "vendor"Excluir patrones adicionales

Categorías disponibles: lefarma, e6labs, personal, opensource, hobby, trabajo, dependencias

Agentes (Enhanced)

ComandoDescripción
ulmemory agent listListar agentes disponibles
ulmemory agent skillsListar skills disponibles
ulmemory agent skills <name>Ver skills de un agente
ulmemory agent run researcher "query"Buscar en memoria
ulmemory agent run researcher "query" --webMemory + Web (Tavily)
ulmemory agent run researcher "query" --sources web,memory,codewikiMulti-source
ulmemory agent run researcher "query" --deepDeep research
ulmemory agent run librarian "texto"Agregar a memoria
ulmemory agent run auto-researcher "topic"Investigar tema
ulmemory agent run auto-researcher "topic" --deepDeep research + web
ulmemory agent run consolidatorEjecutar limpieza de memoria
ulmemory agent run deleter "all"Eliminar todas las memorias
ulmemory agent createCrear agente personalizado
ulmemory agent add-skill <agent> <skill>Agregar skill a agente
ulmemory agent remove-skill <agent> <skill>Remover skill
ulmemory agent edit <agent> --schedule "cron"Editar configuración
ulmemory agent launch <nombre>Lanzar agente custom
ulmemory agent config <nombre>Configurar agente

Nuevos Agentes v0.3.0

ComandoDescripción
ulmemory agent consultant "query" --order dateBúsqueda ordenada (relevance/date/source)
ulmemory agent proactiveEjecutar tareas del heartbeat
ulmemory agent terminal dashboardDashboard interactivo
ulmemory agent terminal diagnoseDiagnóstico del sistema
ulmemory agent terminal guideGuía interactiva
ulmemory agent heartbeat listVer tareas pendientes
ulmemory agent heartbeat add "tarea #tag"Agregar tarea
ulmemory agent heartbeat complete "tarea"Completar tarea
ulmemory agent prd generate "research.md"Generar PRD
ulmemory agent prd listListar PRDs

Scheduler (Tareas Programadas)

ComandoDescripción
ulmemory schedule add <agente> --cron "0 3 * * *"Crear tarea programada
ulmemory schedule listListar todas las tareas
ulmemory schedule show <id>Ver detalles de tarea
ulmemory schedule edit <id> --cron "..."Editar horario
ulmemory schedule enable <id>Habilitar tarea
ulmemory schedule disable <id>Deshabilitar tarea
ulmemory schedule run <id>Ejecutar tarea ahora
ulmemory schedule logs <id>Ver logs de tarea
ulmemory schedule history <id>Ver historial de ejecuciones
ulmemory schedule remove <id>Eliminar tarea

Nuevos Schedules v0.3.0

ComandoDescripción
ulmemory schedule add-proactiveAgente proactivo cada 30 min
ulmemory schedule add-researcherInvestigador hourly (default)
ulmemory schedule add-researcher --cron "0 */6 * * *"Investigador cada 6 horas
ulmemory schedule add-consolidatorConsolidator daily 5am
ulmemory schedule add-consolidator --hour 8Consolidator daily 8am

Configuración

ComandoDescripción
ulmemory config showVer configuración actual
ulmemory config set <key> <value>Establecer valor

Utilidades

ComandoDescripción
ulmemory logs show [servicio]Ver logs de servicios
ulmemory logs docker [contenedor]Ver logs de Docker
ulmemory metricsMostrar métricas de Prometheus
ulmemory dashboardAbrir dashboard de Grafana
ulmemory versionMostrar versión

🔍 Research Skills

Web Search (Tavily)

bash
# Requiere API key de Tavily (gratuita)
export TAVILY_API_KEY="tvly-xxx"

# O en config.yaml:
# research:
#   tavily:
#     api_key: "tvly-xxx"

CodeWiki Integration

bash
# Buscar repositorios relacionados
ulmemory agent run researcher "RAG frameworks" --sources codewiki

# Auto-researcher incluye CodeWiki automáticamente
ulmemory agent run auto-researcher "vector databases"

Multi-Source Research

bash
# Combinar todas las fuentes
ulmemory agent run researcher "LLM agents" --sources web,memory,codewiki

# Deep research con expansión automática de queries
ulmemory agent run researcher "RAG systems" --deep

📋 Available Skills

SkillDescripciónCategoría
web_searchBúsqueda web con Tavily APIResearch
codewikiInvestigación de repos GitHubResearch
deep_researchResearch multi-fuente con expansiónResearch
memory_queryBúsqueda en memoria internaMemory
memory_addAgregar contenido a memoriaMemory
memory_countContar documentosMemory

Flujo de Uso Típico

bash
# 1. Iniciar servicios
ulmemory up

# 2. Indexar documentos
ulmemory memory add ./docs/

# 3. Buscar en memoria + web
ulmemory agent run researcher "importante" --web

# 4. Deep research
ulmemory agent run researcher "AI memory systems" --deep --sources web,codewiki

# 5. Analizar salud
ulmemory memory analyze

# 6. Limpiar si es necesario
ulmemory memory consolidate

# 7. Programar mantenimiento diario
ulmemory schedule add consolidator --cron "0 3 * * *" --name "limpieza-diaria"

# 8. Programar research semanal
ulmemory schedule add auto-researcher --cron "0 9 * * 1" --args "topic:AI" --name "research-semanal"

Scheduler - Automatización

Crear Tareas Programadas

bash
# Limpieza diaria a las 3am
ulmemory schedule add consolidator --cron "0 3 * * *" --name "limpieza-diaria"

# Investigación semanal los lunes a las 9am
ulmemory schedule add auto-researcher --cron "0 9 * * 1" --args "topic:AI,topic:ML" --name "research-semanal"

# Búsqueda cada 6 horas
ulmemory schedule add researcher --cron "0 */6 * * *" --args "updates"

Formato Cron

code
┌───────────── minuto (0-59)
│ ┌───────────── hora (0-23)
│ │ ┌───────────── día del mes (1-31)
│ │ │ ┌───────────── mes (1-12)
│ │ │ │ ┌───────────── día de la semana (0-6, 0=domingo)
│ │ │ │ │
* * * * *

Gestionar Tareas

bash
# Ver todas las tareas
ulmemory schedule list

# Ver historial de ejecuciones
ulmemory schedule history 1

# Editar horario
ulmemory schedule edit 1 --cron "0 4 * * *"

# Ejecutar inmediatamente
ulmemory schedule run 1

Análisis de Memoria

El comando ulmemory memory analyze detecta:

Métricas

  • Health Score: 0-100 (🟢 ≥90, 🟡 ≥70, 🔴 <70)
  • Total documentos: Cantidad de entradas
  • Contenido único: Sin duplicados
  • Longitud promedio: Caracteres por entrada
  • Cobertura de metadata: % con metadata completo

Problemas Detectados

ProblemaCriterio
DuplicadosContenido idéntico
VacíoSin texto
Muy corto<10 caracteres
Muy largo>100KB
Sin metadataFaltan campos
EncodingMojibake/caracteres corruptos
Baja calidadRepetitivo/sin estructura

Tipos de Archivo Soportados

TipoExtensiones
Texto.txt, .md
Datos.csv, .xlsx, .xls
Documentos.pdf
Web.html, URLs

Puertos de Servicios

ServicioPuertoURL
API8000http://localhost:8000
API Docs8000http://localhost:8000/docs
Qdrant6333http://localhost:6333/dashboard
Redis6379localhost:6379
FalkorDB6370localhost:6370
Grafana3000http://localhost:3000
Prometheus9090http://localhost:9090

Configuración

LLM y APIs

Archivo: ~/.config/ultramemory/config.yaml

yaml
llm:
  default_provider: "minimax"
  providers:
    minimax:
      api_key: "sk-cp-xxx"
      model: "MiniMax-Text-01"
    google:
      api_key: "AIza-xxx"
      model: "gemini-1.5-flash"
    openai:
      api_key: "sk-xxx"
      model: "gpt-4"

# Research Tools
research:
  tavily:
    api_key: "tvly-xxx"
    enabled: true
  codewiki:
    enabled: true
    cli_path: "~/.claude/skills/codewiki/codewiki"

# Agent Configuration
agents:
  researcher:
    enabled: true
    sources: ["memory", "web", "codewiki"]
  auto_researcher:
    enabled: true
    sources: ["web", "codewiki"]

Common Mistakes

ErrorSolución
Connection refusedEjecutar ulmemory up primero
CLI not foundVerificar PATH incluye ~/.local/bin
Puerto ocupadolsof -i :PUERTO y detener conflicto
Tarea no ejecutaVerificar crontab con crontab -l
Health score bajoEjecutar ulmemory memory consolidate
TAVILY_API_KEY not setConfigurar API key en config.yaml
Web search no funcionaVerificar API key de Tavily

Ejemplo de Uso Programático

python
import asyncio
from core.memory import MemorySystem
from agents.researcher import ResearcherAgent
from agents.tools import registry, WebSearchTool

async def main():
    memory = MemorySystem()

    # Enhanced researcher with web search
    researcher = ResearcherAgent(
        memory,
        enable_web_search=True,
        tavily_api_key="tvly-xxx"
    )

    # Multi-source research
    result = await researcher.research(
        "AI agents",
        sources=["web", "memory", "codewiki"]
    )

    print(f"Web results: {len(result.web_results)}")
    print(f"Memory results: {len(result.memory_results)}")
    print(f"CodeWiki repos: {len(result.codewiki_results)}")

    if result.web_answer:
        print(f"AI Answer: {result.web_answer}")

    # Deep research
    deep_result = await researcher.deep_research(
        "vector databases",
        max_depth=3,
        save_to_memory=True
    )
    print(f"Total sources: {deep_result['total_sources']}")

asyncio.run(main())

Archivos de Configuración

ArchivoUbicación
Config general~/.ulmemory/settings.json
LLM config~/.config/ultramemory/config.yaml
Tareas programadas~/.ulmemory/schedules/tasks.json
Agentes custom~/.config/ultramemory/agents/
Logs de tareas/tmp/ulmemory-task-<id>.log

🔗 API Keys

ServicioVariableObtener
Web SearchTAVILY_API_KEYhttps://tavily.com (gratis)
OpenAIOPENAI_API_KEYhttps://platform.openai.com
GoogleGOOGLE_API_KEYhttps://ai.google.dev
MiniMaxConfig filehttps://minimax.chat