AGENT SKILL

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

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.md after choosing the context or retriever here.
  • Gradio, Chrome extension server, AgentServer, or lavague-serve: route to ../server-extension-gradio/SKILL.md.
  • lavague-qa and lavague-test: route to ../qa-and-test-runner/SKILL.md.

Fast workflow

  1. Pick the provider context from references/provider-contexts.md; install the matching optional package if its import is missing.
  2. Check required environment variables without printing secret values. For Anthropic and Fireworks, remember that default components still require OPENAI_API_KEY for OpenAI embedding or multimodal pieces.
  3. Prefer WorldModel.from_context(context) and ActionEngine.from_context(context, driver=driver) when all three context models should travel together. Pass individual custom LlamaIndex objects only when mixing providers deliberately.
  4. 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.
  5. 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 use OpenaiContext() or rely on LaVague's default context.
  • Azure OpenAI: pass explicit llm, mm_llm, deployment, endpoint, and embedding_deployment; do not rely on defaults for deployment names.
  • Anthropic planning/action with OpenAI embeddings: set both ANTHROPIC_API_KEY and OPENAI_API_KEY, then use AnthropicContext().
  • Gemini all-in-one: set GOOGLE_API_KEY, then use GeminiContext().
  • Fireworks action/embedding with OpenAI multimodal world model: set FIREWORKS_API_KEY and OPENAI_API_KEY, then use FireworksContext().
  • Cache-driven dry recovery: use ContextCache only 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(), and XPathedChunkRetriever() when you need deterministic XPath marking plus lightweight syntax filtering; add Cohere only when COHERE_API_KEY and 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, task user_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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351