Smart Templates allows you to create and use configurable templates utilizing Smart Environments.
Smart Templates is a companion plugin to Smart Connections, a plugin for Obsidian that implements a Smart Environment for utilizing AI to enhance your notes.
Create and use customizable templates with dynamic variables.
- AI-Powered: Leverage AI models to generate content based on your templates, variable prompts, and current context (note or highlighted text).
- Variable Prompts: Define prompts for each variable for more control over content generation.
- Flexible Configuration: Choose your preferred AI model platform.
- Manual Prompt Input: Use
{{ "Your prompt here" }}
syntax for on-the-fly custom prompts within templates. - EJS Syntax Support: Utilize EJS syntax for more advanced template logic and formatting.
More features coming soon...:
- Integration with Smart Memos
- Integration with Smart Connections to retrieve additional context
- Integration with Smart Connections Visualizer for visual selection of nodes to use as context
Currently in beta. Requires installing manually or via BRAT.
Smart Connections Supporters: install using the "Easy Install" button in the early-release (version 2.2
) plugin settings.
- Set up your preferred AI model platform in the plugin settings.
- Create smart templates in the designated templates folder.
- Use the command palette to run your smart templates on your notes or selections.
- A command is created for each template in the templates folder.
- The command is run on the current note or highlighted selection (if any).
- The template is rendered and the resulting content is inserted at the current cursor location.
- Navigate to your designated templates folder.
- Create a new Markdown file for your template.
- Use special syntax to define dynamic parts of your template:
{{ variable_name }}
: Simple bracket syntax for predefined variables{{ "Your custom prompt here" }}
: Manual prompt input syntax<%- ... %>
: EJS syntax for advanced logic and formatting
Example template:
# Default Smart Template
### Summary
{{ summary }} <- Simple bracket syntax
### Notes
{{ notes }}
### Chart
<%- '```mermaid' %> <- EJS syntax is also available
{{ mermaid }}
<%- '```' %>
{{ "Your custom prompt here" }} <- Manual prompt input syntax
Choose your preferred AI model platform (e.g., OpenAI) and enter your API key in the settings.
Specify the folder where your smart templates will be stored.
Customize the prompts for template variables like summary, notes, and mermaid charts.
graph TD
A[Smart Template] -->|Contains| B(Variable Placeholders)
C[var_prompts] -->|Defines| D(Variable Prompts)
E[Current Context] -->|Provides| F(Content for Processing)
B --> G{Smart Templates Plugin}
D --> G
F --> G
G -->|Processes| H(AI Model)
H -->|Generates| I(Variable Content)
I --> J{Template Rendering}
A --> J
J -->|Produces| K[Final Output]
Created by 🌴 Brian as a companion plugin to Smart Connections, a plugin for Obsidian that implements a Smart Environment for utilizing AI to enhance your notes.
Uses JSBrains to minimize dependencies and provide an easily adaptable architecture that supports new models and platforms.