Skip to content

feat(api-server): add read-only sessions, memory, skills, config endpoints#6334

Open
outsourc-e wants to merge 1 commit intoNousResearch:mainfrom
outsourc-e:feat/read-only-session-memory-skills-config
Open

feat(api-server): add read-only sessions, memory, skills, config endpoints#6334
outsourc-e wants to merge 1 commit intoNousResearch:mainfrom
outsourc-e:feat/read-only-session-memory-skills-config

Conversation

@outsourc-e
Copy link
Copy Markdown

Summary

Adds read-only and metadata endpoints to gateway/platforms/api_server.py that enable web UIs to inspect gateway state without bypassing the existing message handling pipeline.

All chat continues to flow through /v1/chat/completions exclusively — no parallel agent lifecycle, no direct AIAgent calls, no gateway runner bypass.

This follows up on #4639 feedback from @teknium1:

The read-only endpoints (listing sessions, reading memory/skills/config) are a reasonable idea, but the chat and write endpoints need to flow through the gateway's existing message handling pipeline.

What changed (1 file, purely additive)

Sessions (delegates to existing SessionDB)

  • GET /api/sessions — list sessions (paginated via list_sessions_rich)
  • POST /api/sessions — create session (metadata only, via create_session)
  • GET /api/sessions/{id} — session details (via get_session)
  • PATCH /api/sessions/{id} — update title (via set_session_title)
  • DELETE /api/sessions/{id} — delete session (via delete_session)
  • GET /api/sessions/{id}/messages — message history (via get_messages)

Memory, Skills, Config (read-only)

  • GET /api/memory — reads ~/.hermes/memories/ files (MEMORY.md, USER.md)
  • GET /api/skills — scans installed skill directories, parses YAML frontmatter
  • GET /api/config — returns safe config subset (API keys stripped)

Architecture

  • All handlers use the existing _check_auth() gate
  • Follow established aiohttp patterns from the existing job endpoints
  • Session endpoints delegate to SessionDB — the same database that /v1/chat/completions already writes to
  • No new dependencies, no changes to existing endpoints or behavior
  • Zero changes to the chat pipeline — web UIs connect chat through /v1/chat/completions with X-Hermes-Session-Id for session continuity

Why

The existing /v1/chat/completions endpoint handles agent creation, session persistence, and streaming. These additions fill the gap for stateful web UIs that need to read sessions, memory, and skills — following the same aiohttp patterns already established.

Testing

  • All endpoints verified via curl against hermes --gateway
  • Hermes Workspace connects with full capability detection
  • Session CRUD, message history, skills listing, config reading all verified
  • Chat flows through /v1/chat/completions + X-Hermes-Session-Id with session continuity confirmed

…oints

Adds purely additive read-only and metadata endpoints to the gateway
API server. All chat continues to flow through /v1/chat/completions
exclusively — no parallel agent lifecycle or gateway runner bypass.

New endpoints:
- GET /api/sessions — list sessions (paginated)
- POST /api/sessions — create session (metadata only)
- GET /api/sessions/{id} — session details
- PATCH /api/sessions/{id} — update title
- DELETE /api/sessions/{id} — delete session
- GET /api/sessions/{id}/messages — message history
- GET /api/memory — read memory files (MEMORY.md, USER.md)
- GET /api/skills — list installed skills with frontmatter
- GET /api/config — safe config subset (API keys stripped)

All handlers use the existing _check_auth() gate and follow
established aiohttp patterns. Session endpoints delegate to the
existing SessionDB (list_sessions_rich, get_session, get_messages,
create_session, set_session_title, delete_session).

This enables web UIs like Hermes Workspace to connect to hermes
--gateway for session management, memory browsing, and skill
inspection while keeping chat on the gateway's existing message
handling pipeline.

Follows up on NousResearch#4639 feedback — read-only endpoints approved,
chat endpoints removed in favor of /v1/chat/completions.
@Codename-11
Copy link
Copy Markdown

Superseded by #8556 which adds the same read-only endpoints plus session chat (sync + SSE streaming), memory CRUD, config write, capability probes, and 91 tests.

@Codename-11
Copy link
Copy Markdown

Closing in favor of #8556 which supersedes this with a complete session management API (20 endpoints including streaming chat, memory CRUD, config write, capability probes, and 91 tests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants