optional-local-agent
Operate DeepXiv's optional OpenAI-compatible LangGraph ReAct Agent for local paper search, reading, and multi-turn analysis.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- optional-local-agent
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Operate DeepXiv's optional OpenAI-compatible LangGraph ReAct Agent for local paper search, reading, and multi-turn analysis.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md6.2 KB
- 参考文档references/tool-protocol.md7.5 KB
- 参考文档references/troubleshooting.md5.7 KB
- 参考文档references/workflows.md4.9 KB
- 脚本scripts/agent_dependency_probe.py6.9 KB
03 SKILL.md 正文
Optional local Agent
Use this route when the task needs DeepXiv's local ReAct loop with a caller-selected OpenAI-compatible chat model. It owns the deepxiv_sdk.Agent class, its optional dependency boundary, provider request options, paper-context persistence, tool orchestration, budgets, and failure recovery.
Do not use this route for hosted Reader.agent_search* calls or deepxiv agent ... CLI configuration/query syntax; route those to the Reader/CLI sibling skills.
Fast route
- Run
scripts/agent_dependency_probe.pybefore diagnosing an optional-install problem. It performs local import/spec checks only; it never calls an LLM or the paper service. - Install the optional set with
python -m pip install "deepxiv-sdk[agent]"(or[all]). The published 1.0.0 extras declareopenai,langgraph, andlangchain-core, but do not declaretiktoken, althoughdeepxiv_sdk.agent.agentimports it at module load. Installtiktokenexplicitly when the probe reports it missing. - Construct
Readerand pass it explicitly toAgent;readeris a required constructor argument in source. Supply the model API key toapi_key, and usebase_urlfor an OpenAI-compatible provider. - For reasoning models used across tool rounds, set
enable_thinking=False(or pass an equivalent provider field throughextra_body) when the provider rejects reasoning content in non-final assistant messages. - Keep
max_llm_callsandmax_time_secondsbounded. Preserve context across follow-upquerycalls unlessreset_papers=Trueorreset_papers()is intentional. - Follow the load-first and progressive-reading protocol in
references/tool-protocol.md; consultreferences/troubleshooting.mdfor missing papers versus service failures.
Operating rules
- The base package can expose
Readerwithout the Agent.deepxiv_sdk.__init__attempts the Agent import and silently omitsAgentwhen an optional import raisesImportError; check dependencies rather than assuming the symbol exists. - Never put a key, token, private endpoint, checkout path, or environment name in a public skill or example. Pass secrets at runtime.
- Treat
add_paper()returningFalseas a recoverable missing/not-yet-indexed result. Do not treat it as proof that the ID is invalid forever; try a different ID or broader search. Genuine server/auth/rate-limit failures propagate fromadd_paper(). - A tool result describing a malformed argument, an unloaded paper, or a missing section is recoverable and must not by itself trip the service circuit breaker. Repeated service-side result markers do trip it and force a tools-less final-answer call.
query()returns the graph's extracted answer, but catches graph exceptions and returns anError: ...string.add_paper()has different behavior: expected not-found/bad-request cases returnFalse, while genuine API failures propagate.
References
references/api-reference.md— constructor, methods, provider fields, state and return contracts.references/workflows.md— bounded first query, persistent follow-up, manual preload, and reasoning-provider recipes.references/tool-protocol.md— exact tool order, load/read rules, caches, budgets, and breaker classification.references/troubleshooting.md— optional-import, provider, paper availability, and termination diagnostics.
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).