-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Summary
Wire the memory storage engine and tools into Ghost's config, registry, and command flow. After this issue, memory is fully functional in both single-shot and chat modes.
Details
Memory is core to Ghost — always on, not a feature flag. The embedding model is a required config value (like the chat model). Configuration is via config file and env vars only, no CLI flags.
Modified files:
cmd/config.go
- Add config bindings (config file + env vars only, no CLI flags):
memory.embedding-model— required (likemodel)memory.dir— optional, default~/.config/ghost/memory
- Validation: if
memory.embedding-modelis empty, return error - New error:
ErrNoEmbeddingModel = errors.New("memory cortex requires an embedding model (set via config file or GHOST_MEMORY*EMBEDDING_MODEL environment)") - Env vars:
GHOST_MEMORY*EMBEDDING_MODEL,GHOST_MEMORY*DIR
cmd/memory.go (new)
- Shared helper:
initMemoryStore(ollamaURL string, logger *log.Logger) (*memory.Store, error) - Reads
memory.embedding-modelandmemory.dirfrom viper - Creates
EmbedFuncclosure wrappingllm.Embed() - Returns initialized
*memory.Store
internal/agent/prompt.go
- Add
MemoryPromptconstant with instructions for using memory tools - Add
FullSystemPromptthat combines baseSystemPrompt+MemoryPrompt
internal/tool/registry.go
- Update
NewRegistrysignature to acceptmemoryStore *memory.Store - Always register
MemorySearchandMemorySavetools
internal/tool/registry_test.go
- Update existing
NewRegistrycalls for new parameter - Add test for memory tool registration
cmd/root.go
- In
run(): callinitMemoryStore(), useagent.FullSystemPrompt, pass store toNewRegistry() defer memoryStore.Close()- No new CLI flags
cmd/chat.go
- In
runChat(): same wiring —initMemoryStore(),agent.FullSystemPromptforconfig.System, store toNewRegistry() defer memoryStore.Close()
Config example:
# ~/.config/ghost/config.toml
model = "qwen3:8b"
[memory]
embedding-model = "nomic-embed-text" # required
# dir = "/custom/path" # optionalDependencies
- Add memory_save tool #237 (memory_save tool)
- Add memory_search tool #238 (memory_search tool)
Acceptance Criteria
- Ghost requires
memory.embedding-modelin config (clear error if missing) - Memory store initializes on startup in both root and chat commands
- Memory tools registered in tool registry
- System prompt includes memory usage instructions
-
ghost "Remember my favorite color is blue"→ saves to daily log -
ghost "What's my favorite color?"→ searches memory and recalls -
ghost chat→ memory works across chat turns - All existing tests updated and passing
-
go test ./...passes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
Backlog