///
Fabric offers a robust system for augmenting humans with AI, and a key part of this flexibility is the ability to create and manage your own personalized AI prompts, known as **[Patterns and Prompting
767 views
~767 views from guests
Guest views are estimated from total page views. These include anonymous visitors and users who weren't logged in when they viewed the page.
Fabric offers a robust system for augmenting humans with AI, and a key part of this flexibility is the ability to create and manage your own personalized AI prompts, known as Patterns and Prompting. These custom patterns allow you to tailor AI solutions precisely to your unique needs, keep proprietary logic private, and ensure your workflow remains stable even as the core Fabric framework evolves.
This page will guide you through setting up a dedicated directory for your custom patterns, creating new patterns, and using them effectively with the Fabric CLI.
To begin using custom patterns, you first need to configure a dedicated directory where Fabric can find them. This ensures your personal patterns are kept separate from Fabric's built-in patterns↗ and are safe from being overwritten during updates.
Follow these steps to set up your custom patterns directory:
~/my-custom-patterns. Fabric will automatically create this directory if it doesn't already exist.Once configured, Fabric will remember this location and automatically include patterns found there.
After setting up your custom patterns directory, you can start creating your own. A Fabric pattern is typically a directory containing a system.md file (and optionally other files like user.md for multi-turn conversations or example.md for documentation). For detailed information on the structure and philosophy behind Fabric patterns, please refer to the [[Patterns and Prompting|Patterns and Prompting]] wiki page.
Here’s how to create a simple custom pattern:
~/my-custom-patterns and you want to create a pattern named my-analyzer:
system.md file within this new directory. This file will contain the core instructions for your AI pattern. You can use any text editor, or simply the echo command for a quick start:
This command creates a
system.md file defining a pattern that acts as a text analyzer.You now have a functional custom pattern ready for use!
Once created, your custom patterns can be used just like any of Fabric's built-in patterns↗. You invoke them using the fabric --pattern flag, followed by the name of your pattern.
For instance, to use the my-analyzer pattern created above with some input text:
Fabric will process the input through your my-analyzer pattern, and the AI will respond based on the instructions you provided in ~/my-custom-patterns/my-analyzer/system.md.
For convenience, you can also set up shell aliases to invoke your custom patterns directly as commands (e.g., my-analyzer "input text" instead of fabric --pattern my-analyzer "input text").
Custom patterns offer several compelling benefits:
fabric --listpatterns alongside all built-in patterns, creating a unified and intuitive experience. There's no separate command or interface needed to manage them.fabric --updatepatterns. This ensures your personalized AI solutions remain stable across software versions.By leveraging custom patterns, you can unlock the full potential of Fabric to create a truly personalized and powerful AI augmentation framework.