Langfuse's prompt management is used to centrally create, version, and call prompts in applications. Before use, you need to create a Langfuse account or self-host Langfuse, and create API credentials in the project settings.
Creating prompts: In the Langfuse UI, you can select the prompt type (which cannot be changed after creation), create a new prompt and fill in the name and text, use variables such as {{customer_name}} and {{order_id}}, and the detected variables will be listed below the editor; you can check the box to set the production label, and after creation version 1 is generated with the production and latest labels. Prompts can also be created or updated via the Python SDK, JS/TS SDK, or public API; if a prompt with the same name already exists, it will be added as a new version.
Using in code: Fetch prompts from Langfuse at runtime; it is recommended to use the production label to get the version selected for the production environment; the public API returns the prompt with the production label by default, and can also fetch by a specified version. The documentation provides code examples for text-type and chat-type prompts. When used with LangChain, due to the variable syntax difference ({} vs {{}}), you can use prompt.get_langchain_prompt() to convert, and can pass keyword arguments to pre-compile some variables. The documentation also explains that it can be used with the Vercel AI SDK.
Migration and agent installation: You can install the Langfuse Agent Skill to let coding agents access Langfuse functionality and migrate prompts; this requires an MCP client that supports MCP skills (such as Claude Code 2.1.331 or later) and a project-level API key pair. You can also connect to the Langfuse MCP server to automatically load the bundled skill; the Cursor plugin already includes this skill; you can also install it via npm (skills CLI) or manually clone the repository and create a symlink. For bulk migration or CI/CD integration, you can write a script to read existing prompts and create them via the public API. When migrating, note that Langfuse uses specific syntax for variables, prompt references, and message placeholders to support dynamic rendering.
Caching and availability: Prompt management is not on the application's critical path; the SDK caches prompts on the client side and serves them from memory after the first fetch, without addingextra latency; if Langfuse is unavailable, the application continues to use the cached prompts. If you still need 100% availability when a new instance's cache is empty, refer to the guaranteed availability notes in the documentation. If you do not see the latest version, it may be related to caching behavior.
What you can do next: Link prompts to traces to analyze performance by prompt version; test prompt versions on datasets through experiments; use version control and labels to manage deployments across different environments.