The cross-project pattern library

The pattern library is a per-machine store of past solutions in ~/.paqad/patterns/, shared by all your projects and never committed. In 1.91.1 you can list, prune and export it, but nothing adds patterns automatically.

  • Patterns library
  • Checked against paqad-ai 1.91.1
  • Reviewed 25 September 2026 by Eliyce

What the pattern library is

The pattern library is a store of past solutions: short records of a problem, how it was solved and whether tests and the build passed afterwards. The idea is that an AI tool working on a similar problem later, in any of your projects, can start from something that already worked.

The library lives on your own machine, not inside a project. It is shared by every project on that machine and is not committed to git.

In 1.91.1 you can list, prune and export the library, but no command or workflow adds patterns to it. Recording patterns explains what that means in practice.

Where patterns are stored

PathWhat it holds
~/.paqad/patterns/entries/<id>.jsonOne JSON file per pattern with the full record.
~/.paqad/patterns/index.jsonA summary of every pattern (id, category, stack, tags, date and the first 100 characters of the problem), used for fast filtering.
~/.paqad/patterns/vectors/Only when RAG is turned on: numeric versions of each pattern used for similarity search, one folder per embedding provider and model.

What a pattern contains

FieldMeaning
idA random unique identifier (a UUID).
created_atWhen the pattern was saved. Used to decide whether it is stale.
source_projectThe folder name of the project it came from.
stack_filterThe domain (coding or content), the frameworks and the traits it applies to.
categoryA label for the kind of work, general when none was given.
problemWhat needed solving.
solutionHow it was solved.
files_involvedThe files the solution touched.
verificationTwo yes-or-no values: tests_passed and build_passed.
tagsKeywords for searching and filtering.

How patterns are used

  • By the AI, as instructions. Two of the agent roles Paqad installs, the solution architect and the market researcher, are told to check ~/.paqad/patterns/ for similar past solutions. Whether and how the AI does this is model judgment, and it depends on your host tool allowing the AI to read files outside the project.
  • By you, from the command line. paqad-ai patterns list filters the library by domain, category, frameworks or keywords. paqad-ai patterns prune deletes old patterns, and paqad-ai patterns export writes them to a JSON or Markdown file. Details are on the patterns command reference.
  • By a scoring routine. Paqad's code contains a deterministic scoring routine for ranking patterns against a task. In 1.91.1 no command calls it. See How patterns are scored.

Does pattern text leave your machine

The library itself is plain files in your home folder. The only time pattern text is processed elsewhere is when RAG (the code search index) is turned on in a project. Building or refreshing that index also turns each pattern's text into vectors (lists of numbers that let similar texts be found) using the embedding provider you configured. With a hosted provider such as openai or voyageai, the pattern text is sent to that provider. With the local provider it is processed on your machine. RAG is off by default. See RAG overview.

Not the same as defect patterns

Paqad keeps a separate store of recurring defects found by compliance checks in ~/.paqad/defect-patterns/. That store is not part of the pattern library and is not managed by paqad-ai patterns.

Something on this page out of date or unclear? Open an issue on GitHub and name the page.