hired.resume_agent#

Resume Generation System - Core Architecture

A hybrid LangChain/DSPy system for AI-powered resume creation with manual and autonomous operation modes.

Architecture follows supervisor-worker pattern with:

  • ResumeSession: Stateful conversation manager for manual mode

  • ResumeExpertAgent: Autonomous controller using ResumeSession as a tool

  • Specialized worker agents: expansion, distillation, matching, search

Classes

ConversationMemory(*[, max_recent_turns])

Manages conversation history with tiered memory strategy.

DistillationAgent(*[, llm_config])

Distills verbose text into concise, impactful statements.

ExpansionAgent(*[, llm_config])

Expands brief bullet points into detailed achievement descriptions.

LLMConfig(model[, temperature, max_tokens, ...])

Configuration for LLM model selection and parameters.

LLMProvider(*args, **kwargs)

Protocol for LLM execution.

MatchingAgent(*[, llm_config])

Performs semantic matching between candidate info and job requirements.

ModelRegistry(supervisor, workers[, ...])

Registry for different model configurations by role.

OperationMode(*values)

Session operation mode.

Plan(steps, rationale[, created_at])

Structured execution plan for resume creation.

PlanStep(id, action, description[, params, ...])

A single step in an execution plan.

ResumeExpertAgent(*[, llm_config, ...])

Autonomous agent that uses ResumeSession as a tool.

ResumeSession(job_info, candidate_info, *[, ...])

Stateful conversation session for resume creation.

SearchAgent(*[, llm_config])

Performs web searches to expand context about companies, technologies, etc.

SessionSnapshot(turn_count, data, mode[, ...])

Immutable snapshot of session state at a point in time.

SessionState()

Structured state for resume creation session.

SessionStore(*[, data_dir])

Manages automatic persistence of resume sessions.

Turn(role, content[, timestamp, metadata])

A single conversation turn.

class hired.resume_agent.ConversationMemory(*, max_recent_turns=10)[source]#

Bases: object

Manages conversation history with tiered memory strategy.

Minimal docstring: Stores and retrieves conversation turns with summarization.

add_turn(role, content, **metadata)[source]#

Add a conversation turn.

Return type:

None

get_all_turns()[source]#

Get all conversation turns.

Return type:

list[Turn]

get_context_for_prompt()[source]#

Generate context for LLM prompt with recent history.

Yields dicts with ‘role’ and ‘content’ for LLM consumption.

Return type:

Iterable[dict[str, Any]]

get_recent_turns(n=None)[source]#

Get the n most recent turns (defaults to max_recent_turns).

Return type:

list[Turn]

summarize_old_turns()[source]#

Placeholder for summarization of old history.

Return type:

None

class hired.resume_agent.DistillationAgent(*, llm_config=None)[source]#

Bases: object

Distills verbose text into concise, impactful statements.

Uses DSPy-optimized prompts with metrics for conciseness and clarity.

distill(verbose_text, *, max_words=None, preserve_metrics=True)[source]#

Distill verbose text into concise statement.

Return type:

str

>>> config = LLMConfig(model="gpt-4")
>>> agent = DistillationAgent(llm_config=config)
>>> agent.llm_config.model
'gpt-4'
class hired.resume_agent.ExpansionAgent(*, llm_config=None)[source]#

Bases: object

Expands brief bullet points into detailed achievement descriptions.

Uses DSPy-optimized prompts for consistent, high-quality expansions.

expand(brief_text, context, *, target_length='detailed')[source]#

Expand brief text into detailed description.

Return type:

str

>>> config = LLMConfig(model="gpt-4")
>>> agent = ExpansionAgent(llm_config=config)
>>> agent.llm_config.model
'gpt-4'
class hired.resume_agent.LLMConfig(model, temperature=0.7, max_tokens=None, top_p=1.0, provider='openai', api_key=None, base_url=None, extra_params=<factory>)[source]#

Bases: object

Configuration for LLM model selection and parameters.

>>> config = LLMConfig(model="gpt-4", temperature=0.7)
>>> config.model
'gpt-4'
to_dspy_lm()[source]#

