Skip to content

Conversation

@SwekeR-463
Copy link
Contributor

Summary

This PR implements comprehensive support for vector memory operations in the Go SDK and the Control Plane. It introduces Set, Get, Search, and Delete operations for vector embeddings, enabling agents to manage semantic memory effectively. The Control Plane API has been updated with new RESTful endpoints while maintaining backward compatibility for existing clients.

Changes

1. Go SDK (sdk/go/agent)

Interface Update

  • Extended the MemoryBackend interface to include the following vector operations:
    • SetVector
    • GetVector
    • SearchVector
    • DeleteVector

Memory Client

  • Updated the Memory struct to expose high-level vector methods.
  • Added a chainable scoping method:
    • Scoped(scope, scopeID) for explicit and composable scoping.

Backends

  • InMemoryBackend
    • Implemented vector operations for local development and testing.
  • ControlPlaneMemoryBackend
    • Implemented vector operations via communication with the Control Plane API.

2. Control Plane (control-plane)

Storage Layer

  • Added GetVector to the following interfaces:
    • StorageProvider
    • vectorStore
  • Implemented vector retrieval in:
    • sqliteVectorStore
    • postgresVectorStore
  • Exposed GetVector through LocalStorage.

Handlers

  • Added GetVectorHandler to retrieve vector records by key.
  • Updated DeleteVectorHandler to support RESTful path parameters
    (e.g. DELETE /.../:key).

3. Routes (internal/server/server.go)

New RESTful Endpoints

  • POST /api/v1/memory/vector — Set
  • GET /api/v1/memory/vector/:key — Get
  • POST /api/v1/memory/vector/search — Search
  • DELETE /api/v1/memory/vector/:key — Delete

Backward Compatibility

  • Preserved existing POST-based endpoints
    (e.g. /memory/vector/set) to avoid breaking changes.

Testing

  • ./scripts/test-all.sh
  • Additional verification (please describe):

Checklist

  • I updated documentation where applicable.
  • I added or updated tests (or none were needed).
  • I updated CHANGELOG.md (or this change does not warrant a changelog entry).

Screenshots (if UI-related)

Related issues

Fixes #94

@CLAassistant
Copy link

CLAassistant commented Dec 27, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ SwekeR-463
✅ AbirAbbas
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@santoshkumarradha
Copy link
Member

@AbirAbbas needs update to our doc post merge 🚀

AbirAbbas and others added 3 commits December 27, 2025 16:26
Syncing with latest main to incorporate recent changes including:
- Shell injection fix in AI label workflow
- Vector memory handler unit tests
- Updated changelog format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive test coverage for the new vector memory endpoints:

GetVectorHandler tests:
- TestGetVectorHandler_ReturnsVectorWithMetadata: Full happy path with scope/key/metadata
- TestGetVectorHandler_NotFound: 404 when vector doesn't exist
- TestGetVectorHandler_StorageError: 500 on database failure
- TestGetVectorHandler_DefaultScope: Scope resolution from headers

DeleteVectorHandler tests:
- TestDeleteVectorHandler_RESTfulDelete: DELETE with path parameter
- TestDeleteVectorHandler_BackwardCompatibilityWithBody: POST with JSON body
- TestDeleteVectorHandler_StorageError: 500 on database failure
- TestDeleteVectorHandler_MissingKey: 400 when key is missing

Also updated vectorStorageStub to track GetVector and DeleteVector parameters
for assertion verification.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@AbirAbbas AbirAbbas merged commit 0dd4e62 into Agent-Field:main Dec 27, 2025
12 of 14 checks passed
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.

[Go SDK] Add vector memory support for embeddings storage and search

4 participants