# What Database Schema Does the Hiring-Agent Repository Use?

> Discover the hiring-agent database schema. Learn how this project uses Pydantic models and SQLite for flexible, JSON-compatible data storage instead of traditional relational databases.

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

---

**The hiring-agent project does not define a traditional relational database schema; instead, it stores data as JSON-compatible Pydantic models in an SQLite file, where the schema is effectively defined by the Python class hierarchy.**

The interviewstreet/hiring-agent repository handles résumé data and evaluation scoring without relying on conventional SQL table definitions. Understanding the database schema used by the hiring-agent requires examining its Pydantic data models rather than DDL scripts, as the persistence layer serializes objects directly to JSON within an SQLite database.

## Schema Overview: Pydantic Models Over SQL Tables

The application abandons rigid relational schemas in favor of flexible JSON serialization. In [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py), the `JSONResume` class serves as the root container, encapsulating sections like work history, education, and personal basics as nested Pydantic objects. This approach treats the Python class definitions as the source of truth for data structure, eliminating the need for explicit `CREATE TABLE` statements.

## Core Data Models in models.py

The data structure revolves around two primary categories: résumé content and evaluation metrics.

### Resume Structure Models

The `JSONResume` class orchestrates the JSON Resume standard format. It aggregates section-specific models including:

- **`Basics`** – Contact information such as name and email
- **`Work`** – Employment history with positions, dates, and summaries
- **`Education`** – Academic credentials and degrees
- **`Award`** – Recognitions and honors
- **`Project`** – Portfolio items and technical work

Each class inherits from Pydantic's `BaseModel`, ensuring automatic validation and JSON serialization compatibility.

### Evaluation Scoring Models

For the assessment logic, the repository defines `Scores`, `BonusPoints`, and `Deductions` classes, all collected under the `EvaluationData` model. The [`evaluator.py`](https://github.com/interviewstreet/hiring-agent/blob/main/evaluator.py) module consumes these structures to calculate candidate ratings, persisting results as serialized JSON rather than normalized database rows.

## SQLite Persistence Implementation

While the project avoids relational schema definitions, it uses SQLite for file-based storage. The repository's `.gitignore` explicitly lists `db.sqlite3` and `db.sqlite3-journal`, confirming the presence of a local SQLite database file. However, unlike traditional SQL applications, the hiring-agent does not script table layouts; the SQLite engine stores the serialized JSON blobs of Pydantic models, often in generic key-value or single-table structures generated automatically by the storage wrapper.

## Working with the Data Schema

To interact with the database schema used by the hiring-agent, instantiate the Pydantic models and handle serialization through the application's storage layer:

```python
from models import JSONResume, Basics, Work

# Construct a resume using the Pydantic schema

resume = JSONResume(
    basics=Basics(name="Alice Example", email="alice@example.com"),
    work=[
        Work(
            name="Acme Corp",
            position="Software Engineer",
            startDate="2020-01-01",
            endDate="2022-12-31",
            summary="Built AI services."
        )
    ]
)

# Serialize to JSON for SQLite storage (actual persistence method depends on wrapper)

json_data = resume.model_dump_json()

# Illustrative: resume.save_to_sqlite("db.sqlite3")

```

In this pattern, the "schema" lives in the Python class definitions within [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py), not in SQL migration files.

## Summary

- The hiring-agent uses **Pydantic models** as its schema definition rather than SQL DDL.
- Data persists to an **SQLite file** (`db.sqlite3`) but without explicit `CREATE TABLE` statements.
- The `JSONResume` class in [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py) defines the root structure for résumé data.
- Evaluation logic relies on `EvaluationData`, `Scores`, and related models in the same file.
- SQLite serves as a simple JSON document store, with table layouts generated automatically from serialized objects.

## Frequently Asked Questions

### Does hiring-agent use a relational database schema?

No, the repository does not implement a traditional relational schema. It uses Pydantic models to define data structures and stores serialized JSON representations in SQLite, bypassing the need for normalized tables and foreign key relationships.

### What file defines the data structure for hiring-agent?

The [`models.py`](https://github.com/interviewstreet/hiring-agent/blob/main/models.py) file contains the complete schema definition, including `JSONResume`, `Basics`, `Work`, `Education`, `Award`, `Project`, and evaluation classes like `Scores` and `EvaluationData`.

### How is the SQLite database structured?

The SQLite database file (`db.sqlite3`) stores data as serialized JSON blobs. The application does not contain explicit `CREATE TABLE` statements; instead, the storage layer automatically generates tables or uses generic key-value storage to hold the Pydantic model outputs.

### Can I query the hiring-agent data using standard SQL?

While the data resides in an SQLite file, querying with standard SQL is limited because the schema stores JSON objects rather than normalized columns. You would need to extract and parse the JSON fields to perform relational queries, as the underlying structure follows the Pydantic model hierarchy rather than SQL table definitions.