Convert to DSPy LM instance.

Return type:

Any

to_langchain_kwargs()[source]#

Convert to LangChain model kwargs.

Return type:

dict[str, Any]

class hired.resume_agent.LLMProvider(*args, **kwargs)[source]#

Bases: Protocol

Protocol for LLM execution.

chat(messages, **kwargs)[source]#

Generate response for chat messages.

Return type:

str

complete(prompt, **kwargs)[source]#

Generate completion for prompt.

Return type:

str

class hired.resume_agent.MatchingAgent(*, llm_config=None)[source]#

Bases: object

Performs semantic matching between candidate info and job requirements.

Uses embedding-based similarity and cross-encoder reranking.

find_matches(candidate_text, job_requirements)[source]#

Find semantic matches between candidate experience and job needs.

Yields dicts with ‘candidate_snippet’, ‘job_requirement’, ‘score’.

Return type:

Iterable[dict[str, Any]]

class hired.resume_agent.ModelRegistry(supervisor, workers, expansion=None, distillation=None, matching=None, search=None)[source]#

Bases: object

Registry for different model configurations by role.

Enables cost optimization by using different models for different tasks.

>>> registry = ModelRegistry(
...     supervisor=LLMConfig("gpt-4"),
...     workers=LLMConfig("gpt-3.5-turbo")
... )
>>> registry.supervisor.model
'gpt-4'
classmethod default()[source]#

Create default registry with sensible model choices.

Return type:

ModelRegistry

classmethod fast()[source]#

Create registry optimized for speed/cost.

Return type:

ModelRegistry

get_config(role)[source]#

Get model config for specific role.

Falls back to workers config if role-specific config not set.

Return type:

LLMConfig

classmethod quality()[source]#

Create registry optimized for quality.

Return type:

ModelRegistry

class hired.resume_agent.OperationMode(*values)[source]#

Bases: Enum

Session operation mode.

class hired.resume_agent.Plan(steps, rationale, created_at=<factory>)[source]#

Bases: object

Structured execution plan for resume creation.

get_executable_steps(completed_steps)[source]#

Get steps that can currently be executed.

Return type:

list[PlanStep]

to_markdown()[source]#

Convert plan to human-readable markdown.

Return type:

str

validate()[source]#

Validate plan structure and dependencies.

Return type:

list[str]

class hired.resume_agent.PlanStep(id, action, description, params=<factory>, dependencies=<factory>, estimated_tokens=None)[source]#

Bases: object

A single step in an execution plan.

can_execute(completed_steps)[source]#

Check if all dependencies are satisfied.

Return type:

bool

class hired.resume_agent.ResumeExpertAgent(*, llm_config=None, model_registry=None)[source]#

Bases: object

Autonomous agent that uses ResumeSession as a tool.

Operates in auto mode, making decisions about expansion, distillation, search, and generation operations to produce complete resumes.

>>> config = LLMConfig(model="gpt-4")
>>> agent = ResumeExpertAgent(llm_config=config)
>>> agent.llm_config.model
'gpt-4'
create_resume(session, *, mode='standard', max_iterations=5)[source]#

Autonomously create resume using session as tool.

Operates in plan-and-execute pattern:

  1. Analyze job and candidate info

  2. Plan resume creation strategy

  3. Execute operations (expand, distill, match)

  4. Generate resume

  5. Critique and refine

Return type:

str

execute_plan(session, plan, *, interactive=False, approval_callback=None)[source]#

Execute a plan step by step.

Parameters:
  • session (ResumeSession) – Resume session to operate on

  • plan (Plan) – Plan to execute

  • interactive (bool) – If True, pause after each step for approval

Return type:

dict[str, Any]

Returns:

Dict with execution results and final outputs

propose_plan(session, *, mode='standard')[source]#

Generate execution plan for resume creation.

Returns structured Plan object that can be edited before execution.

Return type:

Plan

revise_plan(plan, instruction)[source]#

Revise plan based on natural language instruction.

Uses LLM to interpret instruction and modify plan accordingly.

Return type:

