agentcontext

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSystemPrompt

func BuildSystemPrompt(opts SystemPromptOptions) string

BuildSystemPrompt constructs the system prompt from components.

func LoadAgentsMD

func LoadAgentsMD(cwd, agentHome string) (string, error)

LoadAgentsMD discovers and concatenates AGENTS.md files in priority order.

Priority (lowest first, content concatenated):

  1. <agentHome>/AGENTS.md (global)
  2. Walk: root → ... → cwd/.. (ancestor directories, root first, deepest last)
  3. cwd/AGENTS.md (project-local, highest priority)

agentHome defaults to $MOA_CONFIG_DIR, then ~/.config/moa. Duplicate paths are deduplicated.

Types

type SystemPromptOptions

type SystemPromptOptions struct {
	AgentsMD    string          // AGENTS.md content (concatenated from all levels)
	Tools       []core.ToolSpec // registered tools
	CWD         string          // working directory shown to the agent
	HasVerify   bool            // .moa/verify.json was loaded
	MemoryIndex string          // pre-formatted memory index (one line per fact)
	SkillsIndex string          // pre-formatted skills index
}

SystemPromptOptions configures system prompt generation.

Jump to

Keyboard shortcuts

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