rest

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package rest provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT.

Package rest exposes memini's HTTP/JSON API. The surface is API-first: the routes, parameters, and request/response models are generated from api/openapi.yaml (see gen.go / api.gen.go); this file implements the generated ServerInterface on top of the service layer. The MCP surface (internal/api/mcp) shares the same service.

Index

Constants

View Source
const (
	BearerAuthScopes bearerAuthContextKey = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux added in v0.0.6

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL added in v0.0.6

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions added in v0.0.6

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type ActivityEvent added in v0.6.8

type ActivityEvent struct {
	// Detail Kind-specific context — a recall's degraded mode, a supersession's replacement id.
	Detail *map[string]interface{} `json:"detail,omitempty"`

	// Kind The operation an activity event records. Reads: recall, get, briefing. Writes: remember, update, forget, supersede.
	Kind EventKind `json:"kind"`

	// Memories Empty for a recall that matched nothing.
	Memories *[]ActivityMemory `json:"memories,omitempty"`

	// Namespace The namespace the request was made against.
	Namespace string `json:"namespace"`
	OpId      string `json:"op_id"`

	// Query The recall query; absent for every other kind.
	Query *string   `json:"query,omitempty"`
	Time  time.Time `json:"time"`
}

ActivityEvent One logical operation, with the memories it served or wrote.

type ActivityMemory added in v0.6.8

type ActivityMemory struct {
	Id string `json:"id"`

	// Namespace The memory's own namespace, which for a cascading recall may differ from the event's.
	Namespace string `json:"namespace"`

	// Rank 1-based position the memory was served at; absent when not applicable.
	Rank *int `json:"rank,omitempty"`

	// Score Composite relevance score it was served with; recall only.
	Score *float64 `json:"score,omitempty"`

	// Section Which briefing section it appeared under; briefing only.
	Section *string `json:"section,omitempty"`
	Summary string  `json:"summary"`
	Tier    Tier    `json:"tier"`
}

ActivityMemory One memory as it appeared in an event — a snapshot taken at serve time, so a forgotten memory still renders — plus why it was there.

type ActivityResponse added in v0.6.8

type ActivityResponse struct {
	Events  []ActivityEvent `json:"events"`
	HasMore bool            `json:"has_more"`

	// NextCursor Pass as "before" to fetch the next page; absent on the last page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

ActivityResponse defines model for ActivityResponse.

type AnswerQuestionJSONRequestBody added in v0.0.6

type AnswerQuestionJSONRequestBody = AnswerRequest

AnswerQuestionJSONRequestBody defines body for AnswerQuestion for application/json ContentType.

type AnswerQuestionParams added in v0.0.6

type AnswerQuestionParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

AnswerQuestionParams defines parameters for AnswerQuestion.

type AnswerRequest added in v0.0.6

type AnswerRequest struct {
	Levels *[]Level `json:"levels,omitempty"`

	// Limit Caps how many recalled memories ground the answer.
	Limit *int `json:"limit,omitempty"`

	// Metadata Ground only on memories whose top-level metadata contains every listed key=value pair (AND).
	Metadata *map[string]string `json:"metadata,omitempty"`
	Query    string             `json:"query"`

	// Scope Selects the grounding read-set shape, same vocabulary as the recall `scope`: "full" (default) grounds on the request namespace plus its ancestor/home/link cascade; "project" grounds on the request namespace only (no cascade); "everywhere" is "full" plus the request namespace's subtree. "exact" and "subtree" are deprecated aliases ("exact" → "project", "subtree" → "everywhere"). Any other value is rejected with 400. Reaches parity with the MCP `memory_answer` tool's `scope` argument.
	Scope *AnswerRequestScope `json:"scope,omitempty"`

	// Tags Ground only on memories carrying every listed tag (AND).
	Tags  *[]string `json:"tags,omitempty"`
	Tiers *[]Tier   `json:"tiers,omitempty"`
}

AnswerRequest defines model for AnswerRequest.

type AnswerRequestScope added in v0.6.6

type AnswerRequestScope string

AnswerRequestScope Selects the grounding read-set shape, same vocabulary as the recall `scope`: "full" (default) grounds on the request namespace plus its ancestor/home/link cascade; "project" grounds on the request namespace only (no cascade); "everywhere" is "full" plus the request namespace's subtree. "exact" and "subtree" are deprecated aliases ("exact" → "project", "subtree" → "everywhere"). Any other value is rejected with 400. Reaches parity with the MCP `memory_answer` tool's `scope` argument.

const (
	AnswerRequestScopeEverywhere AnswerRequestScope = "everywhere"
	AnswerRequestScopeExact      AnswerRequestScope = "exact"
	AnswerRequestScopeFull       AnswerRequestScope = "full"
	AnswerRequestScopeProject    AnswerRequestScope = "project"
	AnswerRequestScopeSubtree    AnswerRequestScope = "subtree"
)

Defines values for AnswerRequestScope.

func (AnswerRequestScope) Valid added in v0.6.6

func (e AnswerRequestScope) Valid() bool

Valid indicates whether the value is a known member of the AnswerRequestScope enum.

type AnswerResponse added in v0.0.6

type AnswerResponse struct {
	Answer  string         `json:"answer"`
	Sources []ScoredMemory `json:"sources"`
}

AnswerResponse defines model for AnswerResponse.

type ApiKey added in v0.6.7

type ApiKey struct {
	// CreatedAt Omitted for a source=file key: MEMINI_API_KEYS_FILE entries carry no creation timestamp (the file is the source of truth, not a database row) — always present for source=db.
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// DefaultNamespace Namespace applied when a request presents this key with no explicit X-Memini-Namespace header.
	DefaultNamespace *string `json:"default_namespace,omitempty"`
	Disabled         bool    `json:"disabled"`

	// Home Bound home namespace; omitted/empty means unbound.
	Home *string `json:"home,omitempty"`
	Name string  `json:"name"`

	// Source Where the key is stored: "db" is a row in the api_keys table (mutable via this API); "file" comes from MEMINI_API_KEYS_FILE, loaded once at boot and immutable through this API — update/rotate/ delete all reject a "file" key with 409.
	Source ApiKeySource `json:"source"`
}

ApiKey defines model for ApiKey.

type ApiKeySource added in v0.6.7

type ApiKeySource string

ApiKeySource Where the key is stored: "db" is a row in the api_keys table (mutable via this API); "file" comes from MEMINI_API_KEYS_FILE, loaded once at boot and immutable through this API — update/rotate/ delete all reject a "file" key with 409.

const (
	Db   ApiKeySource = "db"
	File ApiKeySource = "file"
)

Defines values for ApiKeySource.

func (ApiKeySource) Valid added in v0.6.7

func (e ApiKeySource) Valid() bool

Valid indicates whether the value is a known member of the ApiKeySource enum.

type ApiKeyWithSecret added in v0.6.7

type ApiKeyWithSecret struct {
	// CreatedAt Omitted for a source=file key: MEMINI_API_KEYS_FILE entries carry no creation timestamp (the file is the source of truth, not a database row) — always present for source=db.
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// DefaultNamespace Namespace applied when a request presents this key with no explicit X-Memini-Namespace header.
	DefaultNamespace *string `json:"default_namespace,omitempty"`
	Disabled         bool    `json:"disabled"`

	// Home Bound home namespace; omitted/empty means unbound.
	Home *string `json:"home,omitempty"`
	Name string  `json:"name"`

	// Secret The plaintext credential, shown exactly once, here — it is never stored (only its SHA-256 hash is) and cannot be recovered or displayed again.
	Secret string `json:"secret"`

	// Source Where the key is stored: "db" is a row in the api_keys table (mutable via this API); "file" comes from MEMINI_API_KEYS_FILE, loaded once at boot and immutable through this API — update/rotate/ delete all reject a "file" key with 409.
	Source ApiKeySource `json:"source"`
}

ApiKeyWithSecret defines model for ApiKeyWithSecret.

type ApiKeysResponse added in v0.6.7

type ApiKeysResponse struct {
	Keys []ApiKey `json:"keys"`
}

ApiKeysResponse defines model for ApiKeysResponse.

type AuthConfig

type AuthConfig struct {
	// APIKey, when non-empty, is required as "Authorization: Bearer <key>".
	APIKey string
	// APIKeyStore, when non-nil, enables table-key auth alongside (or instead
	// of) APIKey: a bearer that doesn't match APIKey is looked up by hex
	// SHA-256 hash. nil means the backing store predates APIKeyStore, or the
	// feature is simply unused — see apiauth.Config.Authenticate for the full
	// enforcement rules, including when table auth becomes mandatory.
	APIKeyStore store.APIKeyStore
	// FileKeys, when non-nil, enables the declarative MEMINI_API_KEYS_FILE
	// keys (K2b) alongside APIKey/APIKeyStore: checked after APIKey and
	// before APIKeyStore — see apiauth.Config.Authenticate. nil (the default)
	// means the feature is unused, matching a server built before it existed.
	FileKeys *apiauth.FileKeySet
	// NamespaceHeader names the request header carrying the tenant namespace.
	NamespaceHeader string
	// DefaultNamespace is used when the header is absent and the
	// authenticated key (if any) carries no per-key default either.
	DefaultNamespace string
	// HomeHeader names the request header carrying the caller's personal
	// namespace (see service.RecallInput.Home). Unlike NamespaceHeader there
	// is no default: an absent or empty header means no home leg for the
	// request. Ignored outright for a key bound to a home namespace — see
	// homeMiddleware's doc for the deliberate asymmetry with namespace
	// resolution below.
	HomeHeader string
	// RequestTimeout bounds how long a single /v1 request may run
	// (chi/middleware.Timeout, applied only to the /v1 group Mount attaches —
	// never to /mcp, /healthz, /readyz, or /metrics). It cancels the request
	// context once the timeout elapses; handlers that don't observe
	// ctx.Done() are not forcibly aborted, they just run to completion as
	// before (see chi's Timeout doc comment). 0 disables it.
	RequestTimeout time.Duration

	// KeyAuth, when non-nil, is used verbatim as the auth policy instead of
	// New building one from APIKey/APIKeyStore/FileKeys. Set this to share
	// ONE apiauth.Config (and its cache pointer) with another surface mounted
	// in the same process — e.g. MCP's HTTPHandlerWithAuth — so a cache
	// invalidation from a key mutation here (see apikeys.go's Invalidate
	// calls) reaches that surface immediately instead of leaving it to ride
	// out apiauth's table-emptiness cache TTL. nil (the default) preserves
	// pre-existing behavior for callers that don't share a Config.
	KeyAuth *apiauth.Config
	// contains filtered or unexported fields
}

AuthConfig configures the optional bearer-token auth and namespace resolution applied by Mount to the /v1 route group. Despite the name it also carries RequestTimeout: Mount's auth/namespace/timeout middleware are all installed together on the same route group, and adding a second options struct just for one field would be more ceremony than reuse — see internal/api/rest/rest.go's Mount for where each field is consumed.

type Briefing added in v0.0.11

type Briefing struct {
	// Children Direct-child namespace rollups (one segment deeper than the briefed namespace), each aggregating its whole subtree: all-tier live total plus up to 3 pinned and 3 recent-durable highlight memories. Ordered by most-recent write, capped at 10 children; omitted at a leaf namespace.
	Children *[]BriefingChild `json:"children,omitempty"`

	// Facts Durable semantic facts, highest-retention first.
	Facts     *[]BriefingItem `json:"facts,omitempty"`
	Namespace string          `json:"namespace"`

	// Pinned Pinned memories (any tier).
	Pinned *[]BriefingItem `json:"pinned,omitempty"`

	// Procedures Procedural how-to memories, highest-retention first.
	Procedures *[]BriefingItem `json:"procedures,omitempty"`

	// Recent Recent episodic activity, newest first.
	Recent *[]BriefingItem `json:"recent,omitempty"`

	// ScopeHeader A human-readable one-line summary of which namespaces this briefing drew from (its resolved read-set scope), e.g. "Scope: acme/phoenix/api ← acme/phoenix(3) ← acme(4) ← personal(2), +1 link" — primary first, then each cascade leg that contributed durable memories (nearest ancestor first, home last, counts per leg), then a "+K link(s)" suffix for contributing links.
	ScopeHeader *string `json:"scope_header,omitempty"`
}

Briefing defines model for Briefing.

type BriefingChild added in v0.6.6

type BriefingChild struct {
	Namespace string    `json:"namespace"`
	Pinned    *[]Memory `json:"pinned,omitempty"`
	Recent    *[]Memory `json:"recent,omitempty"`

	// Total Live memory count in this child namespace.
	Total int `json:"total"`
}

BriefingChild defines model for BriefingChild.

type BriefingItem added in v0.6.6

type BriefingItem struct {
	// From Read-set provenance beyond memory.namespace — same semantics as ScoredMemory.from (see there). Omitted for a primary-namespace item.
	From   *string `json:"from,omitempty"`
	Memory Memory  `json:"memory"`
}

BriefingItem defines model for BriefingItem.

type ChiServerOptions added in v0.0.6

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type ClusterAction added in v0.0.8

type ClusterAction struct {
	RepresentativeId string   `json:"representative_id"`
	Size             int      `json:"size"`
	TombstonedIds    []string `json:"tombstoned_ids"`
}

ClusterAction defines model for ClusterAction.

type CreateApiKeyJSONRequestBody added in v0.6.7

type CreateApiKeyJSONRequestBody = CreateApiKeyRequest

CreateApiKeyJSONRequestBody defines body for CreateApiKey for application/json ContentType.

type CreateApiKeyRequest added in v0.6.7

type CreateApiKeyRequest struct {
	// DefaultNamespace Namespace applied when a request presents this key with no explicit namespace header.
	DefaultNamespace *string `json:"default_namespace,omitempty"`

	// Disabled Create the key already disabled.
	Disabled *bool `json:"disabled,omitempty"`

	// Home Bind the key to a home namespace.
	Home *string `json:"home,omitempty"`
	Name string  `json:"name"`
}

CreateApiKeyRequest defines model for CreateApiKeyRequest.

type DedupReport added in v0.0.8

type DedupReport struct {
	// Actions Per-cluster representative selection. Omitted when no clusters were found.
	Actions       *[]ClusterAction `json:"actions,omitempty"`
	ClustersFound int              `json:"clusters_found"`
	DryRun        bool             `json:"dry_run"`
	MemoriesSeen  int              `json:"memories_seen"`
	Namespaces    int              `json:"namespaces"`
	Tombstoned    int              `json:"tombstoned"`
}

DedupReport defines model for DedupReport.

type DedupRequest added in v0.0.8

type DedupRequest struct {
	// AllNamespaces Run the pass over every namespace instead of just the request's
	// namespace. Defaults to false (scope to the request namespace).
	AllNamespaces *bool `json:"all_namespaces,omitempty"`

	// DryRun Report what would happen without tombstoning anything.
	DryRun *bool `json:"dry_run,omitempty"`

	// MinClusterSize Smallest cluster acted on. 0 falls back to 2.
	MinClusterSize *int `json:"min_cluster_size,omitempty"`

	// NeighboursPerAnchor Per-anchor vector-search fan-out. 0 falls back to 20.
	NeighboursPerAnchor *int `json:"neighbours_per_anchor,omitempty"`

	// Similarity Cosine-like threshold for cluster membership. Higher = stricter
	// (fewer, tighter clusters). 0 falls back to 0.85.
	Similarity *float64 `json:"similarity,omitempty"`

	// Tiers Restrict the pass to these tiers; empty means all.
	Tiers *[]Tier `json:"tiers,omitempty"`
}

DedupRequest Optional knobs for one dedup pass. The zero value uses the production defaults (similarity 0.85, cluster size ≥ 2, all tiers, 20 neighbours per anchor, dry_run false), scoped to the request's namespace.

type DeleteByTagResponse added in v0.0.11

type DeleteByTagResponse struct {
	// Deleted Number of memories deleted
	Deleted int `json:"deleted"`
}

DeleteByTagResponse defines model for DeleteByTagResponse.

type DeleteLinkJSONBody added in v0.6.6

type DeleteLinkJSONBody struct {
	// Dst Target namespace to unlink.
	Dst *string `json:"dst,omitempty"`
}

DeleteLinkJSONBody defines parameters for DeleteLink.

type DeleteLinkJSONRequestBody added in v0.6.6

type DeleteLinkJSONRequestBody DeleteLinkJSONBody

DeleteLinkJSONRequestBody defines body for DeleteLink for application/json ContentType.

type DeleteLinkParams added in v0.6.6

type DeleteLinkParams struct {
	// Dst Target namespace to unlink. Required, via query or JSON body.
	Dst *string `form:"dst,omitempty" json:"dst,omitempty"`

	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

DeleteLinkParams defines parameters for DeleteLink.

type DeleteNamespaceParams added in v0.6.2

type DeleteNamespaceParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

DeleteNamespaceParams defines parameters for DeleteNamespace.

type DeleteNamespaceResponse added in v0.0.8

type DeleteNamespaceResponse struct {
	// Deleted Number of memories deleted
	Deleted int `json:"deleted"`
}

DeleteNamespaceResponse defines model for DeleteNamespaceResponse.

type Error added in v0.0.6

type Error struct {
	Error *string `json:"error,omitempty"`
}

Error defines model for Error.

type EventKind added in v0.6.8

type EventKind string

EventKind The operation an activity event records. Reads: recall, get, briefing. Writes: remember, update, forget, supersede.

const (
	EventKindBriefing  EventKind = "briefing"
	EventKindForget    EventKind = "forget"
	EventKindGet       EventKind = "get"
	EventKindRecall    EventKind = "recall"
	EventKindRemember  EventKind = "remember"
	EventKindSupersede EventKind = "supersede"
	EventKindUpdate    EventKind = "update"
)

Defines values for EventKind.

func (EventKind) Valid added in v0.6.8

func (e EventKind) Valid() bool

Valid indicates whether the value is a known member of the EventKind enum.

type ForgetByTagParams added in v0.0.11

type ForgetByTagParams struct {
	// Tag Exact tag a memory must carry to be deleted.
	Tag string `form:"tag" json:"tag"`

	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

ForgetByTagParams defines parameters for ForgetByTag.

type ForgetMemoryParams added in v0.0.6

type ForgetMemoryParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

ForgetMemoryParams defines parameters for ForgetMemory.

type FsckReport added in v0.0.6

type FsckReport struct {
	DuplicateGroups  *[][]string `json:"duplicate_groups,omitempty"`
	ExpiredPurged    int         `json:"expired_purged"`
	Namespaces       int         `json:"namespaces"`
	ShortTermEvicted int         `json:"short_term_evicted"`
}

FsckReport defines model for FsckReport.

type GetBriefingParams added in v0.0.11

type GetBriefingParams struct {
	// PerSection Default cap applied to every section when its dedicated cap is unset. Default 5.
	PerSection *int `form:"per_section,omitempty" json:"per_section,omitempty"`

	// PerSectionPinned Max pinned memories. Overrides per_section. 0 disables the section.
	PerSectionPinned *int `form:"per_section_pinned,omitempty" json:"per_section_pinned,omitempty"`

	// PerSectionFacts Max durable semantic facts. Overrides per_section. 0 disables the section.
	PerSectionFacts *int `form:"per_section_facts,omitempty" json:"per_section_facts,omitempty"`

	// PerSectionProcedures Max procedural how-to memories. Overrides per_section. 0 disables the section.
	PerSectionProcedures *int `form:"per_section_procedures,omitempty" json:"per_section_procedures,omitempty"`

	// PerSectionRecent Max recent episodic entries. Overrides per_section. 0 disables the section.
	PerSectionRecent *int `form:"per_section_recent,omitempty" json:"per_section_recent,omitempty"`

	// Scope "full" (default) briefs the namespace plus its ancestor/home/link cascade; "project" briefs only the namespace (no cascade); "everywhere" is "full" plus namespaces nested under it ("project" also reads "project/agent"). "exact" and "subtree" are deprecated aliases kept for back-compat: "exact" behaves as "project" (its original, pre-cascade meaning) and "subtree" behaves as "everywhere". Any other value is rejected with 400.
	Scope *GetBriefingParamsScope `form:"scope,omitempty" json:"scope,omitempty"`

	// Namespaces Repeatable. Brief exactly these namespaces instead of the default read set (the namespace, its subtree, and the global namespace). An entry ending in "/*" also includes namespaces nested under it. Writes are unaffected.
	Namespaces *[]string `form:"namespaces,omitempty" json:"namespaces,omitempty"`

	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

GetBriefingParams defines parameters for GetBriefing.

type GetBriefingParamsScope added in v0.6.0

type GetBriefingParamsScope string

GetBriefingParamsScope defines parameters for GetBriefing.

const (
	Everywhere GetBriefingParamsScope = "everywhere"
	Exact      GetBriefingParamsScope = "exact"
	Full       GetBriefingParamsScope = "full"
	Project    GetBriefingParamsScope = "project"
	Subtree    GetBriefingParamsScope = "subtree"
)

Defines values for GetBriefingParamsScope.

func (GetBriefingParamsScope) Valid added in v0.6.0

func (e GetBriefingParamsScope) Valid() bool

Valid indicates whether the value is a known member of the GetBriefingParamsScope enum.

type GetMemoryHistoryParams added in v0.4.19

type GetMemoryHistoryParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

GetMemoryHistoryParams defines parameters for GetMemoryHistory.

type GetMemoryParams added in v0.0.6

type GetMemoryParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

GetMemoryParams defines parameters for GetMemory.

type GetReadSetParams added in v0.6.6

type GetReadSetParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

GetReadSetParams defines parameters for GetReadSet.

type GetStatsParams added in v0.0.6

type GetStatsParams struct {
	// AllNamespaces Aggregate counts across every namespace, ignoring the namespace header. Returns a single merged overview (namespace reported as "") so the admin UI's "All projects" view fetches one response instead of one request per namespace.
	AllNamespaces *bool `form:"all_namespaces,omitempty" json:"all_namespaces,omitempty"`

	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

GetStatsParams defines parameters for GetStats.

type InvalidParamFormatError added in v0.0.6

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error added in v0.0.6

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap added in v0.0.6

func (e *InvalidParamFormatError) Unwrap() error

type Level added in v0.5.10

type Level string

Level defines model for Level.

const (
	Deduced  Level = "deduced"
	Explicit Level = "explicit"
)

Defines values for Level.

func (Level) Valid added in v0.5.10

func (e Level) Valid() bool

Valid indicates whether the value is a known member of the Level enum.

type ListActivityParams added in v0.6.8

type ListActivityParams struct {
	// Kind Repeatable and/or comma-separated event-kind filter; omitted means all kinds.
	Kind *[]EventKind `form:"kind,omitempty" json:"kind,omitempty"`

	// Tier Repeatable and/or comma-separated tier filter. Selects whole operations that touched a memory of a listed tier — a matching event is returned with every memory it served, so its counts stay truthful.
	Tier *[]Tier `form:"tier,omitempty" json:"tier,omitempty"`

	// Q Free-text filter, case-insensitive. Selects whole operations whose recall query or any served memory's summary contains it.
	Q *string `form:"q,omitempty" json:"q,omitempty"`

	// Since Only events recorded at or after this instant.
	Since *time.Time `form:"since,omitempty" json:"since,omitempty"`

	// Namespace With all_namespaces=true, restrict the feed to these namespaces (repeatable, exact match); ignored otherwise.
	Namespace *[]string `form:"namespace,omitempty" json:"namespace,omitempty"`

	// Limit Caps the returned events (operations, not rows). Default 50, max 200.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Before Opaque cursor from a previous response's next_cursor; returns the page of events strictly older than it.
	Before *string `form:"before,omitempty" json:"before,omitempty"`

	// AllNamespaces Aggregate across every namespace, ignoring the namespace header.
	AllNamespaces *bool `form:"all_namespaces,omitempty" json:"all_namespaces,omitempty"`

	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

ListActivityParams defines parameters for ListActivity.

type ListLinksParams added in v0.6.6

type ListLinksParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

ListLinksParams defines parameters for ListLinks.

type ListMemoriesParams added in v0.0.6

type ListMemoriesParams struct {
	// Tier Repeatable and/or comma-separated tier filter; omitted means all tiers.
	Tier *[]Tier `form:"tier,omitempty" json:"tier,omitempty"`

	// Level Repeatable and/or comma-separated level filter; omitted means all levels.
	Level *[]Level `form:"level,omitempty" json:"level,omitempty"`

	// Tag Repeatable and/or comma-separated tag filter; a memory must carry every listed tag (AND).
	Tag *[]string `form:"tag,omitempty" json:"tag,omitempty"`

	// Meta Repeatable metadata filter in "key=value" form; a memory's top-level metadata must contain every listed pair (AND). Only string values match.
	Meta              *[]string `form:"meta,omitempty" json:"meta,omitempty"`
	IncludeExpired    *bool     `form:"include_expired,omitempty" json:"include_expired,omitempty"`
	IncludeSuperseded *bool     `form:"include_superseded,omitempty" json:"include_superseded,omitempty"`

	// Limit Caps the result count; 0 or absent returns all matches.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// AllNamespaces Aggregate across every namespace, ignoring the namespace header. The server merges all namespaces and applies limit as a single global cap under the requested sort, so the admin UI's "All projects" view fetches one response instead of one request per namespace.
	AllNamespaces *bool `form:"all_namespaces,omitempty" json:"all_namespaces,omitempty"`

	// Namespace With all_namespaces=true, restrict the aggregate to these namespaces (repeatable, exact match); ignored otherwise. Lets the browser narrow an "All projects" listing without changing the active namespace.
	Namespace *[]string `form:"namespace,omitempty" json:"namespace,omitempty"`

	// MemoryType Repeatable and/or comma-separated metadata.memory_type filter; a memory matches if its type is ANY of the listed values (OR). Distinct from "meta", which ANDs one value per key.
	MemoryType *[]string `form:"memory_type,omitempty" json:"memory_type,omitempty"`

	// CreatedAfter Only memories created at or after this instant.
	CreatedAfter *time.Time `form:"created_after,omitempty" json:"created_after,omitempty"`

	// AccessedAfter Only memories last accessed at or after this instant.
	AccessedAfter *time.Time `form:"accessed_after,omitempty" json:"accessed_after,omitempty"`

	// Sort Column to order by. Defaults to created_at.
	Sort *ListMemoriesParamsSort `form:"sort,omitempty" json:"sort,omitempty"`

	// Order Sort direction. Defaults to desc (newest / highest first).
	Order *ListMemoriesParamsOrder `form:"order,omitempty" json:"order,omitempty"`

	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

ListMemoriesParams defines parameters for ListMemories.

type ListMemoriesParamsOrder added in v0.6.8

type ListMemoriesParamsOrder string

ListMemoriesParamsOrder defines parameters for ListMemories.

const (
	Asc  ListMemoriesParamsOrder = "asc"
	Desc ListMemoriesParamsOrder = "desc"
)

Defines values for ListMemoriesParamsOrder.

func (ListMemoriesParamsOrder) Valid added in v0.6.8

func (e ListMemoriesParamsOrder) Valid() bool

Valid indicates whether the value is a known member of the ListMemoriesParamsOrder enum.

type ListMemoriesParamsSort added in v0.6.8

type ListMemoriesParamsSort string

ListMemoriesParamsSort defines parameters for ListMemories.

const (
	AccessCount    ListMemoriesParamsSort = "access_count"
	CreatedAt      ListMemoriesParamsSort = "created_at"
	Importance     ListMemoriesParamsSort = "importance"
	LastAccessedAt ListMemoriesParamsSort = "last_accessed_at"
	UpdatedAt      ListMemoriesParamsSort = "updated_at"
)

Defines values for ListMemoriesParamsSort.

func (ListMemoriesParamsSort) Valid added in v0.6.8

func (e ListMemoriesParamsSort) Valid() bool

Valid indicates whether the value is a known member of the ListMemoriesParamsSort enum.

type ListResponse added in v0.0.6

type ListResponse struct {
	Memories []Memory `json:"memories"`
}

ListResponse defines model for ListResponse.

type Memory added in v0.0.6

type Memory struct {
	AccessCount int `json:"access_count"`

	// AutoSuperseded Optional. Present only on POST /v1/memories responses when the write's nearest same-tier candidate scored at/above MEMINI_WRITE_DEDUP_SCORE with MEMINI_WRITE_DEDUP_ACTION="supersede" and the old memory was tombstoned in the background. The caller still receives the new memory.
	AutoSuperseded *bool `json:"auto_superseded,omitempty"`

	// Confidence Corroboration of a durable fact in [0,1]; null when not tracked.
	Confidence     *float64   `json:"confidence,omitempty"`
	Content        string     `json:"content"`
	CreatedAt      time.Time  `json:"created_at"`
	ExpiresAt      *time.Time `json:"expires_at,omitempty"`
	Id             string     `json:"id"`
	Importance     float64    `json:"importance"`
	LastAccessedAt time.Time  `json:"last_accessed_at"`

	// Level Derivation provenance: explicit (user-stated / heuristic) vs deduced (LLM-distilled). Null/omitted when the row predates the tag or when unset.
	Level *Level `json:"level,omitempty"`

	// MergeHint Optional. Returned on POST /v1/memories when the write's nearest same-tier candidate scored at/above MEMINI_WRITE_DEDUP_SCORE and MEMINI_WRITE_DEDUP_ACTION is "hint". The caller can decide whether to merge into the near-duplicate via memory_update.
	MergeHint *MergeHint              `json:"merge_hint,omitempty"`
	Metadata  *map[string]interface{} `json:"metadata,omitempty"`
	Namespace string                  `json:"namespace"`

	// Reinforced Optional. Present only on POST /v1/memories responses when the fact was already known and NO new memory was created: the existing memory was strengthened (reinforced and corroborated) and is what this response returns. Two paths reach it — the exact-restatement fingerprint fast path, and MEMINI_WRITE_DEDUP_ACTION="coalesce" when the incoming phrasing is not richer than the stored one. Without this flag a 201 would read as "created", which is exactly what did not happen, and the id would appear to belong to a memory the caller wrote when it does not.
	Reinforced   *bool     `json:"reinforced,omitempty"`
	Summary      *string   `json:"summary,omitempty"`
	SupersededBy *string   `json:"superseded_by,omitempty"`
	Tags         *[]string `json:"tags,omitempty"`
	Tier         Tier      `json:"tier"`
	UpdatedAt    time.Time `json:"updated_at"`

	// ValidFrom Start of the wall-clock interval the fact was true; null means open ("always, until valid_to"). Used by time-travel (as_of) recall.
	ValidFrom *time.Time `json:"valid_from,omitempty"`

	// ValidTo End of the interval the fact was true; null means open ("still true"). Stamped automatically when a fact is superseded.
	ValidTo *time.Time `json:"valid_to,omitempty"`
}

Memory defines model for Memory.

type MergeHint added in v0.4.19

type MergeHint struct {
	// Score Fused similarity between the new write and the near-duplicate (0..1).
	Score *float64 `json:"score,omitempty"`

	// SimilarContent Preview (≤200 chars) of the near-duplicate memory's content.
	SimilarContent *string `json:"similar_content,omitempty"`

	// SimilarId ID of the near-duplicate memory.
	SimilarId *string `json:"similar_id,omitempty"`
	Tier      *Tier   `json:"tier,omitempty"`
}

MergeHint Optional. Returned on POST /v1/memories when the write's nearest same-tier candidate scored at/above MEMINI_WRITE_DEDUP_SCORE and MEMINI_WRITE_DEDUP_ACTION is "hint". The caller can decide whether to merge into the near-duplicate via memory_update.

type MiddlewareFunc added in v0.0.6

type MiddlewareFunc func(http.Handler) http.Handler

type MoveNamespaceJSONBody added in v0.6.0

type MoveNamespaceJSONBody struct {
	DryRun *bool `json:"dry_run,omitempty"`

	// To Target namespace.
	To string `json:"to"`
}

MoveNamespaceJSONBody defines parameters for MoveNamespace.

type MoveNamespaceJSONRequestBody added in v0.6.0

type MoveNamespaceJSONRequestBody MoveNamespaceJSONBody

MoveNamespaceJSONRequestBody defines body for MoveNamespace for application/json ContentType.

type MoveNamespaceParams added in v0.6.2

type MoveNamespaceParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

MoveNamespaceParams defines parameters for MoveNamespace.

type Namespace added in v0.0.6

type Namespace = string

Namespace defines model for Namespace.

type NamespaceLink struct {
	CreatedAt time.Time `json:"created_at"`
	Dst       string    `json:"dst"`
	Note      *string   `json:"note,omitempty"`
	Src       string    `json:"src"`

	// Tiers Tier restriction on the link; empty/omitted means the durable default (semantic, procedural).
	Tiers *[]Tier `json:"tiers,omitempty"`
}

NamespaceLink defines model for NamespaceLink.

type NamespaceLinksResponse added in v0.6.6

type NamespaceLinksResponse struct {
	Links []NamespaceLink `json:"links"`
}

NamespaceLinksResponse defines model for NamespaceLinksResponse.

type NamespacesResponse added in v0.0.6

type NamespacesResponse struct {
	Namespaces []string `json:"namespaces"`
}

NamespacesResponse defines model for NamespacesResponse.

type PutLinkJSONBody added in v0.6.6

type PutLinkJSONBody struct {
	// Dst Target namespace.
	Dst string `json:"dst"`

	// Note Free-text annotation for operators.
	Note *string `json:"note,omitempty"`

	// Tiers Restrict which tiers cross the link; empty/omitted means the durable default (semantic, procedural) — non-durable tiers never cross a link regardless.
	Tiers *[]Tier `json:"tiers,omitempty"`
}

PutLinkJSONBody defines parameters for PutLink.

type PutLinkJSONRequestBody added in v0.6.6

type PutLinkJSONRequestBody PutLinkJSONBody

PutLinkJSONRequestBody defines body for PutLink for application/json ContentType.

type PutLinkParams added in v0.6.6

type PutLinkParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

PutLinkParams defines parameters for PutLink.

type ReadSetEntryItem added in v0.6.6

type ReadSetEntryItem struct {
	Namespace string `json:"namespace"`

	// Origin Why a namespace is in the read-set: "primary" is the request namespace (and its subtree, when expanded), "ancestor" is a path-prefix cascade leg, "home" is the caller's personal namespace, "link" is a stored namespace link, and "call" is an explicit per-call namespace.
	Origin ReadSetOrigin `json:"origin"`

	// Tiers Tier restriction applied to this namespace; omitted means the request's own tier filter, unrestricted beyond that.
	Tiers *[]Tier `json:"tiers,omitempty"`
}

ReadSetEntryItem defines model for ReadSetEntryItem.

type ReadSetOrigin added in v0.6.6

type ReadSetOrigin string

ReadSetOrigin Why a namespace is in the read-set: "primary" is the request namespace (and its subtree, when expanded), "ancestor" is a path-prefix cascade leg, "home" is the caller's personal namespace, "link" is a stored namespace link, and "call" is an explicit per-call namespace.

const (
	Ancestor ReadSetOrigin = "ancestor"
	Call     ReadSetOrigin = "call"
	Home     ReadSetOrigin = "home"
	Link     ReadSetOrigin = "link"
	Primary  ReadSetOrigin = "primary"
)

Defines values for ReadSetOrigin.

func (ReadSetOrigin) Valid added in v0.6.6

func (e ReadSetOrigin) Valid() bool

Valid indicates whether the value is a known member of the ReadSetOrigin enum.

type ReadSetResponse added in v0.6.6

type ReadSetResponse struct {
	Entries []ReadSetEntryItem `json:"entries"`
}

ReadSetResponse defines model for ReadSetResponse.

type ReassignMemoryJSONBody added in v0.6.0

type ReassignMemoryJSONBody struct {
	// To Target namespace.
	To string `json:"to"`
}

ReassignMemoryJSONBody defines parameters for ReassignMemory.

type ReassignMemoryJSONRequestBody added in v0.6.0

type ReassignMemoryJSONRequestBody ReassignMemoryJSONBody

ReassignMemoryJSONRequestBody defines body for ReassignMemory for application/json ContentType.

type ReassignMemoryParams added in v0.6.0

type ReassignMemoryParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

ReassignMemoryParams defines parameters for ReassignMemory.

type RememberMemoryJSONRequestBody added in v0.0.6

type RememberMemoryJSONRequestBody = RememberRequest

RememberMemoryJSONRequestBody defines body for RememberMemory for application/json ContentType.

type RememberMemoryParams added in v0.0.6

type RememberMemoryParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

RememberMemoryParams defines parameters for RememberMemory.

type RememberRequest added in v0.0.6

type RememberRequest struct {
	// Confidence Seed corroboration for a durable fact (e.g. a trusted import). Omit to use the default seed; ignored for short-term tiers.
	Confidence *float64 `json:"confidence,omitempty"`
	Content    string   `json:"content"`

	// Id Upserts an existing memory when provided.
	Id         *string  `json:"id,omitempty"`
	Importance *float64 `json:"importance,omitempty"`

	// Level Label the derivation provenance (explicit vs deduced) at write time. Omit to leave unset (default, legacy rows, auto-tagged by service).
	Level    *Level                  `json:"level,omitempty"`
	Metadata *map[string]interface{} `json:"metadata,omitempty"`
	Summary  *string                 `json:"summary,omitempty"`
	Tags     *[]string               `json:"tags,omitempty"`

	// Tier Omit to let the server choose: the content is classified by the marker heuristic (a terse, unhedged decision/preference/problem lands in semantic/procedural, stamped metadata.tier_classified=marker), falling back to working. Classification never picks working (the default) — it only raises to semantic/procedural.
	Tier *Tier `json:"tier,omitempty"`

	// TtlSeconds Overrides the tier default TTL; negative means never expire.
	TtlSeconds *int `json:"ttl_seconds,omitempty"`

	// ValidFrom Start of the interval the fact was true. Defaults to now; backdate it to record a historical fact so time-travel (as_of) recall surfaces it.
	ValidFrom *time.Time `json:"valid_from,omitempty"`

	// ValidTo End of the interval the fact was true (for recording a fact that was true only in the past). Omit for a fact that is still true.
	ValidTo *time.Time `json:"valid_to,omitempty"`

	// Visibility Write-side namespace scoping. Omit or "project" (default) writes to the request namespace itself. "personal" writes to the caller's home namespace (X-Memini-Home header / MEMINI_HOME on the client) instead — an error if no home namespace is configured. Any other value must name an ancestor of the request namespace, either its full path or an unambiguous last path segment (e.g. "acme" for request namespace "acme/phoenix/api"), and the write lands there instead. Ignored for non-durable writes: an episodic/working memory always stays in the request namespace regardless of visibility.
	Visibility *string `json:"visibility,omitempty"`
}

RememberRequest defines model for RememberRequest.

type RenamespaceReport added in v0.6.0

type RenamespaceReport struct {
	// DryRun Whether this was a dry run.
	DryRun *bool `json:"dry_run,omitempty"`

	// Moved Number of memories moved.
	Moved *int `json:"moved,omitempty"`

	// Skipped Memories left in place (no grouping key, or already in place).
	Skipped *int `json:"skipped,omitempty"`

	// Targets Memories moved into each destination namespace.
	Targets *map[string]int `json:"targets,omitempty"`
}

RenamespaceReport defines model for RenamespaceReport.

type RequiredHeaderError added in v0.0.6

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error added in v0.0.6

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap added in v0.0.6

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError added in v0.0.6

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error added in v0.0.6

func (e *RequiredParamError) Error() string

type RunDedupJSONRequestBody added in v0.0.8

type RunDedupJSONRequestBody = DedupRequest

RunDedupJSONRequestBody defines body for RunDedup for application/json ContentType.

type RunDedupParams added in v0.0.8

type RunDedupParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

RunDedupParams defines parameters for RunDedup.

type RunFsckParams added in v0.0.6

type RunFsckParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

RunFsckParams defines parameters for RunFsck.

type ScoredMemory added in v0.0.6

type ScoredMemory struct {
	// From Read-set provenance beyond memory.namespace: omitted for a hit from the request (primary) namespace — the common case, no annotation needed — the ancestor/home namespace name itself for those two origins ("acme", "personal/kit"), and a prefixed form for a stored link or an explicit per-call namespace ("link:shared/golang", "call:acme/other"). Only populated when the read drew from a resolved read-set (recall/answer); omitted otherwise.
	From   *string `json:"from,omitempty"`
	Memory Memory  `json:"memory"`
	Score  float64 `json:"score"`
}

ScoredMemory defines model for ScoredMemory.

type SearchMemoriesJSONRequestBody added in v0.0.6

type SearchMemoriesJSONRequestBody = SearchRequest

SearchMemoriesJSONRequestBody defines body for SearchMemories for application/json ContentType.

type SearchMemoriesParams added in v0.0.6

type SearchMemoriesParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

SearchMemoriesParams defines parameters for SearchMemories.

type SearchRequest added in v0.0.6

type SearchRequest struct {
	// AsOf Time-travel recall: return facts whose validity window contained this instant (including ones since superseded), for "what was true then" queries.
	AsOf *time.Time `json:"as_of,omitempty"`

	// ExcludeMetadata Drop memories whose top-level metadata carries any of these key=value pairs (the inverse of metadata). Lets a caller keep its own just-written memories out of recall — e.g. excluding the current session's captured turns so they are not echoed back as memory.
	ExcludeMetadata *map[string]string `json:"exclude_metadata,omitempty"`
	IncludeExpired  *bool              `json:"include_expired,omitempty"`

	// IncludeFreshTurns When true, disable the server-side temporal echo guard for this call: just-captured episodic turn captures (metadata.format="turn" younger than the server's window, default 5m) are NOT dropped. Default (false) drops them — a just-captured turn is live context, not long-term memory, and echoing it back makes the agent parrot itself. Opt in only when you genuinely need fresh turns.
	IncludeFreshTurns *bool    `json:"include_fresh_turns,omitempty"`
	IncludeSuperseded *bool    `json:"include_superseded,omitempty"`
	Levels            *[]Level `json:"levels,omitempty"`
	Limit             *int     `json:"limit,omitempty"`

	// Metadata A memory's top-level metadata must contain every listed key=value pair (AND).
	Metadata *map[string]string `json:"metadata,omitempty"`

	// MinScore Per-call relevance floor on the fused score. Candidates below it are dropped server-side before re-ranking. 0 (or unset) falls back to the server's baked relevance floor (0.1). Only meaningful with score fusion (RRF scores are not comparable to this threshold).
	MinScore *float64 `json:"min_score,omitempty"`

	// Namespaces Search exactly these namespaces instead of the default read set (the request namespace, its subtree, and the global namespace). An entry ending in "/*" also includes namespaces nested under it. Writes are unaffected.
	Namespaces *[]string `json:"namespaces,omitempty"`
	Query      string    `json:"query"`

	// QueryRewrite When true and an LLM is configured, rewrite the query into 2-3 diverse variants before recall and fuse results via RRF. Cheapest read-path LLM lever; opt-in per call.
	QueryRewrite *bool `json:"query_rewrite,omitempty"`

	// Scope "full" (default) searches the request namespace plus its ancestor/home/link cascade; "project" searches only the request namespace (no cascade); "everywhere" is "full" plus the request namespace's subtree, for the multi-agent read-shared-plus-private pattern. "exact" and "subtree" are deprecated aliases kept for back-compat: "exact" behaves as "project" (its original, pre-cascade meaning — the request namespace only) and "subtree" behaves as "everywhere". Any other value is rejected with 400.
	Scope *SearchRequestScope `json:"scope,omitempty"`

	// Tags A memory must carry every listed tag (AND).
	Tags  *[]string `json:"tags,omitempty"`
	Tiers *[]Tier   `json:"tiers,omitempty"`
}

SearchRequest defines model for SearchRequest.

type SearchRequestScope added in v0.0.11

type SearchRequestScope string

SearchRequestScope "full" (default) searches the request namespace plus its ancestor/home/link cascade; "project" searches only the request namespace (no cascade); "everywhere" is "full" plus the request namespace's subtree, for the multi-agent read-shared-plus-private pattern. "exact" and "subtree" are deprecated aliases kept for back-compat: "exact" behaves as "project" (its original, pre-cascade meaning — the request namespace only) and "subtree" behaves as "everywhere". Any other value is rejected with 400.

const (
	SearchRequestScopeEverywhere SearchRequestScope = "everywhere"
	SearchRequestScopeExact      SearchRequestScope = "exact"
	SearchRequestScopeFull       SearchRequestScope = "full"
	SearchRequestScopeProject    SearchRequestScope = "project"
	SearchRequestScopeSubtree    SearchRequestScope = "subtree"
)

Defines values for SearchRequestScope.

func (SearchRequestScope) Valid added in v0.0.11

func (e SearchRequestScope) Valid() bool

Valid indicates whether the value is a known member of the SearchRequestScope enum.

type SearchResponse added in v0.0.6

type SearchResponse struct {
	// Degraded Set to "keyword_only" when the query embed failed or timed out and this search fell back to keyword-only matching; omitted on a healthy (vector+keyword) search.
	Degraded *string `json:"degraded,omitempty"`

	// Note Human-readable explanation of `degraded`; omitted alongside it on a healthy search.
	Note    *string        `json:"note,omitempty"`
	Results []ScoredMemory `json:"results"`
}

SearchResponse defines model for SearchResponse.

type Server added in v0.0.6

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

Server implements the spec-generated ServerInterface backed by a service.Service.

func New

func New(svc *service.Service, auth AuthConfig) *Server

New builds the REST server.

func (*Server) AnswerQuestion added in v0.0.6

func (h *Server) AnswerQuestion(w http.ResponseWriter, r *http.Request, _ AnswerQuestionParams)

AnswerQuestion implements POST /v1/answer.

func (*Server) CreateApiKey added in v0.6.7

func (h *Server) CreateApiKey(w http.ResponseWriter, r *http.Request)

CreateApiKey implements POST /v1/keys: generates a fresh secret (the one canonical apiauth.GenerateSecret), stores the hash, and returns the secret exactly once alongside the key's metadata. Admin-gated. 409 if the name is already taken by a table OR file key.

func (*Server) DeleteApiKey added in v0.6.7

func (h *Server) DeleteApiKey(w http.ResponseWriter, r *http.Request, name string)

DeleteApiKey implements DELETE /v1/keys/{name}. Admin-gated. 404 absent, 409 for a file-sourced key.

func (h *Server) DeleteLink(w http.ResponseWriter, r *http.Request, params DeleteLinkParams)

DeleteLink implements DELETE /v1/links. dst comes from the query parameter or, when absent, the optional JSON body.

func (*Server) DeleteNamespace added in v0.0.8

func (h *Server) DeleteNamespace(w http.ResponseWriter, r *http.Request, _ DeleteNamespaceParams)

DeleteNamespace implements DELETE /v1/namespaces. The namespace comes from the X-Memini-Namespace header (via the middleware), not the URL path, so a hierarchical name like "work/memini" needs no %2F path encoding.

func (*Server) ForgetByTag added in v0.0.11

func (h *Server) ForgetByTag(w http.ResponseWriter, r *http.Request, params ForgetByTagParams)

ForgetByTag implements DELETE /v1/memories?tag=... — bulk-delete every memory in the namespace carrying the tag. The tag is required (spec-enforced) so a missing tag cannot delete the whole namespace.

func (*Server) ForgetMemory added in v0.0.6

func (h *Server) ForgetMemory(w http.ResponseWriter, r *http.Request, boundID string, _ ForgetMemoryParams)

ForgetMemory implements DELETE /v1/memories/{id}.

func (*Server) GetBriefing added in v0.0.11

func (h *Server) GetBriefing(w http.ResponseWriter, r *http.Request, params GetBriefingParams)

GetBriefing implements GET /v1/namespaces/briefing. The namespace comes from the X-Memini-Namespace header (via the middleware), not the URL path.

func (*Server) GetMemory added in v0.0.6

func (h *Server) GetMemory(w http.ResponseWriter, r *http.Request, boundID string, _ GetMemoryParams)

GetMemory implements GET /v1/memories/{id}.

func (*Server) GetMemoryHistory added in v0.4.19

func (h *Server) GetMemoryHistory(w http.ResponseWriter, r *http.Request, boundID string, _ GetMemoryHistoryParams)

GetMemoryHistory implements GET /v1/memories/{id}/history.

func (*Server) GetReadSet added in v0.6.6

func (h *Server) GetReadSet(w http.ResponseWriter, r *http.Request, _ GetReadSetParams)

GetReadSet implements GET /v1/namespaces/read-set. Header-scoped like GetBriefing: the namespace comes from X-Memini-Namespace, and X-Memini-Home, when set, contributes the home leg.

func (*Server) GetStats added in v0.0.6

func (h *Server) GetStats(w http.ResponseWriter, r *http.Request, params GetStatsParams)

GetStats implements GET /v1/stats.

func (*Server) ListActivity added in v0.6.8

func (h *Server) ListActivity(w http.ResponseWriter, r *http.Request, params ListActivityParams)

ListActivity implements GET /v1/activity: the newest page of the activity log, grouped into whole operations.

func (*Server) ListApiKeys added in v0.6.7

func (h *Server) ListApiKeys(w http.ResponseWriter, r *http.Request)

ListApiKeys implements GET /v1/keys: every table key (source=db) plus every declaratively managed file key (source=file, K2b) — never a secret or hash. Admin-gated, see requireAdminOrDev.

func (h *Server) ListLinks(w http.ResponseWriter, r *http.Request, _ ListLinksParams)

ListLinks implements GET /v1/links: outgoing links from the request namespace.

func (*Server) ListMemories added in v0.0.6

func (h *Server) ListMemories(w http.ResponseWriter, r *http.Request, params ListMemoriesParams)

ListMemories implements GET /v1/memories.

func (*Server) ListNamespaces added in v0.0.6

func (h *Server) ListNamespaces(w http.ResponseWriter, r *http.Request)

ListNamespaces implements GET /v1/namespaces.

Unlike the other /v1 routes it is not namespace-scoped: it deliberately spans tenants. memini authenticates with a single MEMINI_API_KEY that already grants access to any namespace (the caller picks it via the namespace header), so enumerating namespaces confers no extra privilege. If memini ever grows per-tenant credentials, this endpoint must be gated behind an admin scope.

func (*Server) Mount added in v0.0.6

func (h *Server) Mount(r chi.Router)

Mount attaches the spec-generated /v1 routes to r, wrapped in namespace + auth middleware. Binding failures on declared parameters (e.g. ?limit=abc) are rejected with 400 by the generated wrappers. Callers that also mount long-lived streaming routes (e.g. the MCP SSE handler) must mount those directly on r, outside this group — Timeout below would sever them.

func (*Server) MoveNamespace added in v0.6.0

func (h *Server) MoveNamespace(w http.ResponseWriter, r *http.Request, _ MoveNamespaceParams)

MoveNamespace implements POST /v1/namespaces/move. Relocates every memory in the request namespace (X-Memini-Namespace header) to the target namespace.

func (h *Server) PutLink(w http.ResponseWriter, r *http.Request, _ PutLinkParams)

PutLink implements POST /v1/links. Creates or replaces a durable-tier read link from the request namespace (src) to the given destination.

func (*Server) ReassignMemory added in v0.6.0

func (h *Server) ReassignMemory(w http.ResponseWriter, r *http.Request, id string, _ ReassignMemoryParams)

ReassignMemory implements POST /v1/memories/{id}/reassign. Moves a single memory from the request namespace to the target namespace.

func (*Server) RememberMemory added in v0.0.6

func (h *Server) RememberMemory(w http.ResponseWriter, r *http.Request, _ RememberMemoryParams)

RememberMemory implements POST /v1/memories.

func (*Server) RotateApiKey added in v0.6.7

func (h *Server) RotateApiKey(w http.ResponseWriter, r *http.Request, name string)

RotateApiKey implements POST /v1/keys/{name}/rotate: generates a fresh secret (apiauth.GenerateSecret), replacing the stored hash while preserving CreatedAt, home/default namespace bindings, and disabled state — same contract as `memini key add` re-run against an existing name. Admin-gated. 404 absent, 409 for a file-sourced key. Same lookup-then-Put non-transactional caveat as UpdateApiKey.

func (*Server) RunDedup added in v0.0.8

func (h *Server) RunDedup(w http.ResponseWriter, r *http.Request, _ RunDedupParams)

RunDedup implements POST /v1/dedup. The optional body tunes the pass; the zero value uses the production defaults. The pass is scoped to the request's namespace unless all_namespaces is set. Dry-run reports what would happen without tombstoning.

func (*Server) RunFsck added in v0.0.6

func (h *Server) RunFsck(w http.ResponseWriter, r *http.Request, _ RunFsckParams)

RunFsck implements POST /v1/fsck.

func (*Server) SearchMemories added in v0.0.6

func (h *Server) SearchMemories(w http.ResponseWriter, r *http.Request, _ SearchMemoriesParams)

SearchMemories implements POST /v1/search.

func (*Server) SplitNamespace added in v0.6.0

func (h *Server) SplitNamespace(w http.ResponseWriter, r *http.Request, _ SplitNamespaceParams)

SplitNamespace implements POST /v1/namespaces/split. Regroups the request namespace (X-Memini-Namespace header) by metadata keys, moving each record to the namespace named by the first of the given keys it carries.

func (*Server) SupersedeMemory added in v0.4.12

func (h *Server) SupersedeMemory(w http.ResponseWriter, r *http.Request, boundID string, _ SupersedeMemoryParams)

SupersedeMemory implements POST /v1/memories/{id}/supersede. Stamps superseded_by + valid_to so default recall hides the row while the audit chain and time-travel (AsOf) queries can still reach it.

func (*Server) UpdateApiKey added in v0.6.7

func (h *Server) UpdateApiKey(w http.ResponseWriter, r *http.Request, name string)

UpdateApiKey implements PATCH /v1/keys/{name}: preserve-unspecified semantics matching `memini key add`'s rotation contract — an omitted field (nil pointer) leaves the stored value unchanged; an explicitly passed field (including an explicit empty string, or disabled=false) overrides it. Admin-gated. 404 absent, 409 for a file-sourced key.

Lookup-then-Put is not transactional (K3 note, carried forward): two concurrent PATCHes to the same key could race and one's update could be silently lost. Acceptable for an admin-only, low-frequency operation.

type ServerInterface added in v0.0.6

type ServerInterface interface {
	// Recent memory activity — what was served or written, and why
	// (GET /v1/activity)
	ListActivity(w http.ResponseWriter, r *http.Request, params ListActivityParams)
	// Recall memories and answer a question grounded on them (requires an LLM)
	// (POST /v1/answer)
	AnswerQuestion(w http.ResponseWriter, r *http.Request, params AnswerQuestionParams)
	// Collapse near-duplicate memories (vector cluster) — tombstone the lower-scored members of each cluster
	// (POST /v1/dedup)
	RunDedup(w http.ResponseWriter, r *http.Request, params RunDedupParams)
	// Run a consistency sweep (purge expired, enforce short-term cap, audit duplicates)
	// (POST /v1/fsck)
	RunFsck(w http.ResponseWriter, r *http.Request, params RunFsckParams)
	// List API keys (name/home/default namespace/created/disabled/source — never a secret or hash)
	// (GET /v1/keys)
	ListApiKeys(w http.ResponseWriter, r *http.Request)
	// Create a new API key, returning its secret exactly once
	// (POST /v1/keys)
	CreateApiKey(w http.ResponseWriter, r *http.Request)
	// Delete an API key
	// (DELETE /v1/keys/{name})
	DeleteApiKey(w http.ResponseWriter, r *http.Request, name string)
	// Update an API key's home namespace, default namespace, and/or disabled state
	// (PATCH /v1/keys/{name})
	UpdateApiKey(w http.ResponseWriter, r *http.Request, name string)
	// Rotate an API key's secret, returning the new secret exactly once
	// (POST /v1/keys/{name}/rotate)
	RotateApiKey(w http.ResponseWriter, r *http.Request, name string)
	// Delete a namespace link
	// (DELETE /v1/links)
	DeleteLink(w http.ResponseWriter, r *http.Request, params DeleteLinkParams)
	// List outgoing namespace links from the request namespace
	// (GET /v1/links)
	ListLinks(w http.ResponseWriter, r *http.Request, params ListLinksParams)
	// Create or replace a namespace link (cross-namespace read edge)
	// (POST /v1/links)
	PutLink(w http.ResponseWriter, r *http.Request, params PutLinkParams)
	// Delete every memory in the namespace carrying a tag
	// (DELETE /v1/memories)
	ForgetByTag(w http.ResponseWriter, r *http.Request, params ForgetByTagParams)
	// List memories in a namespace (backs the admin UI browser)
	// (GET /v1/memories)
	ListMemories(w http.ResponseWriter, r *http.Request, params ListMemoriesParams)
	// Remember (store) a memory
	// (POST /v1/memories)
	RememberMemory(w http.ResponseWriter, r *http.Request, params RememberMemoryParams)
	// Forget (delete) a memory
	// (DELETE /v1/memories/{id})
	ForgetMemory(w http.ResponseWriter, r *http.Request, id string, params ForgetMemoryParams)
	// Fetch a memory by ID
	// (GET /v1/memories/{id})
	GetMemory(w http.ResponseWriter, r *http.Request, id string, params GetMemoryParams)
	// The full version chain (supersession lineage) of a memory
	// (GET /v1/memories/{id}/history)
	GetMemoryHistory(w http.ResponseWriter, r *http.Request, id string, params GetMemoryHistoryParams)
	// Move a single memory to a different namespace
	// (POST /v1/memories/{id}/reassign)
	ReassignMemory(w http.ResponseWriter, r *http.Request, id string, params ReassignMemoryParams)
	// Tombstone a memory, recording it was replaced by `by`.
	// (POST /v1/memories/{id}/supersede)
	SupersedeMemory(w http.ResponseWriter, r *http.Request, id string, params SupersedeMemoryParams)
	// Delete every memory in the request namespace
	// (DELETE /v1/namespaces)
	DeleteNamespace(w http.ResponseWriter, r *http.Request, params DeleteNamespaceParams)
	// List the distinct namespaces holding memories
	// (GET /v1/namespaces)
	ListNamespaces(w http.ResponseWriter, r *http.Request)
	// Layered session-start briefing for the request namespace
	// (GET /v1/namespaces/briefing)
	GetBriefing(w http.ResponseWriter, r *http.Request, params GetBriefingParams)
	// Relocate every memory in the request namespace to another namespace
	// (POST /v1/namespaces/move)
	MoveNamespace(w http.ResponseWriter, r *http.Request, params MoveNamespaceParams)
	// Resolve the structural read-set for the request namespace
	// (GET /v1/namespaces/read-set)
	GetReadSet(w http.ResponseWriter, r *http.Request, params GetReadSetParams)
	// Split the request namespace by metadata keys
	// (POST /v1/namespaces/split)
	SplitNamespace(w http.ResponseWriter, r *http.Request, params SplitNamespaceParams)
	// Recall memories via hybrid (vector + keyword) search
	// (POST /v1/search)
	SearchMemories(w http.ResponseWriter, r *http.Request, params SearchMemoriesParams)
	// Per-namespace overview (counts by tier, accesses, importance)
	// (GET /v1/stats)
	GetStats(w http.ResponseWriter, r *http.Request, params GetStatsParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper added in v0.0.6

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AnswerQuestion added in v0.0.6

func (siw *ServerInterfaceWrapper) AnswerQuestion(w http.ResponseWriter, r *http.Request)

AnswerQuestion operation middleware

func (*ServerInterfaceWrapper) CreateApiKey added in v0.6.7

func (siw *ServerInterfaceWrapper) CreateApiKey(w http.ResponseWriter, r *http.Request)

CreateApiKey operation middleware

func (*ServerInterfaceWrapper) DeleteApiKey added in v0.6.7

func (siw *ServerInterfaceWrapper) DeleteApiKey(w http.ResponseWriter, r *http.Request)

DeleteApiKey operation middleware

func (siw *ServerInterfaceWrapper) DeleteLink(w http.ResponseWriter, r *http.Request)

DeleteLink operation middleware

func (*ServerInterfaceWrapper) DeleteNamespace added in v0.0.8

func (siw *ServerInterfaceWrapper) DeleteNamespace(w http.ResponseWriter, r *http.Request)

DeleteNamespace operation middleware

func (*ServerInterfaceWrapper) ForgetByTag added in v0.0.11

func (siw *ServerInterfaceWrapper) ForgetByTag(w http.ResponseWriter, r *http.Request)

ForgetByTag operation middleware

func (*ServerInterfaceWrapper) ForgetMemory added in v0.0.6

func (siw *ServerInterfaceWrapper) ForgetMemory(w http.ResponseWriter, r *http.Request)

ForgetMemory operation middleware

func (*ServerInterfaceWrapper) GetBriefing added in v0.0.11

func (siw *ServerInterfaceWrapper) GetBriefing(w http.ResponseWriter, r *http.Request)

GetBriefing operation middleware

func (*ServerInterfaceWrapper) GetMemory added in v0.0.6

func (siw *ServerInterfaceWrapper) GetMemory(w http.ResponseWriter, r *http.Request)

GetMemory operation middleware

func (*ServerInterfaceWrapper) GetMemoryHistory added in v0.4.19

func (siw *ServerInterfaceWrapper) GetMemoryHistory(w http.ResponseWriter, r *http.Request)

GetMemoryHistory operation middleware

func (*ServerInterfaceWrapper) GetReadSet added in v0.6.6

func (siw *ServerInterfaceWrapper) GetReadSet(w http.ResponseWriter, r *http.Request)

GetReadSet operation middleware

func (*ServerInterfaceWrapper) GetStats added in v0.0.6

func (siw *ServerInterfaceWrapper) GetStats(w http.ResponseWriter, r *http.Request)

GetStats operation middleware

func (*ServerInterfaceWrapper) ListActivity added in v0.6.8

func (siw *ServerInterfaceWrapper) ListActivity(w http.ResponseWriter, r *http.Request)

ListActivity operation middleware

func (*ServerInterfaceWrapper) ListApiKeys added in v0.6.7

func (siw *ServerInterfaceWrapper) ListApiKeys(w http.ResponseWriter, r *http.Request)

ListApiKeys operation middleware

func (siw *ServerInterfaceWrapper) ListLinks(w http.ResponseWriter, r *http.Request)

ListLinks operation middleware

func (*ServerInterfaceWrapper) ListMemories added in v0.0.6

func (siw *ServerInterfaceWrapper) ListMemories(w http.ResponseWriter, r *http.Request)

ListMemories operation middleware

func (*ServerInterfaceWrapper) ListNamespaces added in v0.0.6

func (siw *ServerInterfaceWrapper) ListNamespaces(w http.ResponseWriter, r *http.Request)

ListNamespaces operation middleware

func (*ServerInterfaceWrapper) MoveNamespace added in v0.6.0

func (siw *ServerInterfaceWrapper) MoveNamespace(w http.ResponseWriter, r *http.Request)

MoveNamespace operation middleware

PutLink operation middleware

func (*ServerInterfaceWrapper) ReassignMemory added in v0.6.0

func (siw *ServerInterfaceWrapper) ReassignMemory(w http.ResponseWriter, r *http.Request)

ReassignMemory operation middleware

func (*ServerInterfaceWrapper) RememberMemory added in v0.0.6

func (siw *ServerInterfaceWrapper) RememberMemory(w http.ResponseWriter, r *http.Request)

RememberMemory operation middleware

func (*ServerInterfaceWrapper) RotateApiKey added in v0.6.7

func (siw *ServerInterfaceWrapper) RotateApiKey(w http.ResponseWriter, r *http.Request)

RotateApiKey operation middleware

func (*ServerInterfaceWrapper) RunDedup added in v0.0.8

func (siw *ServerInterfaceWrapper) RunDedup(w http.ResponseWriter, r *http.Request)

RunDedup operation middleware

func (*ServerInterfaceWrapper) RunFsck added in v0.0.6

RunFsck operation middleware

func (*ServerInterfaceWrapper) SearchMemories added in v0.0.6

func (siw *ServerInterfaceWrapper) SearchMemories(w http.ResponseWriter, r *http.Request)

SearchMemories operation middleware

func (*ServerInterfaceWrapper) SplitNamespace added in v0.6.0

func (siw *ServerInterfaceWrapper) SplitNamespace(w http.ResponseWriter, r *http.Request)

SplitNamespace operation middleware

func (*ServerInterfaceWrapper) SupersedeMemory added in v0.4.12

func (siw *ServerInterfaceWrapper) SupersedeMemory(w http.ResponseWriter, r *http.Request)

SupersedeMemory operation middleware

func (*ServerInterfaceWrapper) UpdateApiKey added in v0.6.7

func (siw *ServerInterfaceWrapper) UpdateApiKey(w http.ResponseWriter, r *http.Request)

UpdateApiKey operation middleware

type SplitNamespaceJSONBody added in v0.6.0

type SplitNamespaceJSONBody struct {
	// By Metadata keys to group by. Defaults to import_source_namespace, user_id, agent_id, run_id, project.
	By     *[]string `json:"by,omitempty"`
	DryRun *bool     `json:"dry_run,omitempty"`
}

SplitNamespaceJSONBody defines parameters for SplitNamespace.

type SplitNamespaceJSONRequestBody added in v0.6.0

type SplitNamespaceJSONRequestBody SplitNamespaceJSONBody

SplitNamespaceJSONRequestBody defines body for SplitNamespace for application/json ContentType.

type SplitNamespaceParams added in v0.6.2

type SplitNamespaceParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

SplitNamespaceParams defines parameters for SplitNamespace.

type Stats added in v0.0.6

type Stats struct {
	AvgImportance float64 `json:"avg_importance"`

	// ByMemoryType Live count per typed-extraction memory_type (decision/preference/problem).
	ByMemoryType *map[string]int `json:"by_memory_type,omitempty"`
	ByTier       map[string]int  `json:"by_tier"`
	Expired      int             `json:"expired"`
	LastWriteAt  *time.Time      `json:"last_write_at,omitempty"`

	// LowConfidenceDurable Live durable memories whose decayed confidence is below the demote floor — reclaimable, uncorroborated debris.
	LowConfidenceDurable int    `json:"low_confidence_durable"`
	Namespace            string `json:"namespace"`
	Superseded           int    `json:"superseded"`

	// Total Live memories (excludes expired/superseded)
	Total         int `json:"total"`
	TotalAccesses int `json:"total_accesses"`
}

Stats defines model for Stats.

type SupersedeMemoryJSONRequestBody added in v0.4.12

type SupersedeMemoryJSONRequestBody = SupersedeRequest

SupersedeMemoryJSONRequestBody defines body for SupersedeMemory for application/json ContentType.

type SupersedeMemoryParams added in v0.4.12

type SupersedeMemoryParams struct {
	// XMeminiNamespace Tenant/agent namespace; falls back to the server default.
	XMeminiNamespace *Namespace `json:"X-Memini-Namespace,omitempty"`
}

SupersedeMemoryParams defines parameters for SupersedeMemory.

type SupersedeRequest added in v0.4.12

type SupersedeRequest struct {
	// By ID of the memory that replaces the target.
	By string `json:"by"`
}

SupersedeRequest defines model for SupersedeRequest.

type Tier added in v0.0.6

type Tier string

Tier defines model for Tier.

const (
	Episodic   Tier = "episodic"
	Procedural Tier = "procedural"
	Semantic   Tier = "semantic"
	Working    Tier = "working"
)

Defines values for Tier.

func (Tier) Valid added in v0.0.6

func (e Tier) Valid() bool

Valid indicates whether the value is a known member of the Tier enum.

type TooManyValuesForParamError added in v0.0.6

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error added in v0.0.6

type UnescapedCookieParamError added in v0.0.6

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error added in v0.0.6

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap added in v0.0.6

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented added in v0.0.6

type Unimplemented struct{}

func (Unimplemented) AnswerQuestion added in v0.0.6

func (_ Unimplemented) AnswerQuestion(w http.ResponseWriter, r *http.Request, params AnswerQuestionParams)

Recall memories and answer a question grounded on them (requires an LLM) (POST /v1/answer)

func (Unimplemented) CreateApiKey added in v0.6.7

func (_ Unimplemented) CreateApiKey(w http.ResponseWriter, r *http.Request)

Create a new API key, returning its secret exactly once (POST /v1/keys)

func (Unimplemented) DeleteApiKey added in v0.6.7

func (_ Unimplemented) DeleteApiKey(w http.ResponseWriter, r *http.Request, name string)

Delete an API key (DELETE /v1/keys/{name})

func (_ Unimplemented) DeleteLink(w http.ResponseWriter, r *http.Request, params DeleteLinkParams)

Delete a namespace link (DELETE /v1/links)

func (Unimplemented) DeleteNamespace added in v0.0.8

func (_ Unimplemented) DeleteNamespace(w http.ResponseWriter, r *http.Request, params DeleteNamespaceParams)

Delete every memory in the request namespace (DELETE /v1/namespaces)

func (Unimplemented) ForgetByTag added in v0.0.11

func (_ Unimplemented) ForgetByTag(w http.ResponseWriter, r *http.Request, params ForgetByTagParams)

Delete every memory in the namespace carrying a tag (DELETE /v1/memories)

func (Unimplemented) ForgetMemory added in v0.0.6

func (_ Unimplemented) ForgetMemory(w http.ResponseWriter, r *http.Request, id string, params ForgetMemoryParams)

Forget (delete) a memory (DELETE /v1/memories/{id})

func (Unimplemented) GetBriefing added in v0.0.11

func (_ Unimplemented) GetBriefing(w http.ResponseWriter, r *http.Request, params GetBriefingParams)

Layered session-start briefing for the request namespace (GET /v1/namespaces/briefing)

func (Unimplemented) GetMemory added in v0.0.6

func (_ Unimplemented) GetMemory(w http.ResponseWriter, r *http.Request, id string, params GetMemoryParams)

Fetch a memory by ID (GET /v1/memories/{id})

func (Unimplemented) GetMemoryHistory added in v0.4.19

func (_ Unimplemented) GetMemoryHistory(w http.ResponseWriter, r *http.Request, id string, params GetMemoryHistoryParams)

The full version chain (supersession lineage) of a memory (GET /v1/memories/{id}/history)

func (Unimplemented) GetReadSet added in v0.6.6

func (_ Unimplemented) GetReadSet(w http.ResponseWriter, r *http.Request, params GetReadSetParams)

Resolve the structural read-set for the request namespace (GET /v1/namespaces/read-set)

func (Unimplemented) GetStats added in v0.0.6

func (_ Unimplemented) GetStats(w http.ResponseWriter, r *http.Request, params GetStatsParams)

Per-namespace overview (counts by tier, accesses, importance) (GET /v1/stats)

func (Unimplemented) ListActivity added in v0.6.8

func (_ Unimplemented) ListActivity(w http.ResponseWriter, r *http.Request, params ListActivityParams)

Recent memory activity — what was served or written, and why (GET /v1/activity)

func (Unimplemented) ListApiKeys added in v0.6.7

func (_ Unimplemented) ListApiKeys(w http.ResponseWriter, r *http.Request)

List API keys (name/home/default namespace/created/disabled/source — never a secret or hash) (GET /v1/keys)

func (_ Unimplemented) ListLinks(w http.ResponseWriter, r *http.Request, params ListLinksParams)

List outgoing namespace links from the request namespace (GET /v1/links)

func (Unimplemented) ListMemories added in v0.0.6

func (_ Unimplemented) ListMemories(w http.ResponseWriter, r *http.Request, params ListMemoriesParams)

List memories in a namespace (backs the admin UI browser) (GET /v1/memories)

func (Unimplemented) ListNamespaces added in v0.0.6

func (_ Unimplemented) ListNamespaces(w http.ResponseWriter, r *http.Request)

List the distinct namespaces holding memories (GET /v1/namespaces)

func (Unimplemented) MoveNamespace added in v0.6.0

func (_ Unimplemented) MoveNamespace(w http.ResponseWriter, r *http.Request, params MoveNamespaceParams)

Relocate every memory in the request namespace to another namespace (POST /v1/namespaces/move)

func (_ Unimplemented) PutLink(w http.ResponseWriter, r *http.Request, params PutLinkParams)

Create or replace a namespace link (cross-namespace read edge) (POST /v1/links)

func (Unimplemented) ReassignMemory added in v0.6.0

func (_ Unimplemented) ReassignMemory(w http.ResponseWriter, r *http.Request, id string, params ReassignMemoryParams)

Move a single memory to a different namespace (POST /v1/memories/{id}/reassign)

func (Unimplemented) RememberMemory added in v0.0.6

func (_ Unimplemented) RememberMemory(w http.ResponseWriter, r *http.Request, params RememberMemoryParams)

Remember (store) a memory (POST /v1/memories)

func (Unimplemented) RotateApiKey added in v0.6.7

func (_ Unimplemented) RotateApiKey(w http.ResponseWriter, r *http.Request, name string)

Rotate an API key's secret, returning the new secret exactly once (POST /v1/keys/{name}/rotate)

func (Unimplemented) RunDedup added in v0.0.8

func (_ Unimplemented) RunDedup(w http.ResponseWriter, r *http.Request, params RunDedupParams)

Collapse near-duplicate memories (vector cluster) — tombstone the lower-scored members of each cluster (POST /v1/dedup)

func (Unimplemented) RunFsck added in v0.0.6

func (_ Unimplemented) RunFsck(w http.ResponseWriter, r *http.Request, params RunFsckParams)

Run a consistency sweep (purge expired, enforce short-term cap, audit duplicates) (POST /v1/fsck)

func (Unimplemented) SearchMemories added in v0.0.6

func (_ Unimplemented) SearchMemories(w http.ResponseWriter, r *http.Request, params SearchMemoriesParams)

Recall memories via hybrid (vector + keyword) search (POST /v1/search)

func (Unimplemented) SplitNamespace added in v0.6.0

func (_ Unimplemented) SplitNamespace(w http.ResponseWriter, r *http.Request, params SplitNamespaceParams)

Split the request namespace by metadata keys (POST /v1/namespaces/split)

func (Unimplemented) SupersedeMemory added in v0.4.12

func (_ Unimplemented) SupersedeMemory(w http.ResponseWriter, r *http.Request, id string, params SupersedeMemoryParams)

Tombstone a memory, recording it was replaced by `by`. (POST /v1/memories/{id}/supersede)

func (Unimplemented) UpdateApiKey added in v0.6.7

func (_ Unimplemented) UpdateApiKey(w http.ResponseWriter, r *http.Request, name string)

Update an API key's home namespace, default namespace, and/or disabled state (PATCH /v1/keys/{name})

type UnmarshalingParamError added in v0.0.6

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error added in v0.0.6

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap added in v0.0.6

func (e *UnmarshalingParamError) Unwrap() error

type UpdateApiKeyJSONRequestBody added in v0.6.7

type UpdateApiKeyJSONRequestBody = UpdateApiKeyRequest

UpdateApiKeyJSONRequestBody defines body for UpdateApiKey for application/json ContentType.

type UpdateApiKeyRequest added in v0.6.7

type UpdateApiKeyRequest struct {
	// DefaultNamespace Omit to leave the current default unchanged; an explicit empty string clears it.
	DefaultNamespace *string `json:"default_namespace,omitempty"`

	// Disabled Omit to leave the current disabled state unchanged.
	Disabled *bool `json:"disabled,omitempty"`

	// Home Omit to leave the current binding unchanged; an explicit empty string clears it.
	Home *string `json:"home,omitempty"`
}

UpdateApiKeyRequest defines model for UpdateApiKeyRequest.

Jump to

Keyboard shortcuts

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