classic-chains
Maintain and migrate langchain-classic legacy chains, retrievers, document loaders, memory, indexes, classic agents, evaluation, and callbacks. Use for compatibility fixes in libs/langchain-style classic APIs; route new v1 agent work elsewhere.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- classic-chains
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Maintain and migrate langchain-classic legacy chains, retrievers, document loaders, memory, indexes, classic agents, evaluation, and callbacks. Use for compatibility fixes in libs/langchain-style classic APIs; route new v1 agent work elsewhere.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/legacy-api-map.md5.7 KB
- 参考文档references/maintenance-workflows.md6.2 KB
- 参考文档references/troubleshooting.md6.0 KB
- 脚本scripts/classic_import_smoke.py3.7 KB
03 SKILL.md 正文
Classic Chains
When to Use
Use this sub-skill when the task is about langchain-classic legacy workflows: classic Chain subclasses, retrieval QA, conversational retrieval, document loaders and transformers, memory classes, indexes, classic agents, evaluation chains, callbacks, or compatibility-preserving maintenance.
Do not use this sub-skill for new v1 agent APIs, middleware, or graph/checkpoint design; route those to ../agents-and-middleware/SKILL.md. For shared primitives such as Document, BaseRetriever, runnables, callbacks interfaces, messages, prompts, or vector store base contracts, route to ../core-primitives/SKILL.md.
Legacy Policy
langchain-classic is the legacy package. Prefer maintenance, bug fixes, import compatibility, deprecation cleanup, and migration guidance over adding new classic-only features. Preserve public signatures and behavior unless the user explicitly asks for migration and the replacement is validated.
Reference Map
- Read references/legacy-api-map.md to identify classic modules, import ownership, optional community/provider boundaries, and sibling routing.
- Read references/maintenance-workflows.md for compatibility-safe edit workflows, local validation commands, and skip conditions.
- Read references/troubleshooting.md for deprecated imports, optional dependency errors, chain key mismatches, retriever/document-loader failures, and signature preservation.
- Use scripts/classic_import_smoke.py for a read-only installed-package import smoke check after changing import surfaces or compatibility routing.
Practical Workflow
- Classify the request as maintenance, compatibility, migration, or new feature. Decline or reroute new classic-only feature work unless it is needed for compatibility.
- Locate the affected classic area: chains, agents, retrievers, document loaders/transformers, memory, indexes, evaluation, callbacks, or schema compatibility.
- Check whether the symbol is owned by
langchain_classic, dynamically re-exported fromlangchain_community, or shared fromlangchain_core. - Preserve public constructor and method signatures. Add keyword-only parameters only when unavoidable, and cover behavior with deterministic unit tests.
- Prefer package-local validation from the classic package directory, for example
uv run --group test pytest tests/unit_tests/chains/test_conversation_retrieval.py, whenuvand dependencies are available. - If the task is migration-oriented, produce v1/core-equivalent code paths while preserving behavior with tests around inputs, outputs, memory variables, callbacks, and returned documents.
Validation Signals
- Unit tests pass for the nearest
tests/unit_tests/...file or directory. - Import smoke checks pass for touched public modules in an installed package.
- Deprecation warnings remain intentional and point users toward the modern package or API.
- Chain
input_keys,output_keys, memory variables, callback propagation, and async/sync behavior remain backward compatible.
Skip Conditions
Skip network-heavy integration tests, provider API calls, vector database services, browser automation, and credential-dependent loaders unless the user explicitly supplies safe credentials and asks for those checks. If uv is unavailable, record that package-local tests were skipped and rely on static inspection plus the safe smoke script when a usable Python interpreter already has the packages installed.
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).