LLM App Engineering
Build LLM features in Node.js: chat, streaming, structured outputs, tool use, RAG, and caching.
8 articles · about 141 minutes of reading
- Your First LLM API Call in Node.js: Request and Response AnatomyMake your first Claude API call from Node.js and TypeScript, and learn every part of the request and response: messages, system, max_tokens, stop_reason, usage.Difficulty: Beginner15 min read
- Multi-Turn Chat and Conversation Memory with the Claude APIBuild multi-turn chat in Node.js: keep history, replay content blocks correctly, and control cost with sliding windows, summaries, compaction, and long-term memory.Difficulty: Intermediate16 min read
- Streaming LLM Responses to a React UI with Next.js and SSEStream Claude responses token by token from a Next.js Route Handler to a React client over Server-Sent Events, with stop, retry, error handling, and accessible updates.Difficulty: Intermediate18 min read
- Prompt and Context Engineering for LLM Apps (with TypeScript)Write prompts that work in production: clear instructions, examples, XML-tagged context, and request assembly that is ordered for caching and safe with untrusted data.Difficulty: Intermediate17 min read
- Structured Outputs with Zod: Typed JSON from LLMs in TypeScriptGet typed, schema-valid JSON from Claude with Zod and messages.parse, validate business rules in code, retry with feedback, and use strict tools for tool inputs.Difficulty: Intermediate16 min read
- Tool Use (Function Calling) with Claude in TypeScriptLet the model call your functions: define tools, run the tool-use loop by hand, handle errors and parallel calls, then use the SDK tool runner with Zod-typed tools.Difficulty: Intermediate19 min read
- RAG in TypeScript: Embeddings, pgvector, Hybrid Search, and CitationsBuild retrieval-augmented generation end to end: chunking, Voyage embeddings, Postgres with pgvector, hybrid search with rank fusion, reranking, and cited answers.Difficulty: Advanced24 min read
- Prompt Caching and Batches: Cutting LLM API Costs in TypeScriptCut LLM costs with prompt caching and the Batches API: how prefix caching works, where to put breakpoints, how to verify cache hits, and how to model costs.Difficulty: Intermediate16 min read