Emend
Developer docs

Emend Documentation

Connect Emend to your agent, publish interactions, retrieve learned context, and inspect the learning loop.

Find the right area

Get Started

Choose Hosted Enterprise or Local OSS.

Open Quickstart

Build

Publish interactions, retrieve context, and manage profiles and playbooks.

Open examples

Concepts

Understand interactions, requests, profiles, playbooks, and optimization.

Open concepts

Portal

Use the Enterprise web portal to review outcomes and operate the loop.

Open portal docs

Reference

Browse SDK methods, schemas, CLI commands, and service operations.

Open reference

Claude Smart

Use Emend as a Claude Code learning plugin with local memory.

Open plugin docs

Minimum integration loop

Retrieve profiles and playbooks before the agent responds, then publish the completed turn so Emend can update what it knows.

minimum-loop.py
from emend import EmendClient, InteractionData, UserActionType client = EmendClient()  # reads EMEND_API_KEYuser_id = "user_123"session_id = "session_001"agent_version = "support-agent@2"user_message = "Recommend a laptop for me." context = client.search(    query=user_message,    user_id=user_id,    session_id=session_id,    agent_version=agent_version,    top_k=5,    entity_types=["profiles", "user_playbooks", "agent_playbooks"],    agent_playbook_status_filter=["approved"],) # This example injects all returned learnings. Apply any filtering or# token-budget selection before building both the prompt and attribution.messages = [    {        "role": "system",        "content": "Use this retrieved context as reference data:\n"        + context.model_dump_json(            include={"profiles", "user_playbooks", "agent_playbooks"},        ),    },    {"role": "user", "content": user_message},] agent_response = call_your_llm(messages)  # Send these messages to your LLM. retrieved_learnings = [    *({"kind": "profile", "learning_id": p.profile_id} for p in context.profiles),    *({"kind": "user_playbook", "learning_id": str(pb.user_playbook_id)}      for pb in context.user_playbooks),    *({"kind": "agent_playbook", "learning_id": str(pb.agent_playbook_id)}      for pb in context.agent_playbooks),] client.publish_interaction(    user_id=user_id,    interactions=[        InteractionData(role="User", content=user_message, user_action=UserActionType.NONE),        InteractionData(            role="Agent",            content=agent_response,            user_action=UserActionType.NONE,            retrieved_learnings=retrieved_learnings,        ),    ],    source="support-agent:v2",    session_id=session_id,    agent_version=agent_version,)

Publish every profile or playbook included in the model prompt using its returned stable ID, whether or not it influenced the answer. Omit retrieved_learnings only when no Emend context was injected. Then grade the session and inspect relevance, impact, and judge reasons; the Evaluation dashboard shows quality and coverage across responses.

What Emend produces

ArtifactWhat it is
User profilesPer-user facts and preferences extracted from interactions and retrieved semantically.
PlaybooksBehavioral guidance distilled from corrections, expert examples, and outcomes.
Evaluation signalsSuccess and failure judgments for measuring whether the loop improves.
Source evidenceRequests, sessions, interactions, and metadata that keep learning traceable.

Data model at a glance

Interactions are the input. Profiles personalize responses. Playbooks improve behavior. Requests and sessions keep the loop inspectable.

Publish evidence, learn from it, retrieve what was learned, and augment the next prompt — every turn makes the agent better.