Repository navigation
Description
Problem Statement
Users filtering the AI Catalog by tags have to already know the OASF taxonomy. The tag filter bar matches tag names as substrings, so someone who describes what they want ("analyzing customer support tickets") finds nothing, because no tag is literally named that. The taxonomy has hundreds of hierarchical labels — expecting familiarity is unrealistic.
The OASF extractor already solves exactly this: free text in, relevant skills and domains out. It just isn't reachable from the browser.
Proposed Solution
A thin endpoint that exposes extractor output directly, with no search or catalog semantics attached:
rpc ExtractTaxonomy(ExtractRequest) returns (ExtractResponse) {
option (google.api.http) = { post: "/v1/extract"; body: "*" };
}
message ExtractRequest {
string text = 1; // free-form description, required
}
message ExtractResponse {
repeated ScoredClass skills = 1;
repeated ScoredClass domains = 2;
repeated string keywords = 3;
}
message ScoredClass {
uint32 id = 1;
string name = 2; // hierarchical OASF name, e.g. natural_language_processing/text_classification
double score = 3;
uint32 tier = 4;
}Handler: reuse the gateway's already-resolved extractor.Extractor (same instance /v1/search uses), call Extract, map the result. Defaults to extractor.DefaultTiers (2). No extractor configured → codes.Unavailable (HTTP 503) so the UI can hide the feature rather than error.
This is deliberately a passthrough, not a recommender: it returns what the extractor says, and callers decide how to use it. #1908 is the first consumer.
Design notes
- Return scores and tiers. Consumers need them to rank, threshold, and decide how many suggestions to show.
- Keywords are not tags. They have no OASF class to map to. Returned for completeness, but tag-oriented consumers should use skills and domains only.
- No catalog awareness. The endpoint does not check whether any record actually carries a returned class. Consumers that care (like [Feature]: AI Catalog UI: recommend tags from a description (extractor-backed) #1908) should intersect against
GET /v1/tags.
Acceptance criteria
-
POST /v1/extractreturns skills, domains, and keywords with scores and tiers for a free-text body - Reuses the gateway's resolved extractor (local assets or remote OASF-SDK server, per [Feature]: Extractor config (RemoteAddr) + resolver wiring for dirctl and gateway #1906)
- Extractor unavailable → HTTP 503 with an actionable message
- Empty or whitespace-only text →
INVALID_ARGUMENT - Handler test with a fake extractor
Depends on
Extractor foundation (#1906, #1907). Also #2003 — the default tier count referenced above (extractor.DefaultTiers) is introduced there.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity