contexts-and-retrievers
Choose and validate LaVague provider contexts, credentials, custom model objects, cache contexts, and retriever pipelines without making live provider or browser calls by default.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- contexts-and-retrievers
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Choose and validate LaVague provider contexts, credentials, custom model objects, cache contexts, and retriever pipelines without making live provider or browser calls by default.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/customization-workflows.md5.6 KB
- 参考文档references/provider-contexts.md6.5 KB
- 参考文档references/retriever-reference.md6.4 KB
- 参考文档references/troubleshooting.md6.8 KB
- 脚本scripts/lavague_context_retriever_probe.py14.1 KB
03 SKILL.md 正文
LaVague Contexts and Retrievers
Use this sub-skill when a LaVague task needs provider/model selection, API-key checks, custom LlamaIndex llm/embedding/mm_llm wiring, cache-backed contexts, WorldModel knowledge examples, task user_data, or ActionEngine/NavigationEngine retriever selection.
Route first
- Provider context, credentials, custom models, cache, Cohere rerank, or
RetrieversPipeline: stay here. - Browser construction, Selenium/Playwright profiles, browser binaries, screenshots, tabs, iframes, or CAPTCHA/session handling: route to
../browser-drivers/SKILL.md. - Full
WebAgent,WorldModel,ActionEngine, logs, token counts, or agent run/debug loops: route to../core-web-agent/SKILL.mdafter choosing the context or retriever here. - Gradio, Chrome extension server,
AgentServer, orlavague-serve: route to../server-extension-gradio/SKILL.md. lavague-qaandlavague-test: route to../qa-and-test-runner/SKILL.md.
Fast workflow
- Pick the provider context from
references/provider-contexts.md; install the matching optional package if its import is missing. - Check required environment variables without printing secret values. For Anthropic and Fireworks, remember that default components still require
OPENAI_API_KEYfor OpenAI embedding or multimodal pieces. - Prefer
WorldModel.from_context(context)andActionEngine.from_context(context, driver=driver)when all three context models should travel together. Pass individual custom LlamaIndex objects only when mixing providers deliberately. - Pick a retriever from
references/retriever-reference.md. Keep the default retriever unless retrieval logs show missing target nodes or a page has unusual markup. - Run the bundled safe probe before live work:
python sub-skills/contexts-and-retrievers/scripts/lavague_context_retriever_probe.py --context all --retriever all --check-env
The probe imports modules, inspects constructor signatures, and reports whether required credential variables are present. It does not instantiate providers, contact model APIs, launch browsers, download data, or start servers.
Common recipes
- OpenAI default: ensure
OPENAI_API_KEY, then useOpenaiContext()or rely on LaVague's default context. - Azure OpenAI: pass explicit
llm,mm_llm,deployment,endpoint, andembedding_deployment; do not rely on defaults for deployment names. - Anthropic planning/action with OpenAI embeddings: set both
ANTHROPIC_API_KEYandOPENAI_API_KEY, then useAnthropicContext(). - Gemini all-in-one: set
GOOGLE_API_KEY, then useGeminiContext(). - Fireworks action/embedding with OpenAI multimodal world model: set
FIREWORKS_API_KEYandOPENAI_API_KEY, then useFireworksContext(). - Cache-driven dry recovery: use
ContextCacheonly when prompt/embedding stores are intentionally local and versioned for the run; understand fallback behavior before assuming it is offline. - Retriever pipeline: compose
InteractiveXPathRetriever(driver),SyntaxicRetriever(), andXPathedChunkRetriever()when you need deterministic XPath marking plus lightweight syntax filtering; add Cohere only whenCOHERE_API_KEYand network/API use are explicitly permitted.
References
references/provider-contexts.md— provider packages, signatures, environment variables, default-model caveats, and cache stores.references/retriever-reference.md— retriever classes, default pipeline, Cohere rerank behavior, and selection rules.references/customization-workflows.md— mixed-provider contexts,from_context,add_knowledge, taskuser_data, and template snippets.references/troubleshooting.md— optional-package, API-key, Azure, embedding, cache, Cohere, and NLTK/import issues.
Safety defaults
Keep provider calls and browser launches opt-in. The examples distilled into this sub-skill originally run live web objectives, but the bundled helper only performs local import/signature/env checks and prints runnable templates. Never store API keys in generated files, logs, or prompt caches.
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).