Home

Anthropic Claude API – Xây dựng AI App với NodeJS

Claude là LLM của Anthropic — nổi tiếng về khả năng phân tích, viết code, và an toàn. Bài này hướng dẫn tích hợp Claude API vào NestJS, từ text generation đến tool use và streaming. 1. Cài đặt npm install @anthropic-ai/sdk 2. Basic Chat // src/ai/claude.service.ts import { Injectable, Logger } from '@nestjs/common'; import Anthropic from '@...

Read more

Redis Streams – Event Sourcing nhẹ với NodeJS

Redis Streams là cấu trúc dữ liệu log append-only trong Redis — nhẹ hơn Kafka, tích hợp sẵn nếu đã dùng Redis. Phù hợp cho event sourcing quy mô vừa, activity logs, real-time feeds. 1. Redis Streams vs Pub/Sub vs Kafka Redis Pub/Sub: Fire & forget — không lưu message Redis Streams: Persistent log — consumer group, pending messages Kafk...

Read more