LangChain steps into the JS octagon

Issue #191.May 29, 2023.2 Minute read.

Today’s issue: Making my smarthome type-safe, a pack of Marlboro Reds, and the Cirque du Soleil dancers who ruined React’s birthday party.

Welcome to #191.

Eyeballs logo

The Main Thing

A rapper holding up his chain

Do your LangChain hang low?

LangChain steps into the JS octagon

There are two main reason why we haven’t written a ton of Bytes stories about AI tools: 1) I usually try to focus on more web dev-specific topics, and 2) despite what others are doing on Twitter, we try to only talk about things we know.

But since LangChain decided to step into our sandbox by releasing LangChain.js, we knew we had to cover it.

What’s LangChain? It’s a framework for developing apps that can easily call out to large language models (LLMs) like GPT, via an API. It’s also working on giving applications the ability to connect an LLM to other sources of data and allowing a language model to interact with its environment.

The framework does this by providing different components, which allow developers to easily add some powerful LLM functionality to their apps. Here are a few of those:

  • Models — Allows your app to integrate with a variety of LLMs and chat models.

  • Indexes — Patterns and functionality for working with your app’s own data and getting it ready to interact with language models (including document loaders, vector stores, and text retrievers).

  • Memory — Gives you a standard interface for memory, which refers to persisting state between calls of an LLM chain/agent. It also gives you a collection of different memory implementations you can use.

LangChain started out as a Python tool, but LangChain.js brings all that large language goodness to browsers, Deno, Cloudflare Workers, Vercel/Next.js, SupaBase Edge Functions, and ESM/Common JS. So we’ll probably start seeing a lot more AI web apps soon.

Bottom Line: I hope this spawns the next generation of chat interfaces that are light wrappers over ChatGPT. One can never have enough chat interfaces.


postman logo

Our Friends
(With Benefits)

Big Bird sitting in a meeting looking confused

Can we get a status update on the Project Spectrum API?

Postman helps your team build APIs together

…without having a million meetings a week.

Postman workspaces help your team collaborate every step of the way — from design and development, to testing and monitoring.

That way, you don’t spend weeks building out an API, just to have Jake-the-hyperactive-Product-Manager come in at the last second and ask you to start over. (We’ve all been there ☠️.)

Here’s how it works:

  • Members of your Workspace can securely comment on elements, use and change elements, and fork existing elements.

  • Workspaces store a versioned history of all your changes and can create a single source of truth for your API projects.

  • You can assign different roles in your Workspace to set up granular permissions, and it’s easy to invite outside partners and new team members.

TLDR — Your team will ship faster, catch issues sooner, and avoid soul-sucking “sync up” meetings.

Check it out — it’s free to start.

Pop Quiz logo

Pop Quiz

Sponsored by Big League Chew Bubble Gum

OK that’s a lie. Our sponsor bailed last minute.

What color is the <p> tag’s text?

<p class="hello">Hello</p>

  body { color: red; }
  p { color: green; }
  .hello { color: unset; }

Thanks to Wes Bos, the inventor of the Web Browser, for the I literally copy/pasted his tweet inspiration behind this one.

Cool Bits logo

Cool Bits

  1. Node.js just turned 14 years old, which means it’s legally old enough to drive a pickup truck down to the convenience store and buy a pack of Marlboro Reds to smoke with his stepdad.

  2. React just turned 10. We tried to film ourselves doing an interpretative dance to commemorate the occasion, but the Cirque du Soleil crew didn’t show up on time, and we couldn’t hang all the ropes from the ceiling by ourselves.

  3. I recently turned 33, but so this entire CoolBits isn’t about birthdays you don’t care about… Aimless.js is a library for generating random numbers in JavaScript. Kind of like how Family Guy uses a randomness generator to write all of its jokes.

  4. deno compile now supports npm packages in the newly released Deno 1.34.

  5. Garph provides a fullstack TypeScript experience for building GraphQL APIs without codegen.

  6. This Node.js Log Management Tool from Datadog gives you the ability to search and analyze your logs at scale, so you can optimize Node performance. [sponsored]

  7. A few minor releases: Parcel 2.9, ls-lint 2.0, Nuxt Devtools v0.5, and Rspack v0.1.12. TLDR - they all got more blazing.

  8. Microsoft created DeviceScript - which brings a TypeScript DX to tiny IoT devices. Maybe adding static types will finally help me fix the bugs in my custom smarthome code. It’s getting pretty annoying to have R. Kelly’s “I believe I can fly” start playing at full blast on my Alexa every time I flush the toilet.

Pop Quiz logo

Pop Quiz: Answer

What color is the <p> tag’s text?

<p class="hello">Hello</p>

  body { color: red; }
  p { color: green; }
  .hello { color: unset; }

The answer is red since unset “unsets” the style of the p tag, so it inherits from its parent – body.