Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt

Use this file to discover all available pages before exploring further.

Prompts & Artifact Schemas

Prompts and artifact schemas let you define reusable building blocks for agent behavior. Prompts provide templated instructions that can be shared across agents, while artifact schemas define the structured output format agents should produce.

Create a prompt

Create a reusable prompt template. Prompts can include variables using double-brace syntax (e.g., {{topic}}) that are filled in at runtime.
import os
from meibel import MeibelClient
from meibel.models import CreateAgentPromptRequest

client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])

prompt = client.prompts.create_prompt(body=CreateAgentPromptRequest(
    name="summarize-document",
    description="Summarizes a document with key takeaways",
    content="Summarize the following document in {{length}} bullet points. Focus on {{focus_area}}. Include citations for each point.",
))

print(prompt.id, prompt.name)
The response includes the prompt id, name, description, and content. Use the id to reference the prompt from agents or other API calls.

Get a prompt

Retrieve the full details of an existing prompt.
prompt = client.prompts.get_prompt(prompt_id="prompt_123")

print(prompt.name)
print(prompt.content)

Update a prompt

Modify a prompt’s name, description, or content. Only the fields you include are changed.
from meibel.models import UpdateAgentPromptRequest

updated = client.prompts.update_prompt(
    prompt_id="prompt_123",
    body=UpdateAgentPromptRequest(
        content="Provide a {{length}}-point summary of the document. Focus on {{focus_area}}. Cite sources with page numbers.",
    ),
)

print(updated.content)
Updating a prompt does not affect agents that have already been published with the old version. Only new sessions or republished agents pick up the changes.

Delete a prompt

Permanently remove a prompt. This action cannot be undone.
client.prompts.delete_prompt(prompt_id="prompt_123")

Create an artifact schema

Artifact schemas define the structured output format that an agent should produce. Use JSON Schema to specify the fields, types, and validation rules.
from meibel.models import CreateAgentArtifactRequest

schema = client.artifact_schemas.create_artifact_schema(body=CreateAgentArtifactRequest(
    name="meeting-summary",
    description="Structured output for meeting summaries",
    schema={
        "type": "object",
        "properties": {
            "title": {"type": "string", "description": "Meeting title"},
            "date": {"type": "string", "format": "date"},
            "attendees": {
                "type": "array",
                "items": {"type": "string"},
            },
            "action_items": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "description": {"type": "string"},
                        "assignee": {"type": "string"},
                        "due_date": {"type": "string", "format": "date"},
                    },
                    "required": ["description"],
                },
            },
            "key_decisions": {
                "type": "array",
                "items": {"type": "string"},
            },
        },
        "required": ["title", "date", "action_items"],
    },
))

print(schema.id, schema.name)

Use a schema with an agent

Reference an artifact schema when creating or updating an agent so that its responses conform to the defined structure.
from meibel.models import CreateAgentDefinitionRequest

agent = client.agents.create_agent(body=CreateAgentDefinitionRequest(
    display_name="Meeting Summarizer",
    description="Produces structured meeting summaries",
    instructions="You are a meeting summarizer. Extract key information and format it according to the provided schema.",
    artifacts=[schema.id],
))

print(agent.id, agent.artifacts)
When an agent has an artifact schema attached, its responses will include a structured artifact field alongside the natural language message. The artifact conforms to the JSON Schema you defined, making it straightforward to parse and store programmatically.