{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package assemble\n\nPackage assemble is the context compiler. It does NOT retrieve memories — it \\*compiles\\* a structured ContextPack the way a human orients before touching code: which subsystem, what it depends on, the goals in play, recent activity, the files worth reading. The pack is a typed object (with provenance on every item) so the future agent runtime consumes the same thing the CLI renders.\n\nv1 is fully deterministic: topology + objectives + git recency + a Go-native content search. No model calls, no embeddings.\n\n## Types\n\n```go\ntype Budget struct {\n\tLimit     int  `json:\"limit\"`\n\tEstimated int  `json:\"estimated\"`\n\tTruncated bool `json:\"truncated\"`\n}\n```\nBudget reports the rough token cost of the recommended reads.\n\n```go\ntype ContextPack struct {\n\tTarget           string   `json:\"target\"`\n\tSubsystem        string   `json:\"subsystem,omitempty\"`\n\tEcosystem        string   `json:\"ecosystem,omitempty\"`\n\tObjectives       []Item   `json:\"objectives\"`\n\tDependencies     []Item   `json:\"dependencies\"`\n\tRelevantFiles    []Item   `json:\"relevant_files\"`\n\tRecentEvents     []Item   `json:\"recent_events\"`\n\tConstraints      []Item   `json:\"constraints\"`\n\tRecommendedReads []Item   `json:\"recommended_reads\"`\n\tRankingReasons   []string `json:\"ranking_reasons\"`\n\tTokenBudget      Budget   `json:\"token_budget\"`\n}\n```\nContextPack is the structured output of the compiler — consumed by both the CLI renderer and (later) the agent's orient step.\n\n```go\nfunc Context(ctx context.Context, st store.Store, root, target string) (ContextPack, error)\n```\nContext compiles a ContextPack for a target, which may be a path (file or directory) or a free-text query.\n\n```go\ntype Item struct {\n\tRef    string `json:\"ref\"`             // path / subsystem key / objective id / commit hash\n\tLabel  string `json:\"label,omitempty\"` // human text (title, commit subject, …)\n\tReason string `json:\"reason\"`          // provenance: why this was included\n\tScore  int    `json:\"score,omitempty\"` // ranking score (higher = more relevant)\n}\n```\nItem is one included piece of context, always carrying the reason it's here.\n\n","path":"github.com/memcode-ai/memcode/internal/assemble","name":"assemble","synopsis":"Package assemble is the context compiler.","isRedistributable":true}
