# Baidu Qianfan MCP for AI Agents AI Agent Connect

> Baidu Qianfan MCP connects your AI agent to Baidu's enterprise LLM suite. Use it to run Ernie Bot, generate vector embeddings for RAG, manage prompt templates, and create images from text. It bridges your workflow with one of the most powerful Chinese language models available for production use.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_nSPMSdk1YEMCwy7aSAehImUREP7520Z8lSHvuSUL/ai-agent-connect
- **Tags:** ernie-bot, baidu-cloud, llm-api, embeddings, prompt-templates, chinese-llm

## Description

The Baidu Qianfan MCP connects your agent to Baidu's enterprise LLM suite. You can now have your agent handle complex Chinese language tasks without leaving your current workspace. If you're building a RAG system, you can grab high-quality vector embeddings to make your search actually relevant. You can also pull from a library of pre-made prompt templates so your outputs stay consistent across different projects. It handles everything from generating images to monitoring how many tokens you're burning. It's a solid way to bring Baidu's infrastructure into your own setup. You can find this and other high-performance connectors in the Vinkius catalog to build out a professional AI stack that actually works for your specific needs.

## Tools

### get_embeddings
Create vector embeddings for text to power your search index. This helps make your RAG system much more accurate.

### list_train_jobs
Show a list of your current model training jobs. Use this to keep track of your ongoing training tasks.

### chat_completions
Send a message to a Baidu Qianfan model and get a response. It is the primary way to interact with Ernie Bot.

### list_datasets
List the datasets you've uploaded to the platform. Use this to manage the data sources for your AI workflows.

### list_models
List the available model services you can use right now. This helps you see which Ernie versions are active.

### text_to_image
Turn a text prompt into a generated image. Use this to create visual assets directly through your agent.

## Prompt Examples

**Prompt:** 
```
I need to build a search index for our internal HR documents. How can I do that with Ernie?
```

**Response:** 
```
To build your search index, you can use the **embeddings** feature. Here is how we can handle it:

1. **Data Preparation**: We'll use the `list_datasets` tool to see what you've already uploaded.
2. **Vectorization**: For every HR document, I can call `get_embeddings` to turn the text into a vector.
3. **Search**: Once those are indexed, your agent can find the most relevant documents for any HR question.

Would you like me to start by listing your current datasets?
```

**Prompt:** 
```
Can you write a formal apology to a client in Chinese for a shipping delay?
```

**Response:** 
```
Certainly. I'll use the **Ernie Bot** to draft that for you.

**Draft:**

"尊敬的客户，您好。由于物流配送过程中出现意外，您的订单 #12345 延迟送达。我们对此深表歉意，并正在全力处理。"

**Translation:**

"Dear customer, hello. Due to an unexpected issue during the logistics delivery process, your order #12345 was delayed. We sincerely apologize for this and are doing our best to resolve it."

Would you like me to adjust the tone to be more formal?
```

**Prompt:** 
```
I want to create a consistent way for the agent to review code. Should I use a template?
```

**Response:** 
```
Yes, using a template is the best way to ensure the agent always follows the same rules. I can help you manage this:

* **Create**: We can define a 'Code Review Expert' template.
* **Retrieve**: Every time you ask for a review, I'll pull that exact template.
* **Consistency**: This ensures the agent doesn't 'forget' your specific style guidelines.

Should I check your existing prompt templates to see if we already have one?
```

## Capabilities

### Run Ernie Bot chat completions
Send messages to Ernie Bot and get high-quality text responses from Baidu's primary models.

### Generate vector embeddings
Convert text into semantic vectors to power your search and RAG systems.

### Manage prompt templates
Retrieve and organize pre-made prompts to keep your agent's instructions consistent.

### Create images from text
Trigger text-to-image tasks using Baidu's diffusion models for visual content.

### Monitor token usage
Track your consumption and check model status to keep your operations running smoothly.

## Use Cases

### Building a RAG search index
A knowledge manager uses get_embeddings to convert a thousand internal PDFs into a searchable vector database for their team.

### Localized customer support
A developer uses chat_completions to power a customer service bot that understands and responds in native Chinese.

### Automated content creation
A marketing lead uses text_to_image to generate social media headers based on specific campaign descriptions.

### Model performance testing
An engineer uses list_models and chat_completions to benchmark the response quality of Ernie Turbo versus Ernie 4.0.

## Benefits

- Use chat_completions to get high-quality responses from Ernie Bot 4.0 without switching browser tabs.
- Build faster RAG pipelines by using get_embeddings to turn your company data into searchable vectors.
- Keep your outputs consistent by pulling from organized prompt templates instead of re-typing instructions.
- Create visual content on the fly using text_to_image for marketing or app assets.
- Monitor your costs and model health in real-time to keep your production environment stable.
- Access Baidu's enterprise-grade diffusion models for high-quality image generation.

## How It Works

The bottom line is you get a direct line to Baidu's enterprise models with zero manual API management.

1. Get your API Key and Secret Key from the Baidu Qianfan Console.
2. Input your credentials into the Connector configuration fields.
3. Ask your agent to perform tasks like generating embeddings or chatting with Ernie Bot.

## Frequently Asked Questions

**What is the Baidu Qianfan MCP used for?**
It connects your AI agent to Baidu's enterprise LLM platform. You can use it to run Ernie Bot, generate vector embeddings for search, and create images from text prompts.

**Can I use Baidu Qianfan MCP for RAG systems?**
Yes, it's perfect for RAG. You can use it to generate high-quality embeddings for your internal data, making it much easier to build a searchable knowledge base.

**Does the Baidu Qianfan MCP support image generation?**
Yes, it includes tools to trigger text-to-image tasks. This allows your agent to create visual content based on your descriptions.

**How do I get my API keys for the Baidu Qianfan MCP?**
You can get your credentials by logging into the Baidu Qianfan Console and creating a new application. Once you have your keys, you can plug them directly into the Connector.

**Can I manage my prompts using the Baidu Qianfan MCP?**
Yes, you can manage and retrieve centralized prompt templates. This helps you keep your agent's instructions consistent across different tasks.

**Is Baidu Qianfan MCP good for Chinese language tasks?**
It is specifically designed for that. It gives you direct access to Ernie Bot, which is one of the most capable models for Chinese language understanding and generation.

**Which version of Ernie Bot should I use for chat?**
For high performance and reasoning, use `ernie-4.0-8k`. For faster response times and cost efficiency, `ernie-speed-128k` or `ernie-lite-8k` are excellent choices.

**Can I automatically generate embeddings for RAG?**
Yes! Use the `get_embeddings` tool with your text input. The agent will retrieve the vector representations from Baidu's embedding models, ready for indexing in your vector database.

**How do I use prompt templates from the console?**
Use the `list_prompt_templates` tool to find your configured templates. You can then retrieve specific details using `get_prompt_template` to maintain consistency across your AI workflows.