Zum Hauptinhalt springen
YouTube Security VideosNASA's SpaceX Crew-13 Postlaunch News Conference (Oct. 1, 2026)(01.10.2026 um 20:03 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-13 Arrival & Welcome Remarks(02.10.2026 um 04:02 Uhr)
••
YouTube Security VideosNASA: From the Moon to the 50-Yard Line(06.10.2026 um 01:21 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-12 Hatch Close(07.10.2026 um 12:40 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-12 Undocking(07.10.2026 um 14:32 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-12 Re-Entry & Splashdown(08.10.2026 um 18:52 Uhr)
•
YouTube Security VideosNASA's SpaceX 35th Commercial Resupply Services Launch(09.10.2026 um 16:36 Uhr)
•
YouTube Security VideosNASA's Northrop Grumman Commercial Resupply Services 24 Departure(09.10.2026 um 19:14 Uhr)
•
YouTube Security VideosOpenAI: Stack Overflow - From Idea to Product | DevDay 2026(07.10.2026 um 23:10 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-13 Postlaunch News Conference (Oct. 1, 2026)(01.10.2026 um 20:03 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-13 Arrival & Welcome Remarks(02.10.2026 um 04:02 Uhr)
••
YouTube Security VideosNASA: From the Moon to the 50-Yard Line(06.10.2026 um 01:21 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-12 Hatch Close(07.10.2026 um 12:40 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-12 Undocking(07.10.2026 um 14:32 Uhr)
•
YouTube Security VideosNASA's SpaceX Crew-12 Re-Entry & Splashdown(08.10.2026 um 18:52 Uhr)
•
YouTube Security VideosNASA's SpaceX 35th Commercial Resupply Services Launch(09.10.2026 um 16:36 Uhr)
•
YouTube Security VideosNASA's Northrop Grumman Commercial Resupply Services 24 Departure(09.10.2026 um 19:14 Uhr)
•
YouTube Security VideosOpenAI: Stack Overflow - From Idea to Product | DevDay 2026(07.10.2026 um 23:10 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

LangChain overview for Node.js

LangChain.js is a framework for LLM applications in TypeScript and Node.js. It standardizes how you wire prompts, models, tools, document loaders, embeddings,…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!

LangChain.js is a framework for LLM applications in TypeScript and Node.js. It standardizes how you wire prompts, models, tools, document loaders, embeddings, and retrievers into reusable pipelines and agents.






LangChain, Deep Agents, LangGraph, and LangSmith




























Project Role
LangChain High-level APIs: LCEL chains, createAgent, loaders, retrievers
Deep Agents Batteries-included agent harness: planning, subagents, filesystem, context management
LangGraph Low-level orchestration; LangChain agents run on LangGraph under the hood
LangSmith Tracing, debugging, and evaluation for LangChain and LangGraph apps


Use Deep Agents for complex multi-step tasks out of the box. Use LangChain's createAgent when you want a minimal harness you compose with middleware. Reach for LangGraph when you need custom stateful workflows, branching, or fine-grained control over the agent loop.






Packages



Install the core packages first (install guide):




npm i langchain @langchain/core @langchain/openai zod






Provider-specific integrations live in separate packages:





  • langchain - createAgent, tool, and high-level chain helpers


  • zod - tool input schemas when defining tools with tool()


  • @langchain/core - prompts, output parsers, Runnable interface, LCEL


  • @langchain/openai - ChatOpenAI, OpenAIEmbeddings


  • @langchain/textsplitters - document chunking (used in the RAG post)

  • Standalone integration packages for other providers and tools (see the integrations page)



For raw API access, see the Chat Completions and OpenAI Responses API posts. For provider-agnostic text and agents, see the Vercel AI SDK and OpenAI Agents SDK posts.






When to use LangChain




























Tool Best for
Raw openai package Minimal calls, full control, least abstraction
Vercel AI SDK Provider-agnostic generateText, streaming, embeddings, tool loops
OpenAI Agents SDK Official agent loop, handoffs, guardrails
LangChain Document ingestion, retrievers, LCEL chains, createAgent, swappable vector stores


Reach for LangChain when RAG or multi-step LLM pipelines grow beyond a few manual API calls.






Prerequisites




  • OpenAI account

  • Generated API key

  • Enabled billing

  • Node.js version 26


  • langchain, @langchain/core, @langchain/openai, and zod installed


  • OPENAI_API_KEY set in the environment






Core concepts



Document - a chunk of text with optional metadata. Loaders produce Document instances; splitters break long sources into retrieval-friendly pieces.




import { Document } from '@langchain/core/documents';

const doc = new Document({
pageContent: 'LangChain helps compose LLM pipelines.',
metadata: { source: 'intro' }
});






Runnable - any component with .invoke(), .stream(), or .batch(). Prompts, models, parsers, and composed chains are all Runnables.



LCEL (LangChain Expression Language) - chain Runnables with .pipe(). Data flows left to right: prompt → model → parser. The same .invoke(), .stream(), and .batch() interface applies to every Runnable in the chain.




import { ChatPromptTemplate } from '@langchain/core/prompts';
import { StringOutputParser } from '@langchain/core/output_parsers';
import { ChatOpenAI } from '@langchain/openai';

const prompt = ChatPromptTemplate.fromMessages([
['system', 'Answer in one sentence.'],
['human', '{question}']
]);

const model = new ChatOpenAI({ model: 'gpt-5.5' });
const chain = prompt.pipe(model).pipe(new StringOutputParser());

const answer = await chain.invoke({ question: 'What is LangChain?' });
console.log(answer);






Agents - LangChain's current high-level agent API is createAgent. Pass a model string or chat model, optional tools (with zod schemas), and an optional checkpointer for conversation memory (@langchain/langgraph):




import { createAgent } from 'langchain';

const agent = createAgent({
model: 'gpt-5.5',
tools: []
});

const result = await agent.invoke({
messages: [{ role: 'user', content: 'What is LangChain?' }]
});









What LangChain can do





  • Load and split documents - PDF, HTML, CSV, directories; token- or character-based splitters


  • Embeddings and vector stores - OpenAI embeddings with pgvector, Pinecone, Chroma, and others


  • Retrievers and RAG chains - fetch relevant context, then call a model (see the RAG with pgvector post)


  • Conversation memory - short-term memory via @langchain/langgraph checkpointers and thread_id; long-term memory via stores


  • Tools and agents - createAgent with tools and middleware; for production agents you may also prefer the Vercel AI SDK agents post or OpenAI Agents SDK post


  • Observability - trace runs with LangSmith (LANGSMITH_TRACING=true); optional LangSmith Engine monitors traces and flags issues






Streaming and batch



The same LCEL chain supports streaming and batch invocation:




for await (const chunk of await chain.stream({ question: 'What is LCEL?' })) {
process.stdout.write(chunk);
}

const answers = await chain.batch([
{ question: 'What is a Runnable?' },
{ question: 'What is a retriever?' }
]);









Demo



Runnable LCEL scripts for this post live in the langchain-overview-nodejs-demo folder. Get access via code demos.

Intelligence Digest — kostenlos Täglich die wichtigsten Security-News · jederzeit abbestellbar
Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War diese Seite hilfreich?
0
Jetzt Bewertung abgeben
🟢 Niedrig (1-3.9) 🟡 Mittel (4.0-6.9) 🔴 Hoch (7.0-8.9) Kritisch (9.0-10.0)

Verwandte Story-Cluster & Quellen (Vektor-KI)

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten LangChain overview for Node.js

Thematisch verwandte Begriffe: LangChain, overview, Nodejs · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Nächster Beitrag