How to Inspect the Prompt Templates Used by Hiring-Agent: A Complete Guide
Hiring-Agent stores all LLM prompt templates as Jinja files in the prompts/templates directory and loads them through the TemplateManager class defined in prompts/template_manager.py.
The interviewstreet/hiring-agent repository relies on structured prompt templates to extract information from resumes and evaluate candidates. Understanding how to inspect these templates is essential for debugging, customizing, or auditing the LLM prompts. This guide shows you exactly where these templates live and how to access them programmatically using the built-in TemplateManager.
Where Prompt Templates Are Stored
Hiring-Agent organizes all prompt templates as plain text files with the .jinja extension in the prompts/templates directory. Each file corresponds to a specific section of resume analysis or system functionality.
Template Files by Section
The repository includes dedicated templates for different resume sections:
basics.jinja– Extracts basic information (name, email, phone)work.jinja– Parses work experience entrieseducation.jinja– Handles academic backgroundskills.jinja– Identifies technical and soft skillsprojects.jinja– Extracts project descriptionsawards.jinja– Captures honors and certificationssystem_message.jinja– Contains system-level instructionsgithub_project_selection.jinja– Guides GitHub project evaluationresume_evaluation_criteria.jinja– Defines evaluation rubricsresume_evaluation_system_message.jinja– System prompts for resume scoring
How TemplateManager Loads Templates
The TemplateManager class in prompts/template_manager.py serves as the central loader for all Jinja templates. When instantiated, it performs three key initialization steps:
- Sets
self.template_dirto"prompts/templates"(or a custom path provided during initialization). - Creates a Jinja
Environmentwith aFileSystemLoaderpointing at that directory, configured withtrim_blocks=Trueandlstrip_blocks=True. - Invokes
_load_templates()to iterate over the hard-coded section-to-filename mapping, verify file existence, and store compiled templates inself._templates.
self.env = Environment(
loader=FileSystemLoader(template_dir), trim_blocks=True, lstrip_blocks=True
)
self._templates: Dict[str, Template] = {}
self._load_templates()
Methods to Inspect Templates at Runtime
Once initialized, the TemplateManager provides several methods to inspect and interact with prompt templates without directly accessing the filesystem.
Listing Available Sections
Call get_available_sections() to retrieve a list of all loaded template sections:
from prompts.template_manager import TemplateManager
tm = TemplateManager()
print(tm.get_available_sections())
# Output: ['basics', 'work', 'education', 'skills', 'projects', 'awards',
# 'system_message', 'github_project_selection',
# 'resume_evaluation_criteria', 'resume_evaluation_system_message']
Accessing Raw Jinja Source
To view the unrendered template content, access the source attribute of the stored template object via the internal _templates dictionary:
basics_template = tm._templates["basics"]
print(basics_template.source)
This prints the literal Jinja syntax including variables and control structures used by the hiring-agent.
Rendering Templates with Variables
Use render_template(section_name, **kwargs) to generate final prompts with substituted variables:
resume_text = "## John Doe\n**Email:** john@example.com\n**Experience:** 5 years..."
rendered_prompt = tm.render_template("basics", text_content=resume_text)
Complete Inspection Examples
Verify Template Files on Disk
You can programmatically confirm template file existence using standard Python path operations:
import os
template_path = os.path.join(tm.template_dir, "basics.jinja")
print("File exists:", os.path.isfile(template_path))
Display Full Template Content
This complete example demonstrates loading the manager and displaying raw template sources:
from prompts.template_manager import TemplateManager
# Initialize the template manager
tm = TemplateManager()
# Show available sections
print("Available sections:", tm.get_available_sections())
# Display raw Jinja source for work experience template
work_template = tm._templates["work"]
print("\n--- Raw Work Template ---")
print(work_template.source)
Render a Complete Prompt
Generate a production-ready prompt by combining the template with resume data:
resume_markdown = """## Jane Smith
**Email:** jane@example.com
**Phone:** +1-555-0123
### Experience
Software Engineer at Tech Corp (2020-2023)"""
# Render the basics section
prompt = tm.render_template("basics", text_content=resume_markdown)
print(prompt)
Summary
- Hiring-Agent stores all prompt templates as
.jinjafiles in theprompts/templatesdirectory according to the interviewstreet/hiring-agent source code. - The
TemplateManagerclass inprompts/template_manager.pyhandles loading and rendering. - Access
get_available_sections()to list all loaded templates. - Retrieve raw template content via
tm._templates["section_name"].source. - Use
render_template(section_name, **kwargs)to generate final prompts with variables.
Frequently Asked Questions
Where are the prompt templates stored in hiring-agent?
All prompt templates are stored as .jinja files in the prompts/templates directory at the repository root. Each file corresponds to a specific resume section or system function, such as basics.jinja for contact information or work.jinja for employment history.
How do I view the raw Jinja source of a template?
First instantiate TemplateManager, then access the internal _templates dictionary using the section name as the key and read the .source attribute. For example: tm._templates["skills"].source returns the raw Jinja markup for the skills extraction template.
Can I render a template with custom variables?
Yes, call tm.render_template("section_name", **kwargs) where kwargs are the variables required by that specific template. For instance, tm.render_template("basics", text_content=resume_text) substitutes the text_content variable into the basics template.
What is the TemplateManager class responsible for?
The TemplateManager class defined in prompts/template_manager.py initializes a Jinja Environment, loads all .jinja files from the templates directory, and provides methods to list available sections and render templates with custom data. It acts as the central abstraction layer between the filesystem templates and the rest of the hiring-agent codebase.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →