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/memoriesbash
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
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
project_id | UUID | ✅ | UUID del proyecto |
type | string | ✅ | Tipo de memoria. Ver Tipos de memoria |
title | string | ✅ | Título corto (máx 255 chars) |
content | string | ✅ | Contenido completo de la memoria |
importance | int 1–10 | — | Prioridad en el contexto. Default: 5 |
status | string | — | pending (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ámetro | Tipo | Descripción |
|---|---|---|
project_id | UUID | Requerido. UUID del proyecto |
type | string | Filtrar por tipo de memoria |
status | string | pending · approved · rejected |
per_page | int | Resultados por página. Default: 50, máx: 100 |
page | int | Nú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}/tagsPOST
/api/v1/memories/{id}/tagsbash
# 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}/sourcesbash
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"
}'