Memorias

Las memorias son la unidad atómica de conocimiento en SoluCortex. Cada memoria representa una decisión, estado, riesgo o aprendizaje de un proyecto.

Crear memoria

POST/api/v1/memories
bash
curl -s -X POST "$SOLUCORTEX_URL/api/v1/memories" \
  -H "Authorization: Bearer $SOLUCORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "project_id": "'"$SOLUCORTEX_PROJECT_ID"'",
    "type": "decision",
    "title": "Usar pgvector para búsqueda semántica",
    "content": "Se eligió pgvector sobre soluciones de vectores externas para mantener la base de datos unificada y reducir dependencias de infraestructura.",
    "importance": 8
  }'

Campos

CampoTipoRequeridoDescripción
project_idUUIDUUID del proyecto
typestringTipo de memoria. Ver Tipos de memoria
titlestringTítulo corto (máx 255 chars)
contentstringContenido completo de la memoria
importanceint 1–10Prioridad en el contexto. Default: 5
statusstringpending (default) · approved · rejected
💡 Memorias creadas vía API key se auto-aprueban (status: approved) y su embedding se genera automáticamente en background.

Listar memorias

GET/api/v1/memories?project_id=<uuid>
bash
curl -s "$SOLUCORTEX_URL/api/v1/memories?project_id=$SOLUCORTEX_PROJECT_ID" \
  -H "Authorization: Bearer $SOLUCORTEX_API_KEY" \
  -H "Accept: application/json"

Parámetros de query

ParámetroTipoDescripción
project_idUUIDRequerido. UUID del proyecto
typestringFiltrar por tipo de memoria
statusstringpending · approved · rejected
per_pageintResultados por página. Default: 50, máx: 100
pageintNúmero de página. Default: 1

La respuesta incluye metadatos de paginación en meta y links de navegación en links:

json
{
  "data": [ ... ],
  "links": {
    "first": "https://…/api/v1/memories?page=1",
    "last":  "https://…/api/v1/memories?page=4",
    "prev":  null,
    "next":  "https://…/api/v1/memories?page=2"
  },
  "meta": {
    "current_page": 1,
    "last_page": 4,
    "per_page": 50,
    "total": 183
  }
}

Ver memoria

GET/api/v1/memories/{id}
bash
curl -s "$SOLUCORTEX_URL/api/v1/memories/$MEMORY_ID" \
  -H "Authorization: Bearer $SOLUCORTEX_API_KEY" \
  -H "Accept: application/json"

Actualizar memoria

PATCH/api/v1/memories/{id}
bash
curl -s -X PATCH "$SOLUCORTEX_URL/api/v1/memories/$MEMORY_ID" \
  -H "Authorization: Bearer $SOLUCORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "importance": 9,
    "content": "Contenido actualizado con más detalle..."
  }'

Tags

GET/api/v1/memories/{id}/tags
POST/api/v1/memories/{id}/tags
bash
# Agregar tag
curl -s -X POST "$SOLUCORTEX_URL/api/v1/memories/$MEMORY_ID/tags" \
  -H "Authorization: Bearer $SOLUCORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "seguridad" }'

Fuentes

Referencia de dónde proviene una memoria (GitHub commit, Notion page, URL, etc.)

POST/api/v1/memories/{id}/sources
bash
curl -s -X POST "$SOLUCORTEX_URL/api/v1/memories/$MEMORY_ID/sources" \
  -H "Authorization: Bearer $SOLUCORTEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "git",
    "url": "https://github.com/org/repo/commit/abc123",
    "description": "Commit donde se implementó el fix"
  }'