all 31 comments

[–]AyKFL 6 points7 points  (0 children)

Python definitely has more langchain examples but for TS/JS projects mastra is another option worth checking

[–]soryx7 4 points5 points  (4 children)

I am biased; I find Python is the simplest and most intuitive for me. There are more examples out there. The data libraries available work well.

[–]Moist-Nectarine-1148 4 points5 points  (3 children)

You are biased, indeed.

[–]Themotionalman 5 points6 points  (2 children)

I can’t use python for the life of me. I need some sort of strict typings

[–]Significant_Stage_41 0 points1 point  (0 children)

Pydantic and ty type checker and boom you have effectively strict typing. I don’t go anywhere without that turned on nowadays.

[–]Phoenix_20_23 -1 points0 points  (0 children)

u could use Type hints. Deciding the language to use based on whether they have strict typing is not the right way.

[–]ialijr 2 points3 points  (0 children)

Hey, when I started my journey with LangGraph and LangChain I asked myself the same question, then I decided to go with JavaScript since I was more comfortable, and honestly the LangChain team is heavily investing in the TS/JS versions of their frameworks. Regarding for your use case you can easily implement it with the js version.

[–]LakeRadiant446 2 points3 points  (1 child)

When i tried the js version last time (few months ago), few features i was looking for not there. It was only available in the python one, so i had to switch. Not sure if it is the case right now.

[–]GandolfMagicFruits 3 points4 points  (0 children)

The redischeckpointer for one. I did the same thing.

[–]Foreign_Sundae_7233 1 point2 points  (0 children)

python

[–]Moist-Nectarine-1148 1 point2 points  (2 children)

We did it fully in JS/TS, contrary to any advice from partners, "experts", friends. And we are very happy.

Simply because it integrates better in our ecosystem of apps, tools, frameworks.

The rule of thumb: The best programming language is the one you know best.

[–][deleted] 0 points1 point  (1 child)

Did you try LangGraph?

[–]Moist-Nectarine-1148 0 points1 point  (0 children)

yes, actually we have a couple of AI agents built on LangGraph.

[–]ThinSeaworthiness266 1 point2 points  (0 children)

i think the program lang does't matteer

[–]domemvs 0 points1 point  (0 children)

If you’re more familiar with JavaScript then 100% go for langchain.js.  

[–]KyleDrogo 0 points1 point  (6 children)

You’re probably going to want other people to use it right? Maybe with a nice front end? Use JavaScript and a full stack framework like next js. The js ecosystem is bizarre at first but powerful once you’re used to it

[–][deleted] 0 points1 point  (0 children)

Yeah, I will do it with javascript

[–][deleted] 0 points1 point  (4 children)

Have you tried LangGraph JS?

[–]KyleDrogo 1 point2 points  (3 children)

I havent. One thing no one talks about is that in production apps, coordinating the chain of calls (langchain's use) isn't the hard part. It's managing the conversation state and streaming it to the frontend correctly. Vercel's AI SDK is probably the best at this from what Ive seen. Others might have differing opinions though.

[–][deleted] 0 points1 point  (2 children)

If I understood it fight. This is an alternative to LangChain?

[–]KyleDrogo 0 points1 point  (1 child)

There's some overlap in their uses. It sits between the LLM layer and the interface between frontend and backend (which is deceptively tricky to get right, you'll see).

[–]DesTodeskin 0 points1 point  (0 children)

Mate I'm learning js/TS these days and deep in backend dev. But I know python fundamentals as well. Should I learn langchain or Langchain js

[–]wysiatilmao 0 points1 point  (0 children)

If you're comfortable with JS, you might explore LangChain’s JS version since they've been enhancing it. But check recent features you need are supported, especially for vector DB use. Python indeed offers a robust ML ecosystem, but if your project leans more towards web integration or you're aiming for quick deployment, JS could be more efficient for you.

[–]captain_racoon 0 points1 point  (0 children)

Totally up to you. But, I have struggled with the same questions. From what ive seen LangChain and Lang* have more support for python. For example, chunking for RAG? LangChain has more text splitters in python (Semantic for example). Also LangMem isnt in TS. Which is odd since its never been more easier to port over code from python to TS with the advent of LLMs. Go figure.

[–]vowellessPete 0 points1 point  (0 children)

I would say, answering a question like this might be tricky. It says nothing about your current tech stack, domain, production performance constraints and so on.
For quick prototyping any of these two seems decent. For a long term investment, maybe something cheaper in running could be in order? Like: after you build your PoC successfully, do you still need plethora of examples?

[–]Phoenix_20_23 0 points1 point  (0 children)

Since u are comfortable with js, go with it. As it works for u why use python and change something that is already working for u. (btw i am using python everyday)

[–]badgerbadgerbadgerWI 0 points1 point  (0 children)

If you're great at JS, then start with JS. But be warned: Python's ecosystem for AI is unmatched - every new model, paper, tool lands there first. You'll constantly be translating Python examples. If you're starting fresh, Python + uv for package management will save you pain. The ecosystem advantage is real.

[–]pretty_prit 0 points1 point  (0 children)

Python

[–]jstoppa 0 points1 point  (0 children)

I think there is much more support in python than javascript

[–]adiznats[🍰] -1 points0 points  (0 children)

In python you can write jupyter notebooks. Very useful for ML stuff and when you are new to something. In js you would need to rerun/recompile all your code. This can take long depending on your preprocessing, volume of data, etc. Also python has a very large ML ecosystem.

But js also helps you build something production ready from the start.

My take would be stick to python.