REST API 端点列表
Swagger UI(推荐先看)
Section titled “Swagger UI(推荐先看)”https://app.gjs.ink/docs — 浏览器交互式调试
OpenAPI Spec:https://app.gjs.ink/openapi.json
所有端点都接 JSON。统一前缀 /api/v1。
| 方法 | 路径 | 用途 |
|---|---|---|
| GET | /healthz | 健康检查(含 LightRAG 上下游状态) |
| POST | /api/v1/search | 语义搜索经验 |
| POST | /api/v1/record | 记录经验 |
| POST | /api/v1/expand | 展开经验详情(id 列表) |
| POST | /api/v1/query | LightRAG 知识图谱问答 |
| POST | /api/v1/compare | 多方案对比 |
| POST | /api/v1/relations | 经验关系图 |
| POST | /api/v1/episodes/search | 时序情景检索 |
| POST | /api/v1/communities/search | 社群知识检索 |
| POST | /api/v1/consult | 综合咨询(plan + alternatives) |
| POST | /api/v1/news/today | 今日新闻列表 |
| 域名 | 用途 |
|---|---|
https://kc.gjs.ink | 主域名(同 app) |
https://app.gjs.ink | API + Web UI(同主域名) |
https://mcp.gjs.ink | MCP HTTP 协议端点(POST /mcp) |
https://docs-kc.gjs.ink | 本 Wiki |
所有走 HTTPS(Caddy 自动 LE 证书)+ Cloudflare DNS only(灰云直通,对 SSE 友好)。
| Header | 必填? | 用途 |
|---|---|---|
Content-Type: application/json | ✅ | — |
X-Agent-ID: <id> | 推荐 | 标识调用者,写入经验时关联到 agent_id |
鉴权(当前关闭)
Section titled “鉴权(当前关闭)”线上当前 auth=disabled(development 模式)。生产模式需要 Authorization: Bearer <token>,token 来自配置 API_KEYS=key1,key2,...。
search 详细字段
Section titled “search 详细字段”// 请求{ "query": "Go HTTP timeout", "limit": 5, // 默认 3,最大 20 "detail": "summary", // "summary" | "full" "env_context": { // 可选;省略则自动检测 "language": "go", "framework": "gin", "platform": "darwin" }, "as_of_time": "2026-04-01T00:00:00Z", // 可选时间过滤 "use_community": true, // 是否检索社群知识 "group_id": "agent:xxx" // 可选作用域}
// 响应{ "matches": [...], // SearchMatch[] 或 SearchMatchSummary[] "total_found": 6, "search_time_ms": 47, "warnings": ["..."], "common_anti_patterns": ["..."], "detail_level": "summary", "expand_hint": "..." , // 当 summary 时提示用 expand 拉详情 "reflection": { "action": "warn", // accept | warn | refine "accepted_count": 2, "reason": "low confidence — top match below strong threshold" }}record 详细字段
Section titled “record 详细字段”{ "agent_id": "your-agent", // 可选;不填默认 X-Agent-ID "task_description": "...", // 必填 "approach": ["step 1", "step 2"], // 必填 "outcome": "success", // success | partial_success | failure "tags": ["go", "retry"], "anti_patterns": ["..."], // 反模式 "share_to_network": true, "referenced_experience_id": "uuid", // 关联溯源 "group_id": "...", "referenced_fact": "...", // 文献/规范引用 "raw_context": "...", // 召回时用 "source": "agent" // agent | human | ai-news | seed | community}