Help read files with GitHub

Hey lovely community!

I’m pretty new to n8n workflows, and I have a hard time to share some files with the AI Agent.
I wanted to upload some .md files on GitHub, so the Agent can read it easily with markdown format.

Describe the problem/error/question

If I use a GitHub get file tool, that reads the GitHub md file in base64 and I need to convert first if I want to continue the workflow. Doesn’t sounds optimal for me.

I saw there is an http Get request to read the raw format. Until now best solution.

Is there any better way to share multiple .md files from let’s say products and the AI Agent can decide which one to pick and read it with the easiest way? Or other format that is better than markdown for Agent? PDF, Google Drive Document, Air table Grid…

I’m open to use any other platform (if GitHub makes trouble) - and doesn’t need payment :grinning_face_with_smiling_eyes: .

What is the error message (if any)?

no error message

Please share your workflow

just a simple AI Agent with a GitHub tool.

Share the output returned by the last node

I get response like this :

“content”:
"CiMgRmVtZGlzYyBNYXJrZXRpbmcgUGl0Y2gKCiMjIEZlbWRpc2M6IFJlZGVm\n…

Information on your n8n setup

  • n8n version: 1.97.1
  • Database (default: SQLite): non
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker, self hosted
  • Operating system: deployed on Ubuntu, my OS is windows 11

Cheers,
Nandor

Hey @n3ndor hope all is good.

What is wrong with converting b64 converting? It’s very fast and isn’t very resource consuming?.. Is there something specific you wouldn’t like about it?
What is wrong with getting the raw file via http request? It is also pretty fast and shouldn’t cause a problem.
When you say a better way, you need to share what it is you DON’T like about other approaches, because “better” is very subjective. We need to know some reasoning for what makes one way good and another better or worse, otherwise better is just different. Hope I am making sense.

Tell us more, or what sort of issues you come across using the two approaches you’ve mentioned already.

1 Like

Hey @jabbson,
thank you so much for taking the time to respond to my message!

Yes, true… “better” is very subjective.
I have learned to code clean and I have hurt feeling when I create something with multiple steps that could be done with one simple clean line.

I read about RAG setups where we can provide a large amount of data - and I think that’s pretty impressive!

But what I’m interested in, is how can we minimize the input tokens from the AI agent so it can provide us with more precise answers?

Also, if you need to convert a file from one format to another, there is always a chance of getting a modified data back. So if there is way to avoid unwanted conversions - I’m all for it! (maybe you heard of the KISS principle)

Well if you are getting the file using a tool during the AI Agent prompt processing there is not a way around spending some cycles on retrieving the file.
If saving is the goal, I would either try to embed the prompt into the workflow (what is the reason for having the prompt to be remote by the way?), or use http request tool to get the raw version of the file.

1 Like

If I were you, I would either embed the system prompt in the AI Agent node itself, OR I would get it before the Agent Node gets its input and feed it to the AI Agent along with the user input.

1 Like