Deepseek

Connect Integrations to
Deepseek

Build advanced AI agents with Deepseek. Connect 600+ integrations, automate workflows, and deploy with ease using Metorial.

Back to Deepseek overview

Building Multi-Step Agentic Workflows

Metorial and the AI SDK make it easy to build agents that can perform complex, multi-step tasks using multiple integrations.

What Are Agentic Workflows?

Agentic workflows allow your AI to:

  • Call multiple tools in sequence
  • Make decisions based on tool results
  • Chain together different integrations
  • Accomplish complex tasks autonomously

Basic Multi-Step Example

import { generateText } from 'ai';

await metorial.withProviderSession(
  metorialAiSdk,
  { serverDeployments: ['your-deployment-id'] },
  async session => {
    const result = await generateText({
      model: yourModel,
      messages: [{
        role: 'user',
        content: 'Find emails from Sarah about the Q4 project, summarize them, and add a calendar event for our next meeting'
      }],
      tools: session.tools,
      maxSteps: 10 // Allow multiple tool calls
    });
    
    console.log(result.text);
  }
);

The AI will automatically:

  1. Search emails for messages from Sarah
  2. Filter for Q4 project-related content
  3. Read and summarize the emails
  4. Create a calendar event

Controlling Workflow Length

Use maxSteps to control how many actions the agent can take:

maxSteps: 5  // Up to 5 tool calls
maxSteps: 15 // More complex workflows
maxSteps: 1  // Single action only

Example: Research and Report Workflow

const result = await generateText({
  model: yourModel,
  messages: [{
    role: 'user',
    content: 'Research our competitors on GitHub, check their latest releases, and create a summary document in Google Docs'
  }],
  tools: session.tools,
  maxSteps: 15
});

This agent will:

  1. Search GitHub for competitor repositories
  2. Check their recent releases and commits
  3. Analyze the information
  4. Create a formatted document in Google Docs

Monitoring Progress

Use streaming to see the agent's progress in real-time:

import { streamText } from 'ai';

const result = streamText({
  model: yourModel,
  messages: messages,
  tools: session.tools,
  maxSteps: 10,
  onStepFinish: (step) => {
    console.log('Completed step:', step.toolCalls);
  }
});

for await (const chunk of result.textStream) {
  process.stdout.write(chunk);
}

Best Practices

  • Start with a clear, specific prompt
  • Use appropriate maxSteps for your task complexity
  • Test workflows with smaller maxSteps first
  • Monitor token usage for long workflows
  • Handle errors gracefully with try-catch blocks

Complex Example: Customer Support Workflow

const result = await generateText({
  model: yourModel,
  messages: [{
    role: 'user',
    content: 'Customer John Smith reported an issue with order #12345. Check the order status, review recent support tickets, check for similar issues, and draft a response email'
  }],
  tools: session.tools,
  maxSteps: 20
});

This demonstrates how Metorial enables sophisticated automation by giving your AI access to multiple systems seamlessly.

Deepseek on Metorial

Power your Deepseek AI agents with Metorial's extensive integration library featuring over 600 tools and services. Our MCP-powered platform makes it incredibly simple to connect Deepseek models to the APIs and services your applications need. With Metorial's TypeScript and Python SDKs, you can add integrations to your Deepseek-based agents in just a couple of lines of code, eliminating weeks of custom integration development. Whether you're building code assistants, data analysis tools, or intelligent automation with Deepseek's advanced models, Metorial provides instant connectivity to productivity tools, databases, communication platforms, and more. Our open-source, developer-first approach means you maintain full control while we handle the complexity of authentication, rate limiting, error handling, and API versioning. Focus your engineering resources on creating unique AI experiences rather than maintaining integration code. Join the growing community of developers who trust Metorial to handle their integration needs while they concentrate on innovation and delivering value to their users.

Connect anything. Anywhere.

Ready to build with Metorial?

Let's take your AI-powered applications to the next level, together.

About Metorial

Metorial provides developers with instant access to 600+ MCP servers for building AI agents that can interact with real-world tools and services. Built on MCP, Metorial simplifies agent tool integration by offering pre-configured connections to popular platforms like Google Drive, Slack, GitHub, Notion, and hundreds of other APIs. Our platform supports all major AI agent frameworks—including LangChain, AutoGen, CrewAI, and LangGraph—enabling developers to add tool calling capabilities to their agents in just a few lines of code. By eliminating the need for custom integration code, Metorial helps AI developers move from prototype to production faster while maintaining security and reliability. Whether you're building autonomous research agents, customer service bots, or workflow automation tools, Metorial's MCP server library provides the integrations you need to connect your agents to the real world.

Star us on GitHub