memory

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidTypes = []string{"observation", "decision", "pattern", "gotcha"}

ValidTypes are the allowed memory types.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	ID        string   `yaml:"id"        json:"id"`
	Type      string   `yaml:"type"      json:"type"`
	Repo      string   `yaml:"repo"      json:"repo,omitempty"`
	Tags      []string `yaml:"tags"      json:"tags,omitempty"`
	CreatedBy string   `yaml:"created_by" json:"created_by,omitempty"`
	CreatedAt string   `yaml:"created_at" json:"created_at"`
	Content   string   `yaml:"-"         json:"content"`
}

Memory represents a single memory entry stored as a markdown file with YAML frontmatter.

type Store

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

Store manages memory files under <root>/<DataDir>/memory/.

func NewStore

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

NewStore creates a Store rooted at the given workspace root.

func (*Store) Add

func (s *Store) Add(mem *Memory) error

Add persists a Memory to disk. If ID is empty, one is generated.

func (*Store) Get

func (s *Store) Get(id string) (*Memory, error)

Get reads a single memory by ID.

func (*Store) List

func (s *Store) List(filterType, filterRepo string) ([]Memory, error)

List returns all memories, optionally filtered by type and/or repo.

func (*Store) Remove

func (s *Store) Remove(id string) error

Remove deletes a memory by ID.

func (*Store) Search

func (s *Store) Search(query string) ([]Memory, error)

Search performs a case-insensitive keyword search across content and tags.

Jump to

Keyboard shortcuts

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