Plan

class hired.resume_agent.ResumeSession(job_info, candidate_info, *, mode=OperationMode.MANUAL, system_prompt=None, max_recent_turns=10, llm_config=None, model_registry=None, auto_persist=True, data_dir=None, name=None)[source]#

Bases: object

Stateful conversation session for resume creation.

Provides manual chat interface where users give natural language instructions to perform expansion, distillation, search, and generation operations. Maintains conversation history and structured state.

>>> config = LLMConfig("gpt-4")
>>> session = ResumeSession(
...     job_info="Senior ML Engineer at TechCo",
...     candidate_info="5 years Python, ML experience",
...     llm_config=config
... )
>>> session.llm_config.model
'gpt-4'
chat(user_message)[source]#

Process user instruction and return assistant response.

This is the main interface for manual mode operation. Automatically persists session after each turn if auto_persist enabled.

Return type:

str

property history: list[Turn]#

Get all conversation turns.

classmethod list_persisted(data_dir=None)[source]#

List all persisted sessions.

Return type:

Iterable[dict[str, Any]]

>>> for session_info in ResumeSession.list_persisted():
...     print(session_info['session_id'])
classmethod load(session_id, *, data_dir=None, llm_config=None)[source]#

Load session from persistent storage.

Return type:

Optional[ResumeSession]

>>> session = ResumeSession.load("abc123def456")
>>> session.session_id if session else None
'abc123def456'
property metadata: dict[str, Any]#

Return a small metadata dict for quick inspection.

Includes: session_id, name, created_at (iso), n_turns, mode, model

save(data_dir=None)[source]#

Manually save session to persistent storage.

Returns path to saved session file.

Return type:

Path

property snapshots: list[SessionSnapshot]#

Get all session snapshots.

property state: SessionState#

Get current session state.

switch_mode(mode)[source]#

Switch between manual and auto operation modes.

Return type:

None

class hired.resume_agent.SearchAgent(*, llm_config=None)[source]#

Bases: object

Performs web searches to expand context about companies, technologies, etc.

Integrates with search APIs to gather relevant information.

search(query, *, result_count=5)[source]#

Search web for relevant information.

Yields dicts with ‘title’, ‘snippet’, ‘url’.

Return type:

Iterable[dict[str, Any]]

class hired.resume_agent.SessionSnapshot(turn_count, data, mode, timestamp=<factory>)[source]#

Bases: object

Immutable snapshot of session state at a point in time.

>>> snapshot = SessionSnapshot(turn_count=5, data={'skills': ['Python']})
>>> snapshot.turn_count
5
class hired.resume_agent.SessionState[source]#

Bases: object

Structured state for resume creation session.

Stores extracted entities, analysis results, and work-in-progress content.

get(key, default=None)[source]#

Get state value with default.

Return type:

Any

snapshot()[source]#

Create immutable snapshot of current state.

Return type:

dict[str, Any]

update(updates)[source]#

Update state with new information.

Return type:

None

class hired.resume_agent.SessionStore(*, data_dir=None)[source]#

Bases: MutableMapping[str, Any]

Manages automatic persistence of resume sessions.

Sessions are saved after each chat turn to enable recovery and history.

>>> store = SessionStore()
>>> store.data_dir.name
'resume_agent_sessions'
add(session)[source]#

Alias for save_session to behave like a set.add(session).

Return type:

Path

delete_session(session_id)[source]#

Delete session from persistent storage.

Return type:

bool

list_sessions()[source]#

List all persisted sessions.

Yields session metadata dicts.

Return type:

Iterable[dict[str, Any]]

load_session(session_id, *, llm_config=None)[source]#

Load session from persistent storage.

Returns None if session not found.

Return type:

Optional[ResumeSession]

save_session(session)[source]#

Save session to persistent storage.

Returns path to saved session file.

Return type:

Path

class hired.resume_agent.Turn(role, content, timestamp=<factory>, metadata=<factory>)[source]#

Bases: object

A single conversation turn.

>>> turn = Turn(role="user", content="Make a resume")
>>> turn.role
'user'