Skip to content

Latest commit

 

History

History
141 lines (108 loc) · 3.78 KB

File metadata and controls

141 lines (108 loc) · 3.78 KB

Feishu (Lark) Bitable Setup

This guide shows how to use Feishu Bitable as the candidate storage backend for AEP.

Prerequisites

  • A Feishu account with admin access
  • A Feishu app with Bitable permissions

Step 1: Create Feishu App

  1. Go to Feishu Open Platform
  2. Create a new app
  3. Add permissions:
    • bitable:app (Read and write Bitable)
    • im:message:send_as_bot (Send messages, for notifications)
  4. Publish the app (important: must be published, not just created)
  5. Note your App ID and App Secret

Step 2: Create Bitable

  1. Create a new Bitable in Feishu
  2. Add all 19 fields from templates/table-schema.md
  3. Note the app_token (from URL: https://xxx.feishu.cn/base/{app_token})
  4. Note the table_id (from URL or table settings)

Field Type Mapping

AEP Field Feishu Type Notes
id Text e.g., EVO-001
title Text
type Single Select Add options: prompt-technique, tool-usage, etc.
priority Single Select Add options: P0, P1, P2, P3
source_url URL
source_platform Single Select Add options: Reddit, GitHub, etc.
community_score Number
summary Text
steps Text Multi-line
applicable_to Multi Select Add your agent names
use_case Text
initial_score Number
cumulative_score Number
trial_count Number
status Single Select pending, trialing, verified, eliminated, uncertain, adopted
elimination_reason Text
discovered_date Date
adopted_date Date
notes Text

Step 3: Configure Your Agent

Add this to your agent's SOUL.md evolution protocol section:

## Feishu Bitable Configuration

App ID: YOUR_FEISHU_APP_ID
App Secret: YOUR_FEISHU_APP_SECRET
Bitable app_token: YOUR_APP_TOKEN
Table ID: YOUR_TABLE_ID

API Operations

Get access token:

curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d '{"app_id":"YOUR_APP_ID","app_secret":"YOUR_APP_SECRET"}'

Write a record:

curl -s -X POST "https://open.feishu.cn/open-apis/bitable/v1/apps/YOUR_APP_TOKEN/tables/YOUR_TABLE_ID/records" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "id": "EVO-001",
      "title": "Skill name",
      "type": "prompt-technique",
      "priority": "P0",
      "source_url": {"link": "https://...", "text": "Source"},
      "source_platform": "Reddit",
      "initial_score": 7,
      "status": "pending",
      "discovered_date": 1709251200000
    }
  }'

Query records:

curl -s "https://open.feishu.cn/open-apis/bitable/v1/apps/YOUR_APP_TOKEN/tables/YOUR_TABLE_ID/records" \
  -H "Authorization: Bearer <token>"

Update a record:

curl -s -X PUT "https://open.feishu.cn/open-apis/bitable/v1/apps/YOUR_APP_TOKEN/tables/YOUR_TABLE_ID/records/RECORD_ID" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"fields": {"cumulative_score": 9, "trial_count": 3, "status": "verified"}}'

Common Gotchas

1. Date fields use millisecond timestamps

# Get current timestamp in milliseconds
date +%s000

2. Single select fields use option text, not IDs

CORRECT: "status": "pending"
WRONG:   "status": "optXXXXXX"

3. Multi select fields use arrays

"applicable_to": ["Agent-1", "Agent-2"]

4. URL fields use object format

"source_url": {"link": "https://example.com", "text": "Display text"}

5. App must be published

Feishu apps must be published (not just created) to access Bitable API. Go to your app's "Version Management" and publish at least one version.