# lfnovo/ai-prompter architecture

> Architecture diagram of the GitHub repository lfnovo/ai-prompter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lfnovo/ai-prompter
- Repository: https://github.com/lfnovo/ai-prompter

## Overview

AI Prompter is a small Python library for finding or supplying Jinja templates, rendering prompts from data, and optionally exporting them to LangChain. The main workflow is template setup followed by rendering; templates can be composed with includes. The README also documents structured-output parser support. The only runtime source file is `src/ai_prompter/__init__.py`; some documented features are not visible in the sampled excerpts, so their internal wiring is not inferred.

Main entry points: [`src/ai_prompter/__init__.py`](https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py) (Prompter)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_developer(("Application developer"))
node_prompter["Prompter<br/>[__init__.py]"]
node_search_config["Search paths<br/>[__init__.py]"]
node_template_dirs["Template directories"]
node_jinja_loader["Jinja loader<br/>[__init__.py]"]
node_jinja_template["Jinja template<br/>[__init__.py]"]
node_template_data["Render data"]
node_rendered_prompt["Rendered prompt"]
node_langchain_export["LangChain export<br/>[__init__.py]"]
node_langchain["LangChain"]
node_output_parser["Output parser support<br/>[__init__.py]"]

node_developer -->|"creates"| node_prompter
node_prompter -->|"builds paths"| node_search_config
node_search_config -->|"selects"| node_template_dirs
node_prompter -->|"sets up"| node_jinja_loader
node_jinja_loader -->|"loads from"| node_template_dirs
node_jinja_loader -->|"loads template"| node_jinja_template
node_developer -->|"provides text"| node_prompter
node_prompter -->|"creates from text"| node_jinja_template
node_developer -->|"provides data"| node_prompter
node_prompter -->|"renders"| node_jinja_template
node_jinja_template -->|"produces"| node_rendered_prompt
node_prompter -->|"requests conversion"| node_langchain_export
node_langchain_export -.->|"creates prompt"| node_langchain
node_prompter -.->|"supports"| node_output_parser

click node_prompter "https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py"
click node_search_config "https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py"
click node_jinja_loader "https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py"
click node_jinja_template "https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py"
click node_langchain_export "https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py"
click node_output_parser "https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_developer,node_template_dirs,node_template_data,node_rendered_prompt,node_langchain toneIndigo
class node_prompter,node_search_config,node_jinja_loader,node_jinja_template,node_langchain_export,node_output_parser toneTeal
```

## Components

### Other components

- **Application developer**
- [Prompter](https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py): `src/ai_prompter/__init__.py`
- [Search paths](https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py): `src/ai_prompter/__init__.py`
- **Template directories**
- [Jinja loader](https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py): `src/ai_prompter/__init__.py`
- [Jinja template](https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py): `src/ai_prompter/__init__.py`
- **Render data**
- **Rendered prompt**
- [LangChain export](https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py): `src/ai_prompter/__init__.py`
- **LangChain**
- [Output parser support](https://github.com/lfnovo/ai-prompter/blob/main/src/ai_prompter/__init__.py): `src/ai_prompter/__init__.py`

## Connections

- Application developer → Prompter: creates
- Prompter → Search paths: builds paths
- Search paths → Template directories: selects
- Prompter → Jinja loader: sets up
- Jinja loader → Template directories: loads from
- Jinja loader → Jinja template: loads template
- Application developer → Prompter: provides text
- Prompter → Jinja template: creates from text
- Application developer → Prompter: provides data
- Prompter → Jinja template: renders
- Jinja template → Rendered prompt: produces
- Prompter → LangChain export: requests conversion
- LangChain export → LangChain: creates prompt
- Prompter → Output parser support: supports
