跳到正文
Hacker News· flashbrew·· 9 天前AI 评分38

Contentful Agent Template:基于 Slack 的 Contentful 内容助手模板

Contentful Agent Template

AI 导读

Vercel 推出 Contentful Agent Template,一个基于 eve 框架、运行在 Slack 中的 Contentful 内容助手,借助 Vercel Drives 提供可搜索的内容副本。

正文 · 原文

Agent Stack MIT License

Slack-based Contentful assistant built on eve, with Vercel Drives providing a searchable copy of your content. Draft and edit entries directly in Slack, then review publication requests before the content goes live. The agent also handles asset uploads and can present results as tables or charts.

Deploy with Vercel

Getting started

Vercel's project setup flow will create a repository in your Git account and a Vercel project. You’ll create and install a Slack app via Vercel Connect, configure a private Vercel Blob store to save users’ writing preferences, and be prompted to add the following environment variables:

Variable Value
CONTENTFUL_MANAGEMENT_TOKEN Your Contentful Management API token, with access to your configured spaces
CONTENTFUL_SPACE_IDS Your Contentful space ID, or multiple IDs separated by commas

Once you've deployed the agent, add it to a Slack channel and @mention it to start your first conversation.

Tech stack

Layer Technology
Agent framework eve
Content management Contentful
Slack integration Vercel Connect
Content search and sync Vercel Sandbox
Per-user writing preferences Vercel Blob

Publishing

The agent saves edits without publishing entries. By default, publication requires approval in Slack, where a card lists the entries and assets that will go live. Any authenticated user can approve or cancel the publication request.

You can exempt supporting content types, such as authors or callouts, from approval. New asset uploads are processed and published when added to content. See publication settings for these options and their effect on linked content.

User preferences

The agent remembers each user's writing preferences, such as tone or language, and stores them separately in private Vercel Blob storage. Preferences saved during local development are temporary.

Local development

Use Node.js 24 with pnpm for local development. Install the Vercel CLI, then clone your repository and run:

pnpm install
vercel link
vercel env pull .env.local
pnpm dev

Choose your deployed project when vercel link prompts you. vercel env pull .env.local saves your project's development environment variables to .env.local.

pnpm dev opens eve's interactive chat in your terminal. Type a message such as "List the content types in my space" to talk to the agent, which reads and edits content in your configured Contentful space.

Local sessions use just-bash without access to the content stored on Vercel Drives, so searches query Contentful directly. Test searches using Drives and publication approval cards through the agent in Slack.

Before deploying, check your changes and confirm the agent builds:

pnpm validate
pnpm exec eve info
pnpm build

Use pnpm fix to apply automatic formatting and lint fixes. When the checks pass, deploy with:

vercel deploy --prod

Customization

Customize Where
Your team's writing guidelines agent/instructions.md
Which content types need approval CONTENTFUL_COMPONENT_TYPES
Website URL lookup CONTENTFUL_PUBLIC_ORIGIN and CONTENTFUL_PAGE_ROUTES
Slack channels that receive replies without mentions SLACK_AUTO_REPLY_CHANNEL_IDS
Model and session limits agent/agent.ts

For more information on customizing the agent, see CUSTOMIZATION.md.

来源:Hacker News · github.com