Possible to train AI agents with personal written documents?

Describe the problem/error/question

I’m building a flow in which the user input is a topic and the intended output is an article. To have the article as close as possible to my personal style, tone, and voice, I like to feed the flow with articles I’ve written myself.

Is this possible? Which nodes do I need?

Information on your n8n setup

  • n8n version: no idea
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: W11

PS: for LLM I’m using Ollama and Llama3.2 locally

Welcome to the community.

This is possible.
The simple way is by making a very detailed system prompt that describes your writing style and gives examples on specific characteristics.

The complicated way is using something like qdrant where you make embeddings of your past writings. The learning curve is steap and takes lots of tinkering to get a usecase like this up and running, so i recommend starting fast with a good system prompt then take your time figuring out qdrant

Is there a limit on the system prompt?

I would copy paste an entire article in there and not sure if that is meant for that, especially in addition to instructions, persona, etc.

I can save my writing in PDF or in an Airtable, and have an agent review/read the content perhaps? So maybe not as complex as qdrant, but still a bit advanced?

Out of curiosity, when I put http links in the system prompt, will that do anything?

You can do something like that. check out Max’s notion chat assistant, you can do any similar to that and instruct it to use it as writing style context instead of for references.

You don’t want to make the system prompt too long, since you pay for the tokens. The longer the system prompt the more the api call costs.

If you aren’t sure how to describe your style, ask an LLM to help you write the system prompt it and give it articles to help.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.