Help me write my book

I have a notion database with all the pages and text for a book I am writing. Unfortunately I do not have the text organized, categorized or even divided by chapter or topic. Its just a lot of different texts written at different times that I want to compile into making a book.

Today I tried creating a workflow that would get the database pages from the notion database, then adding an HTTP request to download the contents of the pages, then feeding that text (looped) into an LLM to get a chapter name for each text, then sending those chapter names to another LLM to narrow it down to 10 chapters.

I was unable to get good answers (maybe in my prompting) and also it’s too expensive to test building the workflow due to the amount of tokens i’m feeding each run, and it loops everytime i make a change so I end up processing hundreds of items over and over again.

Anyone has any idea how to build the workflow?

The goal is to classify all my texts into different chapters. Then creating another workflow to format the style and writing and add some research into the book.
What’s the best way to accomplish this?

1 Like

Try uploading the notion data to a vector store and then use that store for data ,
Also let me know which LLM model you are using, pricing may vary depending on model and version chosen for the the task

You could optimize the prompt engineering on a limited set of texts, for example by using a filter or limit node. Once you’re happy with your prompts, you can remove the filter. Also, use a cost-effective model like GPT-4o Mini or Gemini Flash to keep the costs low.

I’ll try the vector store approach, I’m just wondering when I prompt the AI agent, since it accesses chunks of data, will it be coherent in the big picture?

I was using 4 turbo. I think I’ll add credit to the open router rather than open ai, do you have any suggestions?

That’s a great idea, i’ll try that! and yeah I wasn’t using the cheap version, thanks for the directions. Would you recommend using open router over openai?

Hi @Pablo.chepi if your issue is resolved can you please mark the topic with same

Thank you :wink:

yes, completely. I just can’t find the button to mark it as a solution, am I blind?

To do that, just click the checkbox at the bottom of the post that contains the best answer.

I’ve been looking for the checkbox mark to brand as solved but I havent been able to, I can see it in my other posts.