Skip to content
Frank Huettner

Agentic AI in Business · Workshop II

Homework, Part A: Set up your test mailbox

Steps 1 to 7: update kingo-pod, make the account, copy Kaminski's mails into it.

On this page
Gmailyour test Gmail accountPart A · steps 1–7 · you are here
Mailkingo-pod's service: copies the mails, masks addressesPart A · steps 1–7 · you are here
PostgreSQLevery mail as a rowPart A · steps 1–7 · you are here
n8ndoes the workPart C · steps 9–13
Langflowthinks: sorts and draftsPart B · step 8
Part A · steps 1–7 · you are here
Part C · steps 9–13
Part B · step 8

1. Update kingo-pod: get the new part called ‘Mail’

kingo-pod is the course software on your laptop. Langflow and n8n run in it. This update adds a new part called Mail. It connects your test Gmail account to kingo-pod. Later, it also sends the answers you approve.

Open a terminal (on a Mac: the Terminal app; on Windows: the Ubuntu app) and run this one line:

cd ~/kingo-pod && git checkout -- . && git pull --ff-only && ./kingo backup && ./kingo update && ./kingo mode abp

Near the end, you should see a line that starts with Stack updated — kingo-pod 1.4.3 (or a higher number).

This can take a few minutes. You don’t have to wait: go on with steps 2 to 5 in your browser. The update keeps running in the terminal.

In case you care about what this does
  • && just connects the commands: each one starts when the one before it worked. If one fails, the line stops there.
  • cd ~/kingo-pod goes to your kingo-pod folder.
  • git checkout -- . undoes changes in your kingo-pod folder. For Workshop I, many of you added nemoguardrails to langflow/requirements.txt. That change stopped every update since. kingo-pod now has nemoguardrails built in.
  • git pull --ff-only gets the newest version.
  • ./kingo backup saves your Langflow flows and n8n workflows first.
  • ./kingo update builds the new version.
  • ./kingo mode abp starts the parts we need: Langflow, n8n, the PostgreSQL database, CloudBeaver and a service called Mail.

Stuck? Help for step 1

2. Make your test Gmail account

  1. Go to https://accounts.google.com/signup. Google will ask for your phone number.
  2. Use this pattern for the address: n8n.<givenname>.<familyname>@gmail.com
    • For example, for Min-ji Kim: n8n.minji.kim@gmail.com (small letters, no spaces, no hyphens)
    • If the address is taken, add a 2: n8n.minji.kim2@gmail.com
  3. When Google suggests addresses, click Create your own Gmail address. Type the part before @gmail.com.

This account is only for the course. Do not use your private account or your SKKU account: the AI assistant you build will read and send mail in this account.

3. Set your test Gmail account to English

In Gmail, signed in with your test Gmail account: gear icon → See all settings → General → Language: English (US) → Save Changes (at the bottom of the page). Do this before step 6: then the folders in your test Gmail account have English names, as in this guide.

4. Turn on 2-Step Verification (needed for step 5)

Go to https://myaccount.google.com/security → 2-Step Verification → turn it on. Choose text messages, the Google prompt, or an authenticator app. A security key alone does not work for step 5.

5. Make an app password for kingo-pod

  1. Go to https://myaccount.google.com/apppasswords.
  2. Type a name for it, for example kingo mail, and click Create. The name does not matter; it only helps you find the password on this page later.
  3. Google shows 16 letters, only once. Copy them.

This is not your Google password. It is a second password, only for kingo-pod: with it, kingo-pod can read your test Gmail account and send the answers you approve. You can delete it any time on the same page.

Stuck? Help for step 5

6. Connect your test Gmail account to kingo-pod

First check that step 1 is done. In the terminal, in your kingo-pod folder, run:

./kingo status

You should see Mail in the list. Then run:

./kingo mail

It asks four questions:

  1. The address of your test Gmail account. Type the full address, with @gmail.com, for example n8n.minji.kim@gmail.com.

  2. The app password from step 5. You will not see it while you type.

  3. Other addresses kingo-pod may send mail to. Type your SKKU address. On 9 November you will write from your SKKU address, and your AI assistant’s answers go back to it.

    Why kingo-pod asks for these addresses

    kingo-pod sends mail only to your test Gmail account and the addresses you type here. A mail to someone in Kaminski’s mails lands in your own test Gmail account instead. A mail to any other address is not sent at all. So neither your AI assistant nor a mistake can send mail to anyone else.

    Forgot your SKKU address, or want to add another one later? Run ./kingo mail again. Every question now shows your last answer in brackets. Press Enter to keep it, also at the app password, and type all addresses at question 3.

  4. The sender name. Press Enter. That takes the name in the brackets, Vince J Kaminski: your AI assistant answers in his name.

