[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"pack-detail-agent-frameworks-multilang-en":3,"seo:pack:agent-frameworks-multilang:en":68},{"code":4,"message":5,"data":6},200,"操作成功",{"pack":7},{"slug":8,"icon":9,"tone":10,"status":11,"status_label":12,"title":13,"description":14,"items":15,"install_cmd":67},"agent-frameworks-multilang","🌐","#0891B2","stable","Stable","Agent Frameworks Across Languages","Spring AI for Java, LangChain4j, Candle for Rust, Mastra for TypeScript, FastHTML for Python, Axum for Rust APIs — agents in every stack.",[16,28,36,44,51,59],{"id":17,"uuid":18,"slug":19,"title":20,"description":21,"author_name":22,"view_count":23,"vote_count":24,"lang_type":25,"type":26,"type_label":27},326,"98ae1961-8a0b-456f-9ff2-10852b832001","spring-ai-ai-engineering-java-spring-98ae1961","Spring AI — AI Engineering for Java\u002FSpring","Spring AI provides Spring-friendly APIs for AI apps. 8.4K+ stars. Chat, embeddings, RAG, vector DBs, function calling. Major providers. Apache 2.0.","Skill Factory",293,0,"en","skill","Skill",{"id":29,"uuid":30,"slug":31,"title":32,"description":33,"author_name":34,"view_count":35,"vote_count":24,"lang_type":25,"type":26,"type_label":27},327,"f7069ed9-81bd-4e67-a727-44e37eb529e7","langchain4j-llm-integration-java-f7069ed9","LangChain4j — LLM Integration for Java","LangChain4j integrates 20+ LLM providers and 30+ vector stores into Java apps. 11.4K+ stars. Unified API, RAG, MCP, Spring Boot. Apache 2.0.","LangChain",345,{"id":37,"uuid":38,"slug":39,"title":40,"description":41,"author_name":42,"view_count":43,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1302,"b113c394-37db-11f1-9bc6-00163e2b0d79","candle-minimalist-machine-learning-framework-rust-b113c394","Candle — Minimalist Machine Learning Framework for Rust","Candle is a Rust-native ML framework focused on inference performance, small binaries, and serverless deployment. It runs Llama, Whisper, Stable Diffusion, and other PyTorch models in pure Rust — no Python required.","AI Open Source",376,{"id":45,"uuid":46,"slug":47,"title":48,"description":49,"author_name":22,"view_count":50,"vote_count":24,"lang_type":25,"type":26,"type_label":27},739,"143825f7-ee67-49a1-a994-6908bb1df20f","fasthtml-build-ai-web-apps-pure-python-143825f7","FastHTML — Build AI Web Apps in Pure Python","Modern Python web framework that generates HTML from Python functions. No JavaScript, no templates. Perfect for building AI tool dashboards and agent UIs rapidly.",205,{"id":52,"uuid":53,"slug":54,"title":55,"description":56,"author_name":57,"view_count":58,"vote_count":24,"lang_type":25,"type":26,"type_label":27},633,"3e118616-e727-4dc7-a561-db39e91cadcd","mastra-typescript-ai-agent-framework-3e118616","Mastra — TypeScript AI Agent Toolkit","Production TypeScript framework for building AI agents with tool use, workflows, RAG, and memory. First-class MCP support. Deploy anywhere Node.js runs. 9,000+ GitHub stars.","Mastra",325,{"id":60,"uuid":61,"slug":62,"title":63,"description":64,"author_name":65,"view_count":66,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1088,"412ff341-3634-11f1-9bc6-00163e2b0d79","axum-ergonomic-modular-web-framework-rust-412ff341","Axum — Ergonomic Modular Web Framework for Rust","Axum is a web application framework built on Tokio, Tower, and Hyper. Focuses on ergonomics and modularity with a macro-free routing API, seamless Tower middleware integration, and type-safe extractors. The official Tokio team web framework.","Script Depot",328,"tokrepo install pack\u002Fagent-frameworks-multilang",{"pageType":69,"pageKey":8,"locale":25,"title":70,"metaDescription":71,"h1":13,"tldr":72,"bodyMarkdown":73,"faq":74,"schema":90,"internalLinks":99,"citations":112,"wordCount":125,"generatedAt":126},"pack","Agent Frameworks Across Languages: Java, Rust, TS, Python","Spring AI for Java, LangChain4j, Candle for Rust, Mastra for TypeScript, FastHTML for Python, Axum for Rust APIs — agents in every stack. Install via TokRepo.","Six frameworks that make agentic apps a first-class citizen in Java, Rust, TypeScript and Python — pick the one that matches your existing stack instead of bolting Python alongside. Install via TokRepo CLI.","## What's in this pack\n\nThis pack collects the **six agent frameworks** that let teams stay in their existing language ecosystem instead of bolting a Python service onto a Java or Rust backend just for LLM features. The list spans the four languages where serious agent work is happening outside Python: Java, Rust, TypeScript, and Python (with FastHTML for full-stack rendering).\n\n| # | Framework | Language | Best for |\n|---|---|---|---|\n| 1 | Spring AI | Java | Spring Boot apps adding LLM features |\n| 2 | LangChain4j | Java\u002FKotlin | community port of LangChain to JVM |\n| 3 | Candle | Rust | local model inference |\n| 4 | Mastra | TypeScript | full-stack TS agent + workflow framework |\n| 5 | FastHTML | Python | server-rendered Python UIs for agents |\n| 6 | Axum | Rust | high-throughput agent APIs |\n\nThe pack mirrors the reality that LLM features now ship in every backend, not just Python ones. A Spring Boot e-commerce backend doesn't want to spin up a separate FastAPI service for a chat feature — Spring AI lives in the same JVM. A Rust API gateway doesn't want a Python sidecar — Axum + Candle compile into one binary.\n\n## Why language-native matters\n\nThe Python-first agent world (LangChain, LangGraph, CrewAI) is great if Python is already your primary stack. If you're a Java shop, you face three bad options without this pack:\n1. Run a Python sidecar service (extra deployment, separate observability, marshalling JSON between two processes).\n2. Use a SaaS LLM gateway (vendor lock-in, latency, fees).\n3. Hand-roll OpenAI HTTP calls inside your Spring controllers (no abstractions, no eval framework, no agent loop).\n\nSpring AI and LangChain4j fix this. They give Java the same primitives — chat models, tool calling, prompt templates, vector stores, agent loops — that LangChain gives Python, with idiomatic Spring or Kotlin DSLs. Same for Rust (Candle for inference, Axum for the API surface) and TypeScript (Mastra for the framework).\n\nThe trade-off is feature lag. LangChain ships an integration to a new model on day one; Spring AI takes weeks; LangChain4j sometimes catches up faster than Spring AI because it's community-driven. Plan for \"the model launched yesterday and only Python has it\" being a real scenario.\n\n## Install in one command\n\n```bash\n# Install the pack — drops a starter project for each framework\ntokrepo install pack\u002Fagent-frameworks-multilang\n\n# Or pick by language\ntokrepo install spring-ai\ntokrepo install langchain4j\ntokrepo install mastra\ntokrepo install candle\n```\n\nThe TokRepo CLI handles each ecosystem's package manager — Maven for Spring AI and LangChain4j, Cargo for Candle and Axum, npm\u002Fpnpm for Mastra, uv for FastHTML. The starter projects all include a passing test that calls a real model so you can verify your API keys before writing logic.\n\n## Common pitfalls\n\n- **Spring AI vs LangChain4j is not \"official vs unofficial.\"** Spring AI is from VMware\u002FBroadcom; LangChain4j is community. Both are widely used. Choose by feature parity with the model you're using and ergonomic preference (Spring DSL vs LangChain semantics).\n- **Mastra is young.** It's well-maintained but the API has shifted between minor releases. Pin a specific version and read release notes before upgrading. Production users typically wait two minor releases before upgrading.\n- **Candle is for inference, not orchestration.** It runs models locally (Llama, Mistral, etc) and gives you embeddings — but it's not a full agent framework. Pair it with Axum for the API layer if you want a Rust-only stack.\n- **FastHTML is HTMX-based.** It's not a SPA framework. If your team expects React or Vue, FastHTML will feel alien. It's perfect when you want server-rendered Python UIs that wire into agents directly without a separate frontend repo.\n- **Tool calling formats differ.** OpenAI, Anthropic, and Gemini all have different JSON schemas for tool calls. Each framework abstracts this differently — Spring AI's `@Tool` annotation, LangChain4j's `@Tool` with reflection, Mastra's typed `createTool()`. Don't assume a tool definition ports across.\n\n## When this pack alone isn't enough\n\nThis pack gives you the runtime in your language. You'll still need:\n- **An LLM provider.** OpenAI, Anthropic, Bedrock, or self-hosted via Ollama. All six frameworks support multiple providers via configuration.\n- **Vector storage** if you're doing RAG. See the Vector DB Showdown pack — most entries have native clients in Java, Rust, and TS.\n- **Eval pipeline.** Promptfoo from the LLM Eval & Guardrails pack runs language-agnostic — point it at your endpoint regardless of backend.\n\nFor Python-only stacks where multilang isn't the question, see [Python Agent Frameworks](\u002Fen\u002Fpacks\u002Fpython-agent-frameworks). For platform-agnostic side-by-side comparison without picking a language, see [Multi-Agent Frameworks](\u002Fen\u002Fpacks\u002Fmulti-agent-frameworks).",[75,78,81,84,87],{"q":76,"a":77},"Are these frameworks free?","All six are Apache 2.0 or MIT open-source — no per-seat costs from the framework. You'll pay for the LLM API calls (OpenAI, Anthropic, etc) regardless of language. Spring AI is from Broadcom but free; LangChain4j is community-driven and free; Mastra is venture-funded with free open-source plus optional cloud. Candle, Axum, FastHTML are pure OSS.",{"q":79,"a":80},"How does Spring AI compare to LangChain4j?","Spring AI is the Spring-team-built canonical answer — tight integration with Spring Boot autoconfig, Spring Data, Spring Security. LangChain4j is community-driven and ports the LangChain conceptual model (chains, agents, callbacks) to Java with broader feature coverage. Pick Spring AI if you're a Spring shop and want canonical idioms; LangChain4j if you want the LangChain mental model in JVM with maximum integration breadth.",{"q":82,"a":83},"Will any of these work with Claude Code or Cursor?","These are runtime frameworks, not editor integrations. The frameworks themselves run inside your service (Spring Boot, Axum binary, Mastra app). Your editor (Claude Code, Cursor) helps write the framework code. Cursor and Claude Code both have decent Java\u002FRust\u002FTS support, with Spring AI specifically getting good autocomplete from JetBrains' Spring IDE plugin.",{"q":85,"a":86},"Difference vs the Python Agent Frameworks pack?","Python Agent Frameworks is Python-only — five frameworks all running in CPython. This pack is the opposite: it surfaces the *non-Python* options. If you're already committed to Python, that pack is denser; if you're on Java\u002FRust\u002FTS or picking the language, this pack is the right starting point. The two packs are complementary, not overlapping.",{"q":88,"a":89},"What's the operational gotcha with Mastra?","Mastra has a strong opinion that workflows live alongside agents in the same project, with shared types. This is great for a clean codebase but tightly couples your workflow engine to your agent framework version. If you upgrade Mastra and a workflow breaks, you can't roll back the agent without rolling back the workflow. Plan a separate testing stage for Mastra version bumps.",{"@context":91,"@type":92,"name":13,"description":93,"numberOfItems":94,"publisher":95},"https:\u002F\u002Fschema.org","CollectionPage","Spring AI for Java, LangChain4j, Candle for Rust, Mastra for TypeScript, FastHTML for Python, Axum for Rust APIs — agent frameworks beyond Python.",6,{"@type":96,"name":97,"url":98},"Organization","TokRepo","https:\u002F\u002Ftokrepo.com",[100,104,108],{"url":101,"anchor":102,"reason":103},"\u002Fen\u002Fpacks\u002Fpython-agent-frameworks","Python Agent Frameworks","the Python-only counterpart pack",{"url":105,"anchor":106,"reason":107},"\u002Fen\u002Fpacks\u002Fmulti-agent-frameworks","Multi-Agent Frameworks","platform-agnostic multi-agent comparison",{"url":109,"anchor":110,"reason":111},"\u002Fen\u002Fpacks\u002Fpostgres-for-agents","Postgres for AI Agents","the SQL surface every stack reaches for",[113,117,121],{"claim":114,"source_name":115,"source_url":116},"Spring AI official Java framework for AI integration","spring-projects\u002Fspring-ai","https:\u002F\u002Fgithub.com\u002Fspring-projects\u002Fspring-ai",{"claim":118,"source_name":119,"source_url":120},"LangChain4j community port to JVM","langchain4j\u002Flangchain4j","https:\u002F\u002Fgithub.com\u002Flangchain4j\u002Flangchain4j",{"claim":122,"source_name":123,"source_url":124},"Mastra TypeScript-first agent framework","mastra-ai\u002Fmastra","https:\u002F\u002Fgithub.com\u002Fmastra-ai\u002Fmastra",771,"2026-05-02T15:00:00Z"]