const agent = await client.agents.create({ name: 'Discovery Analyst', instructions: `You are a legal discovery analyst. When given a vault ID and topic:1. Search the vault for relevant documents2. Analyze key passages3. Compile a summary memo with citationsUse the casedev CLI for all vault and search operations.`,})console.log(agent.id) // agent_xxx
Object-level scoping (objectIds) is set per-run, not per-agent. This allows the same agent to
work with different document sets on each execution. See Execute Runs → Object ID scoping.
The instructions field is the agent’s system prompt. It defines personality, capabilities, and constraints. Tips:
Be specific about tools. Tell the agent to use casedev CLI for vault operations, legal search, etc.
Define the output format. “Write a markdown report” or “Return a JSON summary.”
Set boundaries. “Only search the assigned vault” or “Do not modify existing documents.”
Include workflow steps. Numbered steps help the agent stay on track for complex tasks.
// Good: specific, structured, actionableconst agent = await client.agents.create({ name: 'Deposition Summarizer', instructions: `You summarize depositions. For each deposition:1. Use 'casedev vault search' to find the document2. Read the full transcript3. Identify key admissions, contradictions, and timeline facts4. Write a 1-page summary in markdown5. Upload the summary to the same vault using 'casedev vault upload'6. Return the vault object ID and a presigned download URLAlways cite page numbers. Use formal legal writing style.`,})