backend-api
Operates Airweave's backend API surface for search tiers, collections, source connections, Connect sessions, browse-tree selection, sources, webhooks, usage checks, source rate limits, and streaming search debugging.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- backend-api
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Operates Airweave's backend API surface for search tiers, collections, source connections, Connect sessions, browse-tree selection, sources, webhooks, usage checks, source rate limits, and streaming search debugging.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md24.9 KB
- 参考文档references/troubleshooting.md14.6 KB
- 参考文档references/workflows.md15.7 KB
- 脚本scripts/agentic_search_stream.py14.4 KB
03 SKILL.md 正文
Backend API
Use this sub-skill when an Airweave task touches the FastAPI service as a user-facing API: collection search, collection CRUD, source-connection creation/auth/sync jobs, Connect sessions, browse-tree node selection, source discovery, auth-provider connections, API keys, usage checks, source rate limits, webhook subscriptions/messages, or local debugging of agentic search streams.
Route to the right reference
- Read references/api-reference.md for endpoint tables, request bodies, response shapes, filters, auth/header rules, and status/error conventions.
- Read references/workflows.md for end-to-end recipes: create-and-search, search tier selection/cancel/retry, OAuth claim-token verification, Connect sessions, browse-tree selection, webhooks, and source rate-limit checks.
- Read references/troubleshooting.md when diagnosing 401/403/404/422/429 errors, search/SSE stalls, usage blocks, OAuth pending states, Connect mode failures, webhook delivery problems, or source rate-limit surprises.
- Use scripts/agentic_search_stream.py as the bundled CLI viewer for
POST /collections/{readable_id}/search/agentic/streamwhen a local backend is running. - Cross-link to sibling source-connectors for connector registry semantics, source capability fields, browse-tree source implementation behavior, and per-source config/auth details.
- Cross-link to sibling connect-widget for iframe messaging, SDK/session-mode UX, OAuth popup handling, and parent-window token exchange details.
Operating rules
- Use root-relative backend paths such as
/collectionsand/source-connections; do not add an/api/v1prefix to dashboard/client code. - Use collection
readable_idvalues in collection search and collection CRUD paths. Use UUIDs for source-connection IDs, sync job IDs, webhook subscription/message IDs, and Connect session IDs. - Preserve headers. Regular backend calls need the normal user/API auth context plus
X-Organization-IDwhen operating in a selected organization. Connect session calls useAuthorization: Bearer <session_token>and are not ordinary API-key calls. - Treat usage checks as preflight hints and backend checks as authoritative. Instant/classic/browse/legacy search consume
queries; agentic and agentic stream consumetokens; source creation and sync creation also check their usage actions. - Keep the search tiers distinct: instant is direct retrieval, classic asks an LLM to plan before retrieval, agentic runs a tool-using loop, and agentic streaming returns Server-Sent Events.
- Do not mix filter dialects. V2 search tiers use
filter: [{conditions: [...]}]; the legacy search route accepts a Qdrant-style dict such as{must: [...]}. - Preserve the OAuth claim-token contract: keep the
claim_tokenfrom source-connection creation untilverify-oauthsucceeds; removing it earlier leaves the flow unrecoverable for the user without re-initiation. - Keep destructive lifecycle operations explicit. Deleting a collection or source connection cascades/cleans synced data; cancelling a sync transitions through
cancellingbeforecancelled. - Keep Connect widget iframe internals and source implementation internals out of this sub-skill. Route iframe messaging to
connect-widget; route source class/config/browse-tree implementation details tosource-connectors. - Do not depend on the original repository checkout for runtime guidance. Use the bundled references and helper script here.
Quick decision map
| User intent | Start here | Notes |
|---|---|---|
| "Which search endpoint/body should I use?" | api-reference.md → Search v2 and legacy search |
Check tier, filter dialect, and usage action. |
| "Search stream hangs or shows wrong events" | troubleshooting.md → SSE/search stream |
Confirm current /collections/{id}/search/agentic/stream path and event names. |
| "Create collection and index a source" | workflows.md → Collection to searchable data |
Covers collection, source connection, sync polling, and cleanup. |
| "OAuth source is stuck pending" | workflows.md and troubleshooting.md → OAuth claim token |
Verify before clearing stored claim token; re-initiate when needed. |
| "Embed Airweave Connect" | workflows.md → Connect session backend flow, then connect-widget |
Backend owns session/source-connection endpoints; widget owns iframe details. |
| "Select folders/items before sync" | workflows.md → Browse-tree selection, then source-connectors |
Backend owns routes; connector skill owns source capability semantics. |
| "Subscribe to events" | api-reference.md and workflows.md → Webhooks |
Include event types, secret handling, attempts, recovery. |
| "Why is a source sync slow/throttled?" | api-reference.md → source rate limits, then troubleshooting.md |
Check feature flag, source rate_limit_level, and configured limits. |
Validation anchors for later verification
Later whole-skill verification should exercise representative native backend smoke coverage for search v2, legacy search, filters, agentic SSE, collections, Connect sessions, source connections, webhooks, source listing, rate limiting, sync run/cancel lifecycle, entity definitions, and storage-backed sync. Credentialed provider flows should remain opt-in unless the required external accounts and secrets are available.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).