• Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Bablosoft

How to write a good prompt for the agent

Scheduled Pinned Locked Moved Articles
1 Posts 1 Posters 12 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Roy MustangR Offline
    Roy MustangR Offline
    Roy Mustang
    wrote last edited by
    #1

    Agent and the AI module in BAS

    Prefer to watch? It's all in my YouTube video, it's available in English, Hindi and Turkish: how I wrote the prompt for the Steam parser from 20:19, and the breakdown of what a prompt should be made of from 28:58

    All the materials for the video are on my Telegram channel, come join: t.me/mustangbas

    Plan

    1. What happens with a bad prompt
    2. How to put a prompt together
    3. How I wrote the prompt for the Steam parser
    4. What the agent did with that prompt
    5. What to do if it's unclear how to write the prompt
    6. Conclusion

    What happens with a bad prompt

    People are used to writing a neural network a tiny prompt of a couple of lines. The big frontier models are good at this: they can finish part of the work on their own. And they can also get skills that ask questions about the project by themselves

    Frontier models will still fill in the gaps though. Whatever we didn't tell them, they just decide for us, and honestly, that's how all models work. If the prompt is bad, even they will get things wrong anyway, and the project, in short, may not come out the way we wanted

    Here's an example with the Steam parser. I wrote straight out that every category needs its own folder with a .csv file. If I hadn't written that, it could easily have saved everything into one big text file, and going through that would be as inconvenient as it gets

    That's why a prompt is better put together by a few rules, and I'll go through them below

    How to put a prompt together

    The four parts of a prompt and how they fit into my prompt for the Steam parser

    For the agent to understand everything, the prompt needs four parts, step by step:

    1. Context: what this project is and what it does. So literally tell it what the project does and what's in it. This step is also a kind of insurance: if something goes wrong in the other points, the agent can at least somehow put it all together
    2. What needs to be done: the task itself, directly and step by step. If it's vague, the agent can basically wander off somewhere else in no time
    3. What should come out: what result is needed at the end. It's better to really spell out the format, otherwise the agent will decide on its own where and how to save everything
    4. What must not be changed: this one is for an existing project. Here we can simply forbid the agent to touch some action or setting

    The first three points are the base, and they basically decide whether the prompt turns out good or not, and with it a good result

    Why spell it out in so much detail. The model doesn't know what's in our head. Anything that isn't in the prompt, it either makes up on its own or, and this happens more often, just doesn't do. On top of that, the agent's model isn't the very top one, so everything that matters really has to be spelled out here

    How I wrote the prompt for the Steam parser

    Before writing anything, I went to the Steam discounts page and just looked at how it's built. I decided to explain the Show More button, which loads more games, separately, because the agent could easily get confused by it

    I dictated the prompt itself by voice so the agent would build me the project. In the end it included:

    • the link to the page and a request to analyze it
    • the data format Name Game|Discount|Price
    • a separate folder for every category, with a .csv in it
    • a resource with filters and three categories, which can be changed later
    • what to do with the Show More button

    My prompt for the Steam parser: data format, a folder per category, filters, categories and the Show More button

    What the agent did with that prompt

    It built the resources exactly by the prompt, and even added hints to the fields by itself

    Resources the agent added by itself from the prompt: three categories and a filter with hints

    When it was testing, it picked Video Production and clicked that same Show More button I had described. In the end we got three folders, a CSV in each, and all the games in the format I had specified

    I didn't mention multithreading in the prompt, and the agent did all the work in one thread, just with loops

    For the Steam login I wrote separately that it should get the fingerprint in a While loop with error handling. And it really did that, exactly the way I wrote it

    The loop with retries for getting the fingerprint that I asked for directly in the prompt

    In the same prompt I pointed to the folder with all the data for the resources, and the agent filled in all the fields by itself

    What to do if it's unclear how to write the prompt

    Sometimes it's not clear how to write the prompt right or how to build the project at all. Then we can ask the agent to first write a plan of how it sees the situation, and decide what to do next based on that

    That's exactly what I did on another developer's big 6500-action project. I basically described to the agent everything I wanted:

    • split everything into functions
    • remove duplicates
    • label the actions in Russian
    • suggest proper names for the functions

    I didn't ask it to change the project itself yet, I was only waiting for a plan of how this could be done

    I asked the agent to look at the project and suggest a plan to clean it up, below is the start of its plan by stages

    The plan it sent was really huge, split into stages, from removing unused code to renaming functions. I didn't do everything at once, I took three tasks from the plan and gave those to the agent

    Conclusion

    So it turns out that the more context, task description and ideas of our own on how to build it the prompt has, the better the project comes out

    If writing all that is really hard, we can always just ask the agent itself: how to build it, what way out it sees, what prompt to write for it. The agent sees the project anyway, so it can usually give an answer

    By the way, it's easy to get disappointed in the tool itself when it simply wasn't given the data it needed. It never comes out perfect from the first prompt anyway, every model makes mistakes, so the mistakes have to be explained and fixed either way

    work tg - https://t.me/stormragework

    1 Reply Last reply
    0

  • Roy MustangR

    Как правильно писать промт для агента

    Scheduled Pinned Locked Moved Articles
    1 Votes
    1 Posts
    32 Views
    No one has replied
  • Roy MustangR

    Что получилось на практике с модулем AI

    Scheduled Pinned Locked Moved Articles
    1 Votes
    1 Posts
    18 Views
    No one has replied
  • Roy MustangR

    Я написал пять проектов разного масштаба с помощью агента и вот результаты

    Scheduled Pinned Locked Moved Articles
    1 Votes
    1 Posts
    10 Views
    No one has replied
  • Roy MustangR

    What came out of using the AI module in practice

    Scheduled Pinned Locked Moved Articles
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • Roy MustangR

    How to solve the context problem in the agent

    Scheduled Pinned Locked Moved Articles
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
  • Login

  • Don't have an account? Register

  • Login or register to search.