Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)30k · #9344

agentmemory-rest-api

Skill này làm gì

Skill này giải thích HTTP API của máy chủ agentmemory, là cách chính để làm việc với bộ nhớ. Nó hữu ích để kết nối các công cụ không hỗ trợ MCP.

Khi nào nên dùng

  • ✓Khi bạn muốn lưu hoặc tìm kiếm bộ nhớ qua HTTP.
  • ✓Khi MCP không khả dụng và bạn cần một kết nối dự phòng.
  • ✓Khi bạn đang kết nối một công cụ không nói MCP với agentmemory.

Liên kết skill

https://github.com/rohitg00/agentmemory/blob/main/plugin/skills/agentmemory-rest-api/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/rohitg00/agentmemory/blob/main/plugin/skills/agentmemory-rest-api/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chỉ cho tôi cách lưu một ghi chú vào agentmemory và tìm lại nó bằng các yêu cầu HTTP thông thường.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent gửi yêu cầu đến các endpoint bộ nhớ cục bộ, như tuyến lưu và tuyến tìm kiếm thông minh. Các tuyến được bảo vệ cần bí mật bearer, và agent tải bí mật từ môi trường hoặc file bí mật cục bộ mà không hiển thị nó.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

REST is agentmemory's primary surface. MCP is a bridge on top of it. Every memory operation has an HTTP endpoint under http://localhost:3111/agentmemory/*.

Quick start

# liveness
curl -fsS http://localhost:3111/agentmemory/livez

# For this fixed loopback URL only. Do not print the value or enable shell tracing.
agentmemory_secret="${AGENTMEMORY_SECRET:-$(cat "$HOME/.agentmemory/secret")}"
test -n "$agentmemory_secret" || exit 1

# save
curl -fsS -X POST http://localhost:3111/agentmemory/remember \
  -H "Authorization: Bearer $agentmemory_secret" \
  -H "Content-Type: application/json" \
  -d '{"content":"chose JWT refresh rotation","concepts":["jwt-refresh-rotation"]}'

# recall
curl -fsS -X POST http://localhost:3111/agentmemory/smart-search \
  -H "Authorization: Bearer $agentmemory_secret" \
  -H "Content-Type: application/json" \
  -d '{"query":"auth token strategy","limit":5}'

Auth

Protected endpoints require bearer authentication by default, including localhost. Liveness is public. The example uses an explicit environment secret or the generated local secret file; if the daemon uses a secret from its .env, load that value locally without displaying it. For a remote daemon, require an explicit credential for that endpoint and HTTPS. Never forward a local-file secret or follow an authenticated redirect to another host. See TROUBLESHOOTING.md.

Conventions

  • Save returns 201, reads return 200, validation errors return 400.
  • Use documented fields only. A successful response does not prove an unsupported field was applied.
  • The REST port defaults to 3111 and is configurable with --port or --instance. The viewer defaults to 3113; the internal engine WebSocket defaults to 49134.

See also

  • agentmemory-mcp-tools for the MCP equivalents.
  • agentmemory-config for local configuration and the secret.

Reference

The full endpoint list with methods lives in REFERENCE.md, generated from src/triggers/api.ts.

Câu hỏi thường gặp

Có cần bí mật không?

Có. Các endpoint được bảo vệ cần bí mật bearer, ngay cả trên localhost.

Endpoint nào dùng để kiểm tra sức khỏe?

Tuyến kiểm tra còn sống là công khai và không cần bí mật.

Tôi có dùng được với máy chủ từ xa không?

Có, nhưng máy chủ từ xa cần thông tin đăng nhập rõ ràng và HTTPS, còn bí mật cục bộ không bao giờ được gửi đến đó.

Chi tiết

Mô tả gốc của tác giả

The agentmemory HTTP REST API surface, the primary protocol for talking to the memory server. Use when calling agentmemory over HTTP, when MCP is unavailable and you need a fallback, or when integrating a host that does not speak MCP.

repo: rohitg00/agentmemory

Độ phổ biến

Sao GitHub
30k
Vị trí xếp hạng
#9344
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự