diff --git a/README.md b/README.md index e0ec9de..54edb0a 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,12 @@ When working with AI assistants on your Obsidian vault, you constantly re-explai ## Key Features - **Multi-LLM output targets** with per-model token limits, formats (XML, Markdown, Plain), and truncation strategies +- **Export profiles** for one-click multi-format export (e.g. XML for Claude + Markdown for ChatGPT + Plain for Gemini) +- **Smart context** that auto-detects related notes via links, tags, folder proximity, and shared properties - **Prompt templates** with placeholders and conditionals for reusable workflows - **Additional context sources** from freetext, external files, or shell commands - **Frontmatter presets** to configure context per-note via `ai-context` YAML +- **Context snapshots** for saving and replaying context recipes - **Granular section selection** to include only the headings you need - **Context history** with diff, search, and one-click restore - **Context generator** that walks you through setting up vault conventions @@ -52,18 +55,19 @@ Paste into Claude, ChatGPT, or any AI assistant. | Topic | Description | |-------|-------------| | [Getting Started](docs/getting-started.md) | Installation, first run, commands | -| [Output Targets](docs/output-targets.md) | Multi-LLM formats and truncation | +| [Output Targets](docs/output-targets.md) | Multi-LLM formats, truncation, and export profiles | | [Templates](docs/templates.md) | Prompt templates, placeholders, conditionals | | [Context Sources](docs/context-sources.md) | Freetext, file, and shell sources | | [Frontmatter Presets](docs/frontmatter-presets.md) | Per-note ai-context YAML configuration | | [Section Selection](docs/section-selection.md) | Granular heading and block selection | -| [History](docs/history.md) | Context history, diff, and restore | +| [Smart Context](docs/smart-context.md) | Auto-detect related notes with context intelligence | +| [History & Snapshots](docs/history.md) | Context history, diff, restore, and snapshots | | [Settings](docs/settings.md) | Full settings reference | | [Advanced](docs/advanced.md) | Truncation strategies, priority order, XML format | ## Contributing -Contributions welcome! Fork the repo, create a feature branch, run `npm run build` to verify, and submit a pull request. Report bugs and request features via [Codeberg Issues](https://codeberg.org/luca-tty/obsidian-promptfire/issues). +Contributions welcome! Fork the repo, create a feature branch, run `npm run build` to verify, and submit a pull request. Report bugs and request features via [GitHub Issues](https://github.com/tolvitty/obsidian-logfire/issues). ## License diff --git a/docs/getting-started.md b/docs/getting-started.md index 28872cd..c736e7a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -13,7 +13,7 @@ ```bash # Clone into your vault's plugins folder cd /path/to/vault/.obsidian/plugins -git clone https://codeberg.org/luca-tty/obsidian-promptfire.git promptfire +git clone https://github.com/tolvitty/obsidian-logfire.git promptfire # Install and build cd promptfire @@ -76,5 +76,8 @@ The context is now in your clipboard. Paste it into Claude, ChatGPT, or any AI a | **Copy context with current note** | Copy context + active note | | **Copy context (select sections)** | Choose specific headings | | **Copy context from frontmatter preset** | Use note's ai-context config | +| **Copy smart context** | Auto-detect related notes via links, tags, and properties | +| **Export context (multi-target)** | One-click export using the active export profile | | **Generate context files** | Open the generator | | **View context history** | Browse past contexts | +| **View context snapshots** | Browse saved context snapshots | diff --git a/docs/history.md b/docs/history.md index 22a600d..451ca18 100644 --- a/docs/history.md +++ b/docs/history.md @@ -1,8 +1,10 @@ -# Context History +# Context History & Snapshots + +## History Track every context you generate over time. -## Features +### Features - **Automatic saving** - Every generated context is saved with a timestamp - **Search and filter** - Find past contexts quickly @@ -10,7 +12,7 @@ Track every context you generate over time. - **One-click restore** - Copy any past context back to clipboard - **Configurable retention** - Control storage limits and auto-cleanup -## Settings +### Settings | Setting | Description | Default | |---------|-------------|---------| @@ -19,12 +21,24 @@ Track every context you generate over time. | **Max entries** | Limit stored entries | 50 | | **Auto-cleanup** | Delete after X days | 30 | -## Usage - -Open history via: +### Usage ``` Ctrl+P > "Promptfire: View context history" ``` Browse, search, compare, and restore any previous context. + +## Snapshots + +Snapshots save a context "recipe" — the exact combination of notes, settings, and template — so you can replay it later. + +### Usage + +``` +Ctrl+P > "Promptfire: View context snapshots" +``` + +Browse, replay, or delete saved snapshots. Replaying a snapshot re-reads the files with current content and re-applies the template, giving you a fresh context from the same recipe. + +Snapshots are managed in **Settings > History > Snapshots**. diff --git a/docs/output-targets.md b/docs/output-targets.md index 94243be..dfba7e6 100644 --- a/docs/output-targets.md +++ b/docs/output-targets.md @@ -19,14 +19,51 @@ Each target can be configured with: - **Format** - `markdown`, `xml`, or `plain` - **Strategy** - `summarize-headers`, `drop-sections`, `truncate` - **Wrapper** - Prefix/suffix text around content (e.g., `...`) +- **Output path** - Custom folder for this target's file output (overrides the global output folder) ## Primary vs Secondary Targets - **Primary target** output goes to your clipboard. -- **Secondary targets** are saved as files in the configured output folder. +- **Secondary targets** are saved as files in the configured output folder (or the target's custom output path). This lets you generate context for multiple LLMs in a single action. ## Output Folder -Configure where secondary target files are saved in **Settings > Promptfire > Output Targets**. +Configure where secondary target files are saved in **Settings > Promptfire > Output Targets**. Individual targets can override this with their own **Output path** setting. + +## Export Profiles + +Export profiles bundle targets into named groups for one-click multi-format export. + +### How It Works + +1. Create a profile in **Settings > Output > Export Profiles** (e.g., "Full LLM Export") +2. Select which targets the profile includes (e.g., Claude XML + GPT Markdown + Gemini Compact) +3. Choose which target's output goes to clipboard (primary) +4. Set the profile as **active** in the "Active export profile" dropdown +5. Run the command: + +``` +Ctrl+P > "Promptfire: Export context (multi-target)" +``` + +The context assembles normally, each target processes it with its own format and truncation, the primary target goes to clipboard, and the rest are saved as files. + +### Built-in Profile + +| Profile | Targets | Primary | +|---------|---------|---------| +| **Full LLM Export** | Promptfire (XML), GPT-4o (MD), Compact (Plain) | Promptfire | + +Add it via **Settings > Output > Export Profiles > "Add Built-in Profiles"**. + +### Profile Dropdown in Generator + +When you have profiles configured, the generator modal shows a **Profile** dropdown above the target checkboxes. Selecting a profile pre-selects its targets for quick access. + +### Edge Cases + +- If the active profile references a target that was deleted, that target is skipped with a notice +- If a profile's primary target was deleted, the first available target in the profile becomes primary +- Deleting a target automatically cleans it up from all profiles diff --git a/docs/settings.md b/docs/settings.md index fea0f05..e030ba1 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -55,7 +55,32 @@ See [History](history.md) for more details. | **Format** | markdown, xml, or plain | | **Strategy** | summarize-headers, drop-sections, truncate | | **Wrapper** | Prefix/suffix text around content | +| **Output path** | Custom output folder for this target (overrides global) | | **Primary** | Which target goes to clipboard | | **Output folder** | Where to save secondary targets | +| **Active export profile** | Profile used by the multi-target export command | -See [Output Targets](output-targets.md) for format details and strategies. +## Export Profiles + +| Setting | Description | +|---------|-------------| +| **Name** | Display name for the profile | +| **Description** | Optional description | +| **Targets** | Which targets are included | +| **Primary target** | Which target's output goes to clipboard | + +See [Output Targets](output-targets.md) for export profile details. + +## Intelligence + +| Setting | Description | Default | +|---------|-------------|---------| +| **Enabled** | Enable context intelligence | Off | +| **Token budget** | Max tokens for smart context | 50,000 | +| **Max notes** | Max related notes to consider | 50 | +| **Min score** | Minimum relevance score | 0.1 | +| **Signal weights** | Weights for links, tags, folder proximity, properties | Varies | +| **Link depth** | How many hops to follow (1-3) | 1 | +| **Exclude paths** | Folders to skip | `_context, .obsidian` | + +See [Smart Context](smart-context.md) for details. diff --git a/docs/smart-context.md b/docs/smart-context.md new file mode 100644 index 0000000..46fc828 --- /dev/null +++ b/docs/smart-context.md @@ -0,0 +1,36 @@ +# Smart Context + +Auto-detect related notes based on links, tags, folder proximity, and shared frontmatter properties. + +## Usage + +``` +Ctrl+P > "Promptfire: Copy smart context (auto-detect related notes)" +``` + +Requires an active note. Promptfire analyzes the note's connections and presents a ranked list of related notes. Select which ones to include, then copy. + +## How Scoring Works + +Each note receives a relevance score based on configurable signal weights: + +| Signal | Description | +|--------|-------------| +| **Forward links** | Notes linked from the active note | +| **Backlinks** | Notes that link to the active note | +| **Shared tags** | Notes sharing tags with the active note | +| **Folder proximity** | Notes in nearby folders | +| **Shared properties** | Notes with matching frontmatter values | + +## Settings + +Configure in **Settings > Promptfire > Intelligence**: + +- **Token budget** - Maximum tokens for smart context output +- **Max notes** - Maximum related notes to consider +- **Min score** - Notes below this threshold are excluded +- **Signal weights** - Fine-tune the importance of each signal +- **Link depth** - How many hops to follow forward links (1-3) +- **Exclude paths** - Folders to skip during analysis +- **Exclude tags** - Notes with these tags are skipped +- **Property keys** - Which frontmatter keys to compare