kingo-pod then checks the login. It sends nothing. You should see a line that starts with OK. Folders:.

Below it, kingo-pod says how many of Kaminski’s mails your test Gmail account already holds, and asks a question:

Your test Gmail account holds 0 of 3,244 of Kaminski's mails.
Upload them now? [Y/n]:

Your account is new, so it holds none of them. The question is the start of step 7.

Stuck? Help for step 6

7. Copy Kaminski’s mails into your test Gmail account

Your AI assistant will search Kaminski’s old mails for facts when it drafts an answer. The update in step 1 brought all 3,244 mails onto your laptop, inside kingo-pod. Now you copy them from kingo-pod into your test Gmail account.

  1. The terminal still shows the question from the end of step 6: Upload them now? Press Enter. That means yes.

    After a short while, you see a line that starts with Mailbox: and ends with Uploading starts now.

    Did the question not come, or did you answer no? Run this in the terminal, in your kingo-pod folder. It uploads the mails too:

    ./kingo mail seed
    What happens

    In a few seconds, kingo-pod puts all mails into its service called Mail, on your laptop. Mail keeps this copy: with it, Mail knows what is new on each side. From there, kingo-pod copies the mails into its PostgreSQL database and uploads them to your test Gmail account, round by round. In the end, every mail is in three places: in Gmail, in Mail, and in PostgreSQL, where n8n and your AI assistant read it.

  2. The command is done, but the upload goes on inside kingo-pod for about 30 minutes, sometimes longer. Be patient. Keep kingo-pod running and your laptop awake.

  3. Watch the mails arrive. They come step by step over the 30 minutes, so the numbers in Gmail grow while you watch. Open Gmail in your browser, signed in with your test Gmail account. When the upload is done, you see:

    • Sent (in the menu on the left): the mails Kaminski wrote, about 870 conversations.
    • All Mail (in the menu on the left, under More): about 1,600 conversations.
    • Inbox: stays empty for now. That is right: new mail comes in step 12 and in the workshop.
    Why not 3,244?

    Gmail counts conversations, not mails: a mail and all its answers are one conversation. So Gmail shows smaller numbers, but all 3,244 mails are there.

    To count the mails, ask kingo-pod: run ./kingo mail status. It shows each folder twice, here and at Gmail. When the numbers are the same in every row, the upload is done. (No such rows? Run ./kingo update first.)

  4. You don’t have to wait for the upload: go on with Part B now. The upload keeps running in the background.

Good to know:

  • kingo-pod copies every mail only once. If you run ./kingo mail seed again, kingo-pod answers already seeded and gives the upload a push.
  • Do you connect a second laptop to the same test Gmail account? kingo-pod sees which of Kaminski’s mails the account already holds and uploads only the missing ones. If all are there, it uploads nothing and copies them from Gmail.
  • If your laptop sleeps or kingo-pod stops, start it again with ./kingo up. The upload goes on by itself.

Stuck? Help for step 7

Next: Part B · Test Langflow →

If something goes wrong

Find your step. Still stuck? Write to Frank: then we fix it together.

Step 1

What you seeWhat to do
The line stops with fatal: not a git repositoryYour kingo-pod folder came from the old ZIP download. Run ./kingo update, then ./kingo mode abp.
The line stops with another errorSend Frank a screenshot of the error and of what git status shows (run it in your kingo-pod folder).

Step 5

What you seeWhat to do
No app passwords pageTurn on 2-Step Verification with text messages or the Google prompt. A security key alone is not enough.

Step 6

What you seeWhat to do
Sign-in failedPaste the app password again (not your Google password). Check that 2-Step Verification is on.
the mail service is offRun ./kingo mode abp, then step 6 again.
You want to start again with another accountRun ./kingo mail reset, then step 6 again.
kingo-pod asks only three questions, and not Upload them now?Your kingo-pod is older. Do step 1 again (the update). Then go on with step 7 and run ./kingo mail seed there.

Step 7

What you seeWhat to do
already seededYour account already has the mails. Look in Sent and All Mail.
cannot read the mails in your test Gmail accountkingo-pod could not look into your account, so it uploaded nothing. Check your internet connection. Then run ./kingo mail seed.
The numbers in Gmail stop growingBe patient: kingo-pod uploads in rounds, and Gmail’s numbers can stand still for up to 10 minutes. Reload Gmail. Keep your laptop awake. Still no change after 20 minutes? Run ./kingo update, then ./kingo mail seed again: it copies nothing twice and gives the upload a push. Still stuck? Send Frank everything that ./kingo mail status shows.
Gmail shows about 1,600 in All Mail, not 3,244That is right: Gmail counts conversations, not mails. ./kingo mail status counts the mails.
./kingo mail status shows an errorCopy the error into a mail to Frank.