# What Templating Engine Does Hiring Agent Use for Section Parsing?

> Discover how Hiring Agent uses Jinja2 for efficient section parsing. Learn how the TemplateManager renders resume sections into LLM-ready prompts for seamless processing.

- Repository: [HackerRank/hiring-agent](https://github.com/interviewstreet/hiring-agent)
- Tags: internals
- Published: 2026-07-02

---

**Hiring Agent uses Jinja2 as its templating engine for section parsing, leveraging a centralized `TemplateManager` class to render resume sections into LLM-ready prompts before processing.**

Hiring Agent, an open-source resume parsing tool maintained by InterviewStreet, handles unstructured PDF data by converting it into structured prompts for large language models. The **section parsing** workflow depends entirely on Jinja2 templates to format raw resume text into specific prompts for work history, education, skills, and other categories.

## How TemplateManager Configures the Jinja2 Environment

The core implementation lives in [`prompts/template_manager.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompts/template_manager.py), where the `TemplateManager` class initializes a Jinja2 `Environment` using a `FileSystemLoader`. This loader automatically discovers all `*.jinja` files stored under the `prompts/templates` directory at runtime.

The manager exposes a `render_template` method that accepts a template name (corresponding to the filename without extension) and keyword arguments for variable substitution. This architecture decouples prompt formatting from business logic, allowing developers to modify LLM prompts by editing Jinja files without touching Python code.

## Rendering Section Templates for Resume Parsing

When parsing resumes, Hiring Agent maps distinct resume sections to specific template files. Each section type—work experience, education, skills—has a dedicated Jinja template that defines how raw text should be presented to the LLM.

### Work, Education, and Skills Templates

The template files follow a strict naming convention: `work.jinja`, `education.jinja`, and `skills.jinja` reside in `prompts/templates/`. These files contain pure Jinja2 syntax, supporting variable interpolation via `{{ variable }}`, conditionals with `{% if %}`, and iteration loops.

For example, when extracting work history, the code invokes:

```python
template_manager = TemplateManager()
prompt = template_manager.render_template("work", text_content=resume_text)

```

The `text_content` variable passes the raw PDF extract into the template, where Jinja expressions format it according to the specific section's prompt requirements.

## Code Implementation Examples

The following patterns demonstrate how to interact with the templating system across different contexts.

### Loading and Rendering a Section Template

To render any resume section, instantiate `TemplateManager` and call `render_template` with the section identifier:

```python
from prompts.template_manager import TemplateManager

# Initialize manager (scans prompts/templates/ for *.jinja files)

tm = TemplateManager()

# Render the "work" section template

work_prompt = tm.render_template(
    "work",                    # corresponds to work.jinja

    text_content=resume_text   # variable referenced inside the template

)

print(work_prompt)   # Formatted prompt ready for LLM consumption

```

### Integrating TemplateManager in PDF Processing

The [`pdf.py`](https://github.com/interviewstreet/hiring-agent/blob/main/pdf.py) module demonstrates production usage during PDF processing. The `PDFProcessor` class maintains a `TemplateManager` instance and renders section-specific prompts before LLM invocation:

```python
from prompts.template_manager import TemplateManager

class PDFProcessor:
    def __init__(self):
        self.template_manager = TemplateManager()

    def parse_section(self, section_name, raw_text):
        # Render Jinja template for the specific section

        prompt = self.template_manager.render_template(
            section_name,
            text_content=raw_text
        )
        # Send prompt to LLM and process response...

        return prompt

```

### Creating Custom Section Templates

Adding support for new resume sections requires only a new Jinja file. Create `prompts/templates/hobbies.jinja`:

```jinja
You are a helpful assistant. Extract the candidate's hobbies from the following text:
{{ text_content }}

```

Then render it without modifying Python code:

```python
tm = TemplateManager()
hobbies_prompt = tm.render_template("hobbies", text_content=resume_text)

```

The `FileSystemLoader` automatically discovers any new `*.jinja` files placed in the templates directory, requiring no additional registration steps.

## Integration Across the Hiring Agent Codebase

Beyond resume parsing, the Jinja2 templating system powers multiple components through the same `TemplateManager` interface:

- **[`pdf.py`](https://github.com/interviewstreet/hiring-agent/blob/main/pdf.py)**: Renders templates for each resume section before LLM processing
- **[`github.py`](https://github.com/interviewstreet/hiring-agent/blob/main/github.py)**: Applies templates when selecting and describing GitHub repository projects
- **[`evaluator.py`](https://github.com/interviewstreet/hiring-agent/blob/main/evaluator.py)**: Uses the mechanism for rendering evaluation criteria and system messages
- **`prompts/templates/`**: Houses all section-specific Jinja files including `work.jinja`, `education.jinja`, and `skills.jinja`

## Summary

- **Jinja2** powers all section parsing in Hiring Agent through the `TemplateManager` class located in [`prompts/template_manager.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompts/template_manager.py)
- The system uses `FileSystemLoader` to automatically discover `*.jinja` templates in the `prompts/templates/` directory
- Developers render section prompts via `render_template(section_name, text_content=...)` called from [`pdf.py`](https://github.com/interviewstreet/hiring-agent/blob/main/pdf.py), [`github.py`](https://github.com/interviewstreet/hiring-agent/blob/main/github.py), and [`evaluator.py`](https://github.com/interviewstreet/hiring-agent/blob/main/evaluator.py)
- New resume sections require only the creation of a new `.jinja` file, with no Python code changes necessary

## Frequently Asked Questions

### What templating engine does Hiring Agent use for section parsing?

Hiring Agent uses **Jinja2** as its templating engine. The `TemplateManager` class in [`prompts/template_manager.py`](https://github.com/interviewstreet/hiring-agent/blob/main/prompts/template_manager.py) instantiates a Jinja2 `Environment` configured with a `FileSystemLoader` that loads all `*.jinja` files from `prompts/templates/`. This setup enables dynamic prompt generation for different resume sections like work experience and education.

### How do I add a new section template to Hiring Agent?

Create a new file in `prompts/templates/` with a `.jinja` extension, such as `certifications.jinja`. Write your prompt using standard Jinja2 syntax, including variables like `{{ text_content }}`. The `TemplateManager` automatically detects new files in the templates directory, and you can immediately render them by calling `tm.render_template("certifications", text_content=your_text)`.

### Where is the TemplateManager instantiated in the codebase?

The `TemplateManager` is instantiated in several key modules: [`pdf.py`](https://github.com/interviewstreet/hiring-agent/blob/main/pdf.py) initializes it for resume section parsing, [`github.py`](https://github.com/interviewstreet/hiring-agent/blob/main/github.py) uses it for GitHub project selection prompts, and [`evaluator.py`](https://github.com/interviewstreet/hiring-agent/blob/main/evaluator.py) leverages it for rendering evaluation criteria. Each module creates an independent instance via `TemplateManager()`.

### Can I use conditionals and loops in Hiring Agent templates?

Yes, because Hiring Agent uses standard Jinja2 syntax, you can utilize advanced features including `{% if %}` statements, `{% for %}` loops, and built-in filters within your `*.jinja` files. The Jinja2 `Environment` processes these constructs when `render_template` is called, enabling sophisticated logic for formatting resume text before LLM submission.