Mar Java Mit Java Blog

Deep agents in Java with LangChain4j

Deep agents in Java with LangChain4j A ready-made harness for planning, workspace files, sub-agents, and optional skills—so you ship a tool-using orchestrator instead of hand-wiring prompts and schemas. If you follow LangChain’s deepagents idea—planning,...

Building middleware in Java with LangChain4j

Building middleware in Java with LangChain4j Cross-cutting behavior around assistants—logging, retries, safety rails, and memory compaction—without rewriting your business logic. If you build agents with LangChain4j, you already wire a ChatModel, optional tools, and...

Prompt Caching for LLM Apps: A Practical Guide (API-Based)

If you’re building an LLM-powered application (like a code review system), you’ve probably noticed this pattern: Yet every request reprocesses the entire prompt. That’s wasteful. Prompt caching fixes this. This guide explains: 🧠 What...

How agent summarization works (LangChain + Deep Agents)

Modern agents keep a chat history of user messages, assistant replies, and tool calls. That history is bounded by a context window. When it gets long, frameworks can compress older turns so the model still has useful signal without...

Scalable Stats Collection in a URL Shortener

A URL shortener may handle millions of redirects per second.Each redirect is also a click event we want to count. But there’s a challenge: Redirects must be ultra fast, while stats storage is write-heavy....

Virtual Nodes in Consistent Hashing — Why They Matter

When building large-scale systems (like URL shorteners, distributed caches, or databases), we often use consistent hashing to decide which server stores which data. But consistent hashing alone isn’t enough. To make it truly scalable...

Caching Strategy in a Planet-Scale URL Shortener

When designing a large-scale URL shortener (like Bitly), the biggest challenge isn’t storing URLs — it’s serving billions of redirects with low latency. The solution? Multi-layer caching. This article explains how caching works across...

Understanding CORS Preflight Requests: Why Your MCP Server Needs OPTIONS Support

f you’ve ever built a web API or MCP (Model Context Protocol) server, you’ve probably encountered mysterious OPTIONS requests appearing in your server logs. Or worse, you’ve seen CORS errors in the browser console blocking your perfectly valid requests. Today, we’ll demystify CORS preflight requests and show you why they’re essential for secure web applications. What...