danielmiessler / fabric

fabric is an open-source framework for augmenting humans using AI. It provides a modular framework for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.
https://danielmiessler.com/p/fabric-origin-story
MIT License
22.72k stars 2.37k forks source link

[Feature request]: A pattern that suggests what fabric pattern/command to use #676

Open kevnk opened 2 months ago

kevnk commented 2 months ago

What do you need?

As a newbie to this, I basically only use extract_wisdom, but I know there's got to be more.

I'd love to run something like fabric suggest "I have a youtube video that I just want to get the main how-to steps out of it"

I would imagine the output being either: 1) Here are some commands you could run yt "YOUR VIDEO" | some_command (maybe it shows and explains multiple options OR maybe it just says, "I got you, paste in the video URL and I'll run this command: some_command") 2) No command is found and so it runs create_pattern for you (bonus: if it prompts you to save this somewhere and copy it into the patterns directory. Double bonus: if it does that and then runs it!)

I'm thinking the fabric suggest command may dynamically cache some version of create_summary and/or explain_docs loop through all the patterns as context for suggesting the right command.

Or maybe if you really wanted to get fancy, you could set up a vector database for all the fabric commands to be able to search it better with real language without pinging your model. (This is new stuff to me and I'm not sure where I would start)

BOTTOM LINE: I want to use fabric more, but I don't want to spend time reading through all the system.md to guess what it's going to do.

kevnk commented 2 months ago

Running this now...

"I want a pattern that suggests what fabric pattern (https://github.com/danielmiessler/fabric/) I should use. The input would be what the user is looking for the pattern to do and the output would be a list of suggested fabric cli commands what you could run with an explaination of each. If there are no patterns that would seem relevant, then it could suggest `create_pattern` to create a new one and give instructions on storing/coping the pattern accordingly to get it working correctly. There should be a context.md file included in this pattern too that has a summary of all the docs and a summary of each of the commands" | fabric -sp create_pattern
xeniode commented 2 months ago

Any luck with generating a pattern to do this? I would be interested in such a feature. Also a noob. :)

kevnk commented 2 months ago

Any luck with generating a pattern to do this? I would be interested in such a feature. Also a noob. :)

Actually, we pull requested in the suggest_pattern command a couple of days ago. But it won't exactly work without some tweaking...

  1. after installing fabric locally (and maybe fabric --update if you've already installed it), you'll find all the patterns (at least on mac) in ~/.config/patterns
  2. In the suggest_pattern directory, there's a user.md file with all the summaries of all the prompts.
  3. I'm not sure how to utilize the user.md file, but if you copy those contents into the suggest_pattern/system.md file, then run something like echo "this is the thing I want to do with fabric" | fabric -sp suggest_pattern then it might work!

Let me know how it goes!

I'll keep this issue open until we figure out the "right" way to do it...

xeniode commented 2 months ago

Did you copy what is in user.md into system.md?

The system.md already has content in it, and with the way patterns are setup, I am not sure which section the user content would go into.

I tried using suggest_pattern as is:

echo "I want a pattern that will create dataview and templater scripts for me. Both dataview and templater are plugins for Obsidian notes." | fabric -p suggest_pattern

And the result made no sense really:

suggest_pattern_response.md

It seems to think I want a pattern for the actual scripting engines.

Let me know what you think.

Thanks.

atljoseph commented 1 week ago

I think something like this should really be a sub command of the fabric cli. So people could use ‘fabric suggest “list all the patterns that might be good at parsing the result of a cURL call returning html markup from a web page, so it can then be piped to another pattern?”’. Then it would look up all the patterns and (based on the names or some basic description or data) might spit back a couple pattern names, or suggest the exact command to be ran in order to create a new pattern (in addition to suggesting an improved prompt for the creation thereof). @danielmiessler what are your thoughts on that? Thank you, and thank you for the golang migration (golang dev here).