For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
  • Getting Started
    • Home
    • Quickstart
    • Ollie Agent
    • FAQ
    • Changelog
  • Observability
    • Overview
    • Getting started
    • Concepts
    • Debugging agents with Ollie and Opik Connect
  • Development
    • Overview
    • Agent playground
    • Prompt playground
      • Overview
      • Getting started
      • Text and chat prompts
      • MCP server
      • Version control
  • Evaluation
    • Overview
    • Getting started
    • Concepts
  • Production
  • Administration
    • Overview
    • Roles and Permissions
  • Contributing
    • Contribution Overview
LogoLogo
Copy to LLMGithubGo to App
On this page
  • Why use the Prompt Library
  • Key features
  • How it works
  • Next steps
DevelopmentPrompt library

Prompt Library Overview

Was this page helpful?
Previous

Getting started with the Prompt Library

Next
Built with

The Prompt Library is the central place to manage every prompt your agent depends on. Version them, iterate on new versions from the Opik UI or the SDK, and link the exact version that produced a trace.

Why use the Prompt Library

When prompts are hardcoded, every change requires a code change to update. There is no history of what changed, no way to roll back quickly, and no clean way to compare alternative versions.

The Prompt Library gives you version control for the prompts that drive your agent. Push them to Opik once, and from there you can compare versions, fetch a specific one, or always follow the latest.

Key features

  • Project-scoped prompts — Every prompt lives inside a project, so different agents can have prompts with the same name without colliding.
  • Versioning by v1, v2, v3, … — Each change creates a new immutable, sequentially numbered version. Fetch a specific one with the version selector (e.g. "v3"), or omit it to fetch the most recent.
  • Text and chat prompts — Version simple string templates as well as multi-message chat templates with {{variable}} substitution.
  • Agent configuration in one place — Prompts live alongside the rest of an agent configuration (model, parameters, tools) so a trace links back to the exact bundle that produced it.
  • Python and TypeScript SDKs — Create, fetch, and render prompts from either language.

How it works

  1. Define your prompts — Use create_prompt / create_chat_prompt to send your prompts to Opik. This becomes v1.
  2. Fetch at runtime — Call get_prompt / get_chat_prompt from inside a tracked function. The SDK returns the requested version and links it to the trace automatically.
  3. Iterate from the UI — Edit the prompt and save a new version. If your code doesn’t pin a version, the agent picks up the new version on its next fetch — otherwise update your code to point at the new version name.

Next steps

  • Getting started — Add the Prompt Library to your code in minutes
  • Text and chat prompts — When to use each, multimodal content, template engines, and searching
  • Version control — Create and compare versions
  • Prompt playground — Test prompt variants side-by-side across models, without writing code