agents

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package agents defines the multi-agent pipeline that turns a raw job posting into a human-approvable application draft. Each agent is a small, focused step (research, write, review). Real LLM-backed implementations can replace these stubs without changing the orchestrator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Name() string
	Run(ctx context.Context, p *Pipeline) (AgentLog, error)
}

Agent is a single step in the pipeline. Run mutates p in place and returns a short log line describing what it did.

type AgentLog

type AgentLog struct {
	Name    string
	Summary string
}

AgentLog records the work one agent did. We surface this to the user so the pipeline is auditable and not a black box.

type Options

type Options struct {
	LLM   llm.Client
	Extra []Agent
}

Options tunes the default pipeline. The zero value is valid: nil LLM means the writer uses its deterministic template, which keeps v0.1 behavior.

type Orchestrator

type Orchestrator struct {
	// contains filtered or unexported fields
}

Orchestrator runs a fixed sequence of agents and streams progress to w. Cancellation via ctx is honored between steps.

func NewOrchestrator

func NewOrchestrator(w io.Writer, extra ...Agent) *Orchestrator

NewOrchestrator wires up the default research -> write -> review pipeline with no LLM. Existing callers (and v0.1 tests) keep working unchanged. Pass extra agents to extend the sequence.

func NewOrchestratorWithOptions

func NewOrchestratorWithOptions(w io.Writer, opts Options) *Orchestrator

NewOrchestratorWithOptions is the explicit constructor. The CLI uses this to inject an LLM client read from config.json.

func (*Orchestrator) Run

func (o *Orchestrator) Run(ctx context.Context, p *Pipeline) error

Run executes every agent in order. The first error short-circuits the run.

type Pipeline

type Pipeline struct {
	Job           job.Job
	Profile       profile.Profile
	ResumePath    string // absolute path of the user's active resume, if any
	ResumeName    string // original filename, used in the draft
	ResumeSnippet string // up to N UTF-8 runes of plain-text resume content, when readable
	Findings      []string
	Draft         string
	DraftSource   string // "llm:<provider>" or "template"
	Critique      []string
	Score         int
	AgentLogs     []AgentLog
}

Pipeline is the shared, mutable context the agents pass between each other. Keeping it explicit (rather than a sea of method args) makes it obvious what each agent reads and writes.

type Researcher

type Researcher struct{}

Researcher synthesizes lightweight findings about the job and how the user's profile lines up with it. This is a heuristic stub today; a future version can call an LLM or pull external pages.

func (Researcher) Name

func (Researcher) Name() string

func (Researcher) Run

type Reviewer

type Reviewer struct{}

Reviewer critiques the writer's draft against simple quality heuristics (length, placeholders, profile completeness) and emits a score in [0,100]. A future LLM-backed reviewer can replace this without touching the orchestrator.

func (Reviewer) Name

func (Reviewer) Name() string

func (Reviewer) Run

type Writer

type Writer struct {
	// LLM is optional. When nil the writer uses its template directly,
	// keeping the pipeline usable on a fresh install with no API keys.
	LLM llm.Client
}

Writer drafts a short cover-letter-style message. If a real LLM client is configured, the writer asks it to produce the body; otherwise it falls back to a deterministic template. Either way, the active resume (if any) is referenced in the closing so the user can see it will be attached.

func (Writer) Name

func (w Writer) Name() string

func (Writer) Run

func (w Writer) Run(ctx context.Context, p *Pipeline) (AgentLog, error)

Jump to

Keyboard shortcuts

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