agentcontext

package
v0.21.1 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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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