synapset

package
v0.1.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package synapset provides a client for the Synapset MCP-based semantic memory service. It handles session initialization and exposes search/store operations via the MCP JSON-RPC 2.0 protocol over Streamable HTTP.

The client degrades gracefully: if Synapset is unreachable or returns an error, operations log a warning and return empty results rather than blocking the caller.

Index

Constants

View Source
const DefaultPool = "samverk"

DefaultPool is the default pool name for agent memories.

View Source
const DefaultURL = "https://synapset.herbhall.net/mcp"

DefaultURL is used when neither config nor env var specifies a Synapset endpoint.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client communicates with a Synapset MCP server over Streamable HTTP.

func New

func New(cfg Config, logger *zap.Logger) *Client

New creates a Synapset client with the given configuration.

func (*Client) Pool

func (c *Client) Pool() string

Pool returns the configured default pool name.

func (*Client) QueryMemory added in v0.1.21

func (c *Client) QueryMemory(ctx context.Context, pool string, opts map[string]interface{}) (memories []Memory, err error)

QueryMemory performs a structured query against a Synapset pool using exact-match filters (source, category, tags) rather than semantic search.

func (*Client) SearchAll

func (c *Client) SearchAll(ctx context.Context, query string, limit int) (memories []Memory, err error)

SearchAll searches across all pools for memories matching the query.

func (*Client) SearchMemory

func (c *Client) SearchMemory(ctx context.Context, pool, query string, limit int) (memories []Memory, err error)

SearchMemory searches a specific pool for memories matching the query.

func (*Client) StoreMemory

func (c *Client) StoreMemory(ctx context.Context, pool, content, category string, tags []string, source string) error

StoreMemory saves a memory entry to the specified pool.

func (*Client) UpdateMemory added in v0.1.21

func (c *Client) UpdateMemory(ctx context.Context, pool, id string, updates map[string]interface{}) error

UpdateMemory updates an existing memory entry by ID. Fields in the updates map are merged into the existing record; only supplied fields are changed.

type Config

type Config struct {
	URL  string // MCP endpoint URL
	Pool string // default pool for agent memories
}

Config holds Synapset client configuration.

func ConfigFromEnv

func ConfigFromEnv(defaults Config) Config

ConfigFromEnv builds a Config from environment variables, falling back to the provided defaults for any unset value.

type Memory

type Memory struct {
	ID         string   `json:"id"`
	Content    string   `json:"content"`
	Category   string   `json:"category"`
	Tags       []string `json:"tags"`
	Source     string   `json:"source"`
	Similarity float64  `json:"similarity"`
}

Memory represents a single memory entry returned by Synapset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL