memdir

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package memdir loads the two on-disk memory files that seed the agent's system prompt at session start:

  • <workdir>/EVVA.md project memory — repo conventions, hot facts
  • <evvaHome>/USER_PROFILE.md user memory — preferences, working style

Both files are optional. Missing files yield a zero-value Snapshot field and no warning; the prompt builder skips empty sections cleanly. Any non-missing read failure (permission, oversize) is recorded in Snapshot.Warnings — Load itself never returns an error so the agent can always boot.

This package depends only on stdlib. It is not imported by the sysprompt package; the caller threads Snapshot.ProjectMemory / .UserProfile into the prompt context, keeping the dependency arrow one-way.

Index

Constants

View Source
const (
	ProjectMemoryFile = "EVVA.md"
	UserProfileFile   = "USER_PROFILE.md"
)

File names. Exposed so other packages (Phase 9 user-profile background agent, future /memory slash commands) can write to the same paths without re-spelling them.

View Source
const MaxFileBytes = 64 * 1024

MaxFileBytes caps each memory file at 64 KiB. Past that the user is almost certainly using EVVA.md for the wrong thing (knowledge base, not conventions doc); we truncate and warn rather than refuse outright so a bloated file doesn't break the session.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snapshot

type Snapshot struct {
	ProjectMemory string   // raw contents of <workdir>/EVVA.md
	UserProfile   string   // raw contents of <evvaHome>/USER_PROFILE.md
	Warnings      []string // non-fatal: oversize-truncation, permission errors
}

Snapshot is one session's view of the two memory files. Either body field may be empty when the file is missing, empty, or unreadable; callers treat empty as "skip the section."

func Load

func Load(workdir, evvaHome string) Snapshot

Load reads both memory files. Empty workdir or evvaHome silently skips that file. Files larger than MaxFileBytes are truncated with a warning. The function never returns an error.

Jump to

Keyboard shortcuts

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