store

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package store provides a file-based persistent memory store. Each memory is a markdown file with YAML frontmatter in a configured directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	ID        string
	Tags      []string
	Content   string // the text to remember
	CreatedAt time.Time
	UpdatedAt time.Time
}

Memory represents a single stored memory.

type Store

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

Store manages memories in a local directory.

func New

func New(dir string) (*Store, error)

New creates a Store backed by the given directory.

func (*Store) Forget

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

Forget deletes a memory by ID. Returns error if not found.

func (*Store) Get

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

Get returns a single memory by ID.

func (*Store) List

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

List returns all memories sorted by created_at descending (newest first).

func (*Store) Recall

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

Recall searches memories by tags and/or text. Empty query returns all.

func (*Store) Remember

func (s *Store) Remember(content string, tags []string) (Memory, error)

Remember stores a new memory and returns its ID.

Jump to

Keyboard shortcuts

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