Exploration in LangChain and Agentic Tools

i’m tinkering around with trying to understand agentic AI and tool-use.

What I would like to be able to do is have the AI read a Google Sheet and use Tools to build multiple emails for me.

Hours 1-2

I read that LangChain is a framework for creating Agents. I presume it’s free? I followed these instructions to get a local LLM installed on my laptop. These instructions said to use Ollama so that’s the path I’m heading down. https://js.langchain.com/docs/tutorials/local_rag

My laptop was able to read the example document. That’s a win. I have a Macbook Air M3 with 16GB of RAM that I bought in September 2024 for about $1,400 USD. In other words — a firmly middle-of-the-road new Mac. I presume it’s going to run slow as molasses?

Hours 3

Back to tools. The Ollama Blog announced tool support in July 2024 which led me to this code example. Now I think we’re in business!

https://github.com/ollama/ollama-python/blob/main/examples/tools/main.py

Reading the docs for Llama 3.2B, it appears this new version is OK for tools and designed to run on less powerful machines. I don’t know what 1B or 3B means. I guess 3B words indexed?

Ollama blog notes were very helpful in explaining the steps necessary to index my documents so that AI will be able to do something with the text. It involves making embeddings by using an indexer and a vector store. I don’t know what that means. Hopefully I don’t need to know? https://ollama.com/blog/llms-in-obsidian

Hour 4

So much information my mind is spinning right now.

This agent tutorial is exactly what I’d like to figure out. https://python.langchain.com/docs/tutorials/agents

LangChain has a lot of community-contributed tools. Most interesting tools I’m seeing right now are these tools:

  • Twilio – Can I get the Agent to create a message for me? Limited to SMS and WhatsApp messages so not quite what I’m looking for.
  • Playwright Browser Toolkit – maybe too advanced for a newbie. Requests may be better.
  • Requests interesting for scraping sites. I wonder if it could help me categorize blog content.
  • RSS Loader – could it help me curate stories?
  • Obsidian – for on-my-computer notes

Hour 5

https://python.langchain.com/docs/how_to/tool_calling

lost in the ether of wrestling with getting this to call a feed and find relevant articles. Realizing now that reading content has certainly been done-to-death. How can I make this do something more interesting for me?

Hour 6

struggled with having Ollama read and summarize my Flipboard magazine. this has been a waste of an hour

Hour 7

Back to the original idea of why did I want agent AI in the first place?

Goal: I want to increase sales. General one-message-for-all approach is not working. I want to split people up into groups/clusters of interests.

I also want to find a pattern of behavior that occurs before people buy.

It has been suggested to me that a Graph Neural Network (GNN) is a good way to identify this behavior. GNN is a whole different rabbit hole to look into. My friend told me to look at JanusGraph

At this point, I’m not quite sure how AI and Graphs fits into the picture here. The insight will come eventually.

Google Sheet to Figma Plugin

At Calm, we rely heavily on Figma to generate marketing copy proofs for copywriters and other marketing folks to see their text visually in an email mockup.

Typically the process might go as follows:

  1. Using an existing template, our designer mocks up a series of emails containing rough draft.
  2. 3-email series x4 population segments = [12 emails x 15 minutes per mockup = 3 hours]
  3. He shares with the copywriters.
  4. Copywriters eyeball the design and write new copy to fit the theme of the year. They don’t have Figma seats, so they write their revisions as Figma comments.
  5. The Designer now transfers the text edits from the Figma comments into the Figma text nodes. [5 minutes per email = 1 hour]
  6. Designer shares the Figma file back to copywriters. Every round of back-and-forth is 1 hour.
  7. Now we have to transfer the text from the Figma into email templates! [15 minutes per email = 3 hours]

The total effort is about 7 hours for a 12-email campaign or 35 minutes per email.

Our work process is overly reliant on having access to a Figma license. The process served us well for several years but we came to a crossroads where there are too many back-and-forths between design and copywriting and it was taking up a lot of time.

In effort to streamline or workload, I created a Figma plugin to pull text from a Google sheet

In Figma,

The Figma mockups have a specific # of text layers. I give each text layer a unique name:

Section1_Header
Section1_Body
Section1_Link

In Google Sheet,

Map a Google sheet row-for-row to each text layer.

Figma Layer NameGoogle Sheet AGoogle Sheet B
###.Email1Email1Email2
Section1_HeaderMy first newsletterMy second newsletter
Section1_BodyI was vacationing in Anaheim with family…I was on my way to Albuquerque on business…
Section1_CTAREAD MOREREAD MORE
Section2_HeaderEmployee of the monthEmployee of the month
Section2_BodyEdward Heinz wins for achievement in…Eliza Doolittle wins for achievement in…

Key difference from other plugins

I setup a Google App Sheets API client so that I could share any Google sheet with a programatically-generated email address (Google provides the email address). I can share any private Sheets document with the special email address rather than making the Sheet publicly viewable. I do not like the idea of a public Sheet.