libra-knowledge

Integrate Libra A/B experiment parameters into Golang services using the Abtest SDK.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill libra-knowledge-yuezhen-huang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: libra-knowledge
Source: https://github.com/yuezhen-huang/my-bytedance-skillhub/tree/main/libra-knowledge
Command: npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill libra-knowledge-yuezhen-huang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Integrating server-side A/B experiments into Golang services requires correctly wiring the Libra platform's Abtest SDK, managing configuration namespaces, and safely migrating traffic without breaking downstream services. ## Core Features & Use Cases - SDK Initialization: Configure the code.byted.org/iesarch/abtest SDK with LibraNamespaceOpti mode and EnableNsReveal local fallback for safe production rollout. - Experiment Parameter Reading: Read int, string, and other typed experiment values, pass AB results downstream via TransferAbParam, and choose between V1 and V2 diversion modes. - Configuration Space Management: Create and publish configs in Libra namespaces, handle permissions, releases, and deletions through the config center. - Use Case: A backend engineer needs to gate a new recommendation algorithm behind an experiment. This Skill guides SDK setup, parameter reading, double-validation checks, and safe traffic migration. ## Quick Start Show me how to initialize the Libra Abtest SDK in my Golang service and read an experiment parameter with local fallback enabled.

Frequently Asked Questions about libra-knowledge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate the Libra Abtest SDK in a Golang service?

Import code.byted.org/iesarch/abtest/ab and create a client with ab.MustNewClient using ab.DesignationMode(ab.LibraNamespaceOpti) and ab.EnableNsReveal(). Configure it at process level, not inside shared common libraries.

What is the difference between Libra SDK V1 and V2?

V1 distinguishes uid and did diversion in returned parameters, while V2 supports both without separating them. New business lines should use V2; existing services should migrate cautiously since downstream services may depend on V1 results.

How do I pass A/B experiment results to downstream services?

Call the TransferAbParam() function to propagate AB experiment results through the corresponding IDL interface. If IDL changes are not possible, use the documented compatibility approaches or combo package helper methods short-term.

Why does my Libra experiment parameter return the default value?

Common causes include missing configuration in the namespace, keys containing '.' characters without a custom separator, or the SDK not running in LibraNamespaceOpti mode. Enable EnableNsReveal and check metrics like bytedance.abtest.sdk.namespaces.local.reveal.

How do I verify Libra SDK migration correctness?

Enable double validation on BOE, PPE, or canary environments with SDK version 1.1.11 or higher. Search logs for the mismatch keyword and monitor the metric bytedance.abtest.sdk.value.not.equal.count to confirm old and new reads agree.