memory

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CosineSimilarity

func CosineSimilarity(a, b []float32) float32

func ReadMemoryFile

func ReadMemoryFile(path string) (title, content, createdAt string, err error)

func ReadVec

func ReadVec(path string) ([]float32, error)

func WriteMemoryFile

func WriteMemoryFile(dir, title, content string) (string, error)

func WriteVec

func WriteVec(path string, vec []float32) error

Types

type Embedder

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

func NewEmbedder

func NewEmbedder() (*Embedder, error)

func (*Embedder) Close

func (e *Embedder) Close()

func (*Embedder) Embed

func (e *Embedder) Embed(text string) ([]float32, error)

type HistoryResult

type HistoryResult struct {
	SectionContent string
	SessionID      string
	CreatedAt      string
	Project        string
	CompactionPath string
}

type MemoryResult

type MemoryResult struct {
	Title     string
	Content   string
	CreatedAt string
	Project   string
	FilePath  string
}

type Section

type Section struct {
	Name    string
	Content string
}

func SplitSummary

func SplitSummary(summary string) []Section

type Store

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

func NewStore

func NewStore(embedder *Embedder, projectsRoot, home string) *Store

func (*Store) Close

func (s *Store) Close()

func (*Store) DeleteSessionSummaries

func (s *Store) DeleteSessionSummaries(sessionID string) error

func (*Store) IndexSummary

func (s *Store) IndexSummary(sessionID, projectID, projectName, summary, createdAt, compactionPath string) error

func (*Store) Reconcile

func (s *Store) Reconcile() error

func (*Store) SaveMemory

func (s *Store) SaveMemory(memoriesDir, title, content string) (string, error)

func (*Store) SearchHistory

func (s *Store) SearchHistory(query, projectID string, allProjects bool, limit int) ([]HistoryResult, error)

func (*Store) SearchMemory

func (s *Store) SearchMemory(query, projectID string, allProjects bool, limit int) ([]MemoryResult, error)

type VecEntry

type VecEntry struct {
	Path string
	Vec  []float32
}
func Search(query []float32, entries []VecEntry, limit int) []VecEntry

Jump to

Keyboard shortcuts

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