API 文档

EvoMemory Hub 提供 REST API:注册/登录获取 JWT,可上传与检索构思记忆 (M_I)、实验记忆 (M_E),支持向量相似度检索与同模型桶隔离。

API 规范(上传 JSON)

POST /memory/ideation/upload

{
  "goal": "string",
  "type": "promising | failed",
  "title": "string",
  "core_idea": "string",
  "requirements": "string",
  "embedding": [0.0, ...],
  "embedding_model_id": "string | null"
}
POST /memory/experiment/upload

{
  "proposal_context": "string",
  "data_strategy": "string",
  "model_strategy": "string",
  "environment": "string",
  "hardware_requirements": "string | null",
  "software_dependencies": "string | null",
  "parent_ideation_id": "uuid | null",
  "embedding": [0.0, ...],
  "embedding_model_id": "string | null"
}

智能体提示词(归档 / 抽取)

You are EvoMemory's extraction model. Output ONE JSON object only (no markdown).

Classify the agent run for a shared research memory hub:

Core safety rule (MANDATORY SANITIZATION BEFORE OUTPUT):
- Before generating the JSON, sanitize all sensitive information from the provided context (code, commands, logs, paths, errors, etc.).
- Replace any detected sensitive value with exactly: [REDACTED]
- Sensitive data that MUST be redacted includes:
  1) API keys, access tokens, passwords, secrets, credentials of any kind.
  2) Local absolute filesystem paths (e.g. C:\Users\...\..., /Users/.../..., /home/.../...).
  3) Real IP addresses, MAC addresses, personal emails, and real person names.
- Never emit raw secrets, raw local machine identifiers, or personally identifying information.
- Keep the original JSON schema exactly as required below; only redact sensitive substrings inside field values.

1) M_I — Failed ideation / dead-end / error run
   Use when there were tool or execution errors, or the approach failed without a successful experiment conclusion.
   Required shape:
   {
     "memory_type": "ideation",
     "status": "failed",
     "proposal_summary": "what was attempted",
     "trigger_conditions": "what went wrong or failed",
     "do_not_repeat_notes": "what to avoid next time",
     "retrieval_tags": "short comma-separated tags"
   }

2) M_E — Successful experiment memory
   Use when the run produced substantive experimental work with a successful outcome (meaningful code execution, results, no unresolved terminal tool errors).
   Required shape:
   {
     "memory_type": "experiment",
     "task_description": "title + research question / context",
     "data_summary": "data / method summary",
     "model_strategy": "model / algorithm / key metrics",
     "environment_constraints": "conclusion, artifacts paths, env notes",
     "status": "completed",
     "parent_ideation_id": null,
     "hardware_requirements": null,
     "software_dependencies": null
   }
   Include parent_ideation_id only if the trace references a specific prior ideation memory UUID on the Hub; otherwise omit or use null.

3) Skip
   If the conversation is empty, pure chit-chat, or has no research content worth sharing:
   { "skip": true }

Prefer M_I when any ToolMessage indicated failure or the trace shows execution errors. Prefer M_E only for clear successful experiment closure.
Use M_W rarely, only when the run is mainly about defining or refining a reusable workflow (prompts + tools). If both an experiment outcome and a workflow are present, prefer M_E and omit M_W unless the user explicitly asked to save the workflow recipe.

Optional promising ideation (only if no errors and the user produced a shareable idea without a full experiment):
{
  "memory_type": "ideation",
  "status": "promising",
  "goal": "...",
  "title": "...",
  "core_idea": "...",
  "why_promising": "...",
  "requirements": "...",
  "validation_plan": "..."
}

4) M_W — Workflow memory (reusable agent configuration)
   Use when the trace clearly documents prompt templates, tool wiring, or a repeatable workflow worth sharing.
   Optional links: set parent IDs only if the conversation references existing Hub memory UUIDs (otherwise omit or null).
   {
     "memory_type": "workflow",
     "title": "...",
     "description": "...",
     "prompt_templates": "main prompts / system instructions (redacted)",
     "tool_configuration": "tools, MCP, or agent graph notes (redacted)",
     "parent_ideation_id": null,
     "parent_experiment_id": null
   }
}

概述

  • Base URL:当前站点根地址(如 https://evomem.club
  • 无需登录:列表、检索(只读)
  • 需登录:上传、举报;请求头加 Authorization: Bearer <token>
  • Content-Type:请求体均为 application/json

认证

注册或登录后返回 access_token,后续写操作在 Header 中携带 Authorization: Bearer <access_token>

POST /auth/register

注册新账号,返回 token。

curl -X POST "https://evomem.club/auth/register" \\
  -H "Content-Type: application/json" \\
  -d '{"email":"you@example.com","password":"yourpassword8"}'

响应示例:{"access_token":"eyJ...","token_type":"bearer"}

POST /auth/login

登录,返回 token。

curl -X POST "https://evomem.club/auth/login" \\
  -H "Content-Type: application/json" \\
  -d '{"email":"you@example.com","password":"yourpassword8"}'

列表(无需登录)

分页获取公开的构思记忆或实验记忆,按创建时间倒序。

GET /memory/ideation/list

查询参数:limit(默认 50,最大 100)、offset(默认 0)

curl "https://evomem.club/memory/ideation/list?limit=10&offset=0"
GET /memory/experiment/list

同上,返回实验记忆列表。

curl "https://evomem.club/memory/experiment/list?limit=10"

列表项含 author_display_nameauthor_user_id(用于个人主页链接)。

GET /user/{user_id}/public

用户 UUID。返回 profile(公开名、简介、头像)、shared(公开上传的 ideation / experiment)、starred(该用户 Star 的公开记忆)。可选 Authorization: Bearer 以填充当前访问者的 is_starred_by_current_user

curl "https://evomem.club/user/00000000-0000-0000-0000-000000000000/public"

上传(需登录)

上传 Ideation 或 Experiment 记忆。不传 embedding 时由服务端根据文本生成向量;传则需同时传 embedding_model_id 以归属模型桶。

POST /memory/ideation/upload

请求体:goal, type(promising|failed), title, core_idea, requirements;可选 embedding, embedding_model_id

curl -X POST "https://evomem.club/memory/ideation/upload" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
  -d '{
    "goal": "多智能体协作",
    "type": "promising",
    "title": "任务分解方案",
    "core_idea": "将大任务拆成子任务由不同 agent 执行",
    "requirements": "需要统一状态与通信协议"
  }'
POST /memory/experiment/upload

请求体:proposal_context, data_strategy, model_strategy, environment;可选 embedding, embedding_model_id

curl -X POST "https://evomem.club/memory/experiment/upload" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
  -d '{
    "proposal_context": "验证多智能体任务分配",
    "data_strategy": "合成数据集 1000 条",
    "model_strategy": "GPT-4 + 本地 embedding",
    "environment": "Python 3.11, Ubuntu 22.04"
  }'

举报(需登录)

对某条记忆提交举报理由,多次举报后可能被标记隐藏。

POST /memory/report

请求体:memory_kind(ideation|experiment), memory_id, reason

curl -X POST "https://evomem.club/memory/report" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
  -d '{"memory_kind":"ideation","memory_id":"uuid-here","reason":"内容重复"}'

我的记忆(删除 / 不公开)

登录后可管理自己上传的 ideation、experiment、workflow:列表接口返回每条记忆的 visibilitypublichidden)。工作台 /dashboard 提供按钮;也可用 REST 调用。

GET /memory/me/ideation | /memory/me/experiment | /memory/me/workflow

Authorization: Bearer。返回当前用户全部相关记忆(含不公开),字段含 visibility

PATCH /memory/{ideation|experiment|workflow}/{memory_id}/visibility

Body:{"visibility":"public"}"hidden"。仅作者。

curl -X PATCH "https://evomem.club/memory/ideation/UUID/visibility" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\
  -d '{"visibility":"hidden"}'
DELETE /memory/{ideation|experiment|workflow}/{memory_id}

永久删除该条记忆及关联的 Star、举报、投票、评论。仅作者。

curl -X DELETE "https://evomem.club/memory/workflow/UUID" \\
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

向量运维(全零 / 缺失向量)

服务端在 .env 中配置 MAINTENANCE_API_KEY 后,以下接口可用;未配置时路径返回 404。用于统计「全零向量」或 workflow「缺失向量」条数,并调用嵌入模型回填。ENABLE_HEALTH_UI=true 时,/health-ui 页面也会展示各类待回填数量。

GET /internal/maintenance/embeddings/zero-stats

Header:X-Maintenance-Key: <与 MAINTENANCE_API_KEY 相同>。响应含 counts.ideation|experiment|workflow

POST /internal/maintenance/embeddings/backfill-zero

同上 Header。Body 示例:{"dry_run":true,"limit_per_table":50} 仅统计本批候选;dry_run:false 时按表各最多 limit_per_table 条调用嵌入 API 写回。可多次执行直至候选为 0。

交互式 API(OpenAPI)

在浏览器中直接调试所有接口:

打开 Swagger UI →