markdown

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Record

type Record struct {
	ID           string // String ID for markdown storage
	NumID        int64  // Numeric ID for VectorStore interface (derived from string ID)
	Scope        string
	SessionID    string
	Role         string
	Content      string
	Tags         []string
	Metadata     map[string]any
	Embedding    []float32
	LastEmbedded time.Time
	CreatedAt    time.Time
}

type Store

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

func NewStore

func NewStore(root string) (*Store, error)

func (*Store) Count added in v1.11.8

func (s *Store) Count(ctx context.Context) (int, error)

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id string) error

func (*Store) DeleteMemory added in v1.11.8

func (s *Store) DeleteMemory(ctx context.Context, ids []int64) error

DeleteMemory deletes memories by numeric IDs

func (*Store) Iterate added in v1.11.8

func (s *Store) Iterate(ctx context.Context, fn func(model.MemoryRecord) bool) error

Iterate calls fn for each memory record, stopping if fn returns false

func (*Store) List

func (s *Store) List(ctx context.Context, scope, sessionID string) ([]Record, error)

func (*Store) Root

func (s *Store) Root() string

func (*Store) Save

func (s *Store) Save(ctx context.Context, rec Record) error

func (*Store) Search

func (s *Store) Search(ctx context.Context, query string, limit int) ([]Record, error)

func (*Store) SearchMemory added in v1.11.8

func (s *Store) SearchMemory(ctx context.Context, sessionID string, queryEmbedding []float32, limit int) ([]model.MemoryRecord, error)

SearchMemory searches by embedding vector (cosine similarity) Falls back to keyword search if no embedding provided

func (*Store) StoreMemory added in v1.11.8

func (s *Store) StoreMemory(ctx context.Context, sessionID, content string, metadata map[string]any, embedding []float32) error

StoreMemory stores a memory with embedding (satisfies VectorStore interface)

func (*Store) UpdateEmbedding added in v1.11.8

func (s *Store) UpdateEmbedding(ctx context.Context, id int64, embedding []float32, lastEmbedded time.Time) error

UpdateEmbedding updates the embedding vector for a record

Jump to

Keyboard shortcuts

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