Stored Contexts

Learn how to save and reuse context snippets with @ mentions

Stored Contexts in Promptly allow you to save reusable context snippets that can be quickly inserted into any prompt using @ mentions. This feature helps you maintain consistency and save time when working with frequently used information.

What are Stored Contexts?

Stored Contexts are reusable text snippets that you can save once and insert into any prompt using @ mentions. Think of them as shortcuts for commonly used context information like project specifications, personal preferences, coding standards, or any other text you frequently reference.

Creating Stored Contexts

Accessing Context Settings

  1. Open Promptly
  2. Click on Promptly in the menu bar
  3. Select Preferences (or use ⌘,)
  4. Navigate to the Contexts tab

Adding a New Context

  1. In the Contexts tab, click the "+" button or "Add Context"
  2. Fill in the context details:
    • Name: A short, memorable identifier (e.g., "project-specs", "coding-style")
    • Content: The text content you want to save
  3. Click "Save" to store your context

Context Naming Best Practices

  • Use descriptive, short names that are easy to remember
  • Consider using hyphens or underscores for multi-word names
  • Examples: project-goals, writing-style, code-standards, personal-info

Using Stored Contexts

@ Mention Insertion

To insert a stored context into any prompt:

  1. Type @ followed by the context name (e.g., @project-specs)
  2. As you type, Promptly will show matching contexts in a dropdown
  3. Use arrow keys to navigate the suggestions
  4. Press Enter to select and insert the context
  5. The full context content will be automatically inserted into your prompt

Fuzzy Search

The @ mention system includes intelligent fuzzy search:

  • You don't need to type the exact context name
  • Partial matches will appear in suggestions
  • The system learns from your usage patterns

Autocomplete Navigation

When the context suggestions appear:

  • Arrow Keys: Navigate up and down through suggestions
  • Enter: Select the highlighted context
  • Escape: Cancel the autocomplete
  • Continue Typing: Further filter the suggestions

Managing Stored Contexts

Viewing Usage Statistics

The Contexts settings page shows usage statistics for each context:

  • Usage Count: How many times you've used each context
  • Last Used: When you last inserted the context
  • This helps identify your most valuable contexts

Editing Contexts

To modify an existing context:

  1. Navigate to Preferences > Contexts
  2. Find the context you want to edit
  3. Click the edit (pencil) icon
  4. Update the name or content
  5. Click "Save" to apply changes

Deleting Contexts

To remove a context:

  1. In Preferences > Contexts, find the context to delete
  2. Click the delete (trash) icon
  3. Confirm the deletion

Integration with Custom Actions

Stored Contexts work seamlessly with Custom Actions:

Pre-selecting Contexts for Actions

  1. When creating or editing a Custom Action
  2. Use the Context Selection interface
  3. Choose which contexts should be automatically included when the action runs
  4. The selected contexts will be inserted before the action's prompt

This ensures consistent context is always available for specific actions without manual insertion.

Example Use Cases

Project Specifications

Name: project-specs
Content: This is a React/TypeScript web application using Next.js 14, Tailwind CSS, and shadcn/ui components. The project follows functional programming patterns and uses TypeScript strict mode.

Writing Style

Name: writing-style
Content: Please write in a professional but friendly tone, using clear and concise language. Avoid jargon and explain technical concepts in simple terms. Use bullet points for lists and include practical examples.

Personal Preferences

Name: coding-prefs
Content: I prefer: arrow functions over function declarations, const over let, destructuring for object properties, and detailed JSDoc comments for functions. Always include error handling and type safety.

Meeting Context

Name: team-context
Content: Our development team consists of 5 engineers working on a SaaS platform. We use Agile methodology with 2-week sprints, and our tech stack is React, Node.js, PostgreSQL, and AWS.

Best Practices

Context Organization

  • Keep contexts focused: Each context should serve a specific purpose
  • Regular maintenance: Review and update contexts periodically
  • Remove unused contexts: Delete contexts you no longer need

Content Quality

  • Be specific: Include relevant details that provide value
  • Keep it current: Update contexts when information changes
  • Reasonable length: Contexts should be substantial enough to be useful but not overwhelming

Naming Strategy

  • Consistent naming: Use a consistent naming pattern across your contexts
  • Descriptive names: Names should clearly indicate the context's purpose
  • Easy to remember: Choose names you can easily recall when needed

Smart Suggestions

Promptly's context system includes intelligent features:

  • Usage Learning: The system learns which contexts you use most frequently
  • Smart Ranking: More frequently used contexts appear higher in suggestions
  • Pattern Recognition: Suggestions improve based on your usage patterns

Troubleshooting

Context Not Appearing in Suggestions

If a context doesn't show up when using @ mentions:

  • Check that the context name is spelled correctly
  • Ensure the context was saved properly in Preferences
  • Try typing more characters to narrow the search

Autocomplete Not Working

If @ mention autocomplete isn't functioning:

  • Make sure you're typing @ followed by letters
  • Check that you have contexts saved in Preferences
  • Try restarting Promptly if the feature seems unresponsive

Context Content Issues

If inserted context content appears incorrect:

  • Verify the content in Preferences > Contexts
  • Edit the context to fix any formatting issues
  • Remember that contexts insert exactly as saved

Stored Contexts help you work more efficiently by eliminating repetitive typing and ensuring consistent context across all your AI interactions.