Data Extraction
Last updated
- name: 'Extract Customer Info'
type: 'tool'
toolName: 'minded-extraction'
parameters:
content: '{state.memory.rawText}'
schema:
name:
type: 'string'
description: 'Customer full name'
email:
type: 'string'
description: 'Email address'
required: false
phone:
type: 'string'
systemPrompt: 'Extract contact information from the text'
strictMode: true
maxRetries: 3import { extract, createExtractor } from '@minded-ai/mindedjs';
import { z } from 'zod';
// Direct extraction
const result = await extract(
content,
{
schema: z.object({
name: z.string(),
age: z.number(),
}),
systemPrompt: 'Extract person details',
},
agent.llm,
);
// Create reusable extractor
const extractor = createExtractor(schema, { systemPrompt: 'Extract data' });
const result = await extractor(content, agent.llm);