Skip to content

feat(api): URL prefix versioning /api/v1 and /api/v2 (#737)#741

Merged
ajianaz merged 1 commit into
developfrom
feat/api-versioning-url-prefix
Jul 18, 2026
Merged

feat(api): URL prefix versioning /api/v1 and /api/v2 (#737)#741
ajianaz merged 1 commit into
developfrom
feat/api-versioning-url-prefix

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds URL prefix API versioning to uteke-server so breaking changes can be isolated behind version-specific routes.

Design

/api/v1/recall   β†’ v1 format (flat: [{id, content, score, ...}])
/api/v2/recall   β†’ v2 format (wrapped: [{memory: {id, content, ...}, score}])
/recall          β†’ alias β†’ latest (v2)
/health          β†’ unversioned, returns api_versions + api_latest

Changes

Server (uteke-server)

  • ApiVersion enum (V1, V2) with path prefix parser
  • /api/v1/* routes β†’ v1 response format (backward compat)
  • /api/v2/* routes β†’ current v2 response format
  • Unversioned routes continue to work (alias to latest)
  • HealthResponse now includes api_versions and api_latest
  • to_v1_flat() adapter converts UnifiedSearchResult β†’ flat v1 format

v1 vs v2 Response Format

Feature v1 (v0.7.x compat) v2 (v0.8.x+)
Recall response Flat: [{id, content, score, namespace, tags}] Wrapped: [{memory: {id, content, ...}, score}]

Implementation Notes

Closes #737

@ajianaz ajianaz self-assigned this Jul 18, 2026
@github-actions

Copy link
Copy Markdown

πŸ” Cora AI Code Review

βœ… No issues found. Code looks good!


Review powered by cora-cli Β· BYOK Β· MIT

@ajianaz
ajianaz force-pushed the feat/api-versioning-url-prefix branch 2 times, most recently from cd173ba to 188755a Compare July 18, 2026 03:12
Adds API versioning middleware to uteke-server.

Changes:
- ApiVersion enum (V1, V2) with path prefix parser
- /api/v1/* routes return v1 format (flat recall results for backward compat)
- /api/v2/* routes return current v2 format (wrapped UnifiedSearchResult)
- Unversioned routes (/recall, /remember, etc.) continue to work (β†’ latest)
- Health endpoint now includes api_versions and api_latest fields
- to_v1_flat() adapter converts UnifiedSearchResult β†’ v1 flat format

v1 vs v2 differences:
- v1 recall: [{id, content, score, namespace, tags, ...}] (flat)
- v2 recall: [{memory: {id, content, ...}, score}] (wrapped)

Routes affected:
- /recall β†’ /api/v1/recall (flat) or /api/v2/recall (wrapped)
- /remember, /memory, /forget, /list, /search, /stats, etc.
- /room/*, /doc/* β€” all sub-routes versioned
- /health β€” unversioned, includes version info
@ajianaz
ajianaz force-pushed the feat/api-versioning-url-prefix branch from 188755a to 2754284 Compare July 18, 2026 03:12
@ajianaz
ajianaz merged commit 7f9642d into develop Jul 18, 2026
8 checks passed
@ajianaz
ajianaz deleted the feat/api-versioning-url-prefix branch July 18, 2026 03:17
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.

feat(api): URL prefix versioning (/api/v1, /api/v2) for breaking change isolation

1 participant