A Bailian AI agent autonomously generates and curates Notion content via MCP tool calling, where Notion acts as a unified headless CMS simultaneously feeding a Vercel-hosted public-facing website and an Elasticsearch-powered internal knowledge search portal with PAI-trained ranking models — giving one AI content pipeline dual output: marketing site and searchable knowledge base.
Use this pipeline when you need an autonomous, enterprise-grade content workflow where a Bailian AI agent generates and curates assets in Notion without human intervention. It simultaneously feeds a Vercel-hosted public marketing site and an Elasticsearch internal knowledge portal, leveraging PAI-trained models for semantic ranking.
client_id and client_secret for keyless authentication.content:read and content:write scopes. Export the DATABASE_ID and NOTION_API_KEY.npx notion-build-ai init. Configure mcp.json to expose content tools:``json { "server": "notion-mcp", "endpoint": "/mcp", "auth": "Bearer ${NOTION_API_KEY}", "tools": ["create_page", "update_block", "query_database"] } ``
POST https://<tenant>.idaas.aliyun.com/oauth/token before invoking MCP tools.getStaticProps or Edge Middleware to fetch content: GET https://api.notion.com/v1/databases/${DATABASE_ID}/query. Map Notion blocks to React components and deploy via vercel --prod.page.updated events. Transform payloads and index them: POST https://<es-host>:9200/knowledge/_bulk with {"index": {"_id": "<notion_page_id>"}}.script_score query that calls the PAI inference endpoint to re-rank results based on semantic relevance.The Bailian AI agent acts as the orchestrator, authenticating via IDaaS to securely invoke Notion MCP tools. Notion serves as the single source of truth (headless CMS). Data flows bidirectionally: the public branch uses Vercel’s edge runtime to query the Notion API for static/dynamic site rendering. The private branch uses a sync worker to push structured Notion blocks into Elasticsearch. ES queries are augmented by PAI-EAS, which provides real-time ML scoring for internal search relevance. Cloudflare/Alinux handle edge routing and infrastructure provisioning via Terraform.
npx for MCP server scaffolding429 errors. Implement exponential backoff in the sync worker.grant_type=client_credentials refresh loop._bulk ingestion. Flatten arrays and strip unsupported markdown before indexing.Q: How does the AI content pipeline generate content for both the public website and internal search? A: The Bailian AI agent autonomously generates and curates Notion content via MCP tool calling to simultaneously feed both the Vercel-hosted public website and the Elasticsearch-powered internal search portal. This unified headless CMS setup provides a single AI pipeline with dual outputs for your marketing site and searchable knowledge base.