Documentation
¶
Overview ¶
Package memory implements persistent memory storage for Hermes mode. Memory is stored as a human-readable Markdown file (memory.md).
Index ¶
- type MemoryTool
- func (t *MemoryTool) Description() string
- func (t *MemoryTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
- func (t *MemoryTool) Name() string
- func (t *MemoryTool) Parameters() json.RawMessage
- func (t *MemoryTool) PromptGuidelines() []string
- func (t *MemoryTool) PromptSnippet() string
- type Store
- func (s *Store) Add(section, entry string) error
- func (s *Store) Delete(section, entry string) error
- func (s *Store) Read() (content string, path string, source string, err error)
- func (s *Store) ReadSection(section string) (string, error)
- func (s *Store) Resolve() (path string, source string, err error)
- func (s *Store) Update(section, oldText, newText string) error
- func (s *Store) WriteAll(content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryTool ¶
type MemoryTool struct {
// contains filtered or unexported fields
}
MemoryTool provides persistent memory read/write via memory.md.
func NewMemoryTool ¶
func NewMemoryTool(store *Store) *MemoryTool
NewMemoryTool creates a new memory tool.
func (*MemoryTool) Description ¶
func (t *MemoryTool) Description() string
func (*MemoryTool) Execute ¶
func (t *MemoryTool) Execute(ctx context.Context, params map[string]any) (tools.ToolResult, error)
func (*MemoryTool) Name ¶
func (t *MemoryTool) Name() string
func (*MemoryTool) Parameters ¶
func (t *MemoryTool) Parameters() json.RawMessage
func (*MemoryTool) PromptGuidelines ¶
func (t *MemoryTool) PromptGuidelines() []string
func (*MemoryTool) PromptSnippet ¶
func (t *MemoryTool) PromptSnippet() string
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages reading and writing of memory.md files.
func NewStore ¶
NewStore creates a memory store. If explicitPath is non-empty, it overrides the default discovery logic. workDir is used as fallback directory for creating new memory files.
func (*Store) ReadSection ¶
ReadSection returns the content of a specific ## section.
func (*Store) Resolve ¶
Resolve finds the memory.md file to use. Priority: explicit path → .vibe/memory.md → <GLOBAL_DIR>/memory.md Returns (path, source, error). source is "explicit", "project", "global", or "".