langchain
Work on the LangChain Python monorepo: package routing, core primitives, v1 agents and middleware, classic APIs, partner integrations, standard tests, model profiles, and safe validation workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- langchain
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Work on the LangChain Python monorepo: package routing, core primitives, v1 agents and middleware, classic APIs, partner integrations, standard tests, model profiles, and safe validation workflows.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/development-commands.md1.9 KB
- 参考文档references/repo-provenance.md2.0 KB
- 参考文档references/repo-routing-metadata.json487 B
- 参考文档references/repository-map.md2.2 KB
- 参考文档references/troubleshooting.md2.0 KB
- 脚本scripts/check_skill_links.py1.9 KB
03 SKILL.md 正文
LangChain Python Monorepo
Use this skill when a task targets the LangChain Python repository, its package-local development workflow, or one of its maintained Python packages.
Start Here
- Identify the package and workflow with repository-map.md.
- Use the sub-skill that owns the change instead of scanning the whole monorepo.
- Follow development-commands.md for package-local
uv, pytest, lint, type, import, and version checks. - Use troubleshooting.md for environment, import, optional dependency, integration-test, and source-layout failures.
- Check repo-provenance.md when deciding whether this skill is stale relative to the current checkout.
Route by Task
- Monorepo navigation, package metadata, validation commands, public API guardrails, PR conventions, and docs/model-reference rules: use monorepo-development.
langchain-coreprimitives such as runnables, messages, prompts, tools, documents, embeddings, vector stores, model interfaces, callbacks, parsers, serialization, and deprecation utilities: use core-primitives.- Actively maintained
langchainv1 APIs such asinit_chat_model,create_agent, structured output, tools, middleware, embeddings, provider routing, and agent runtime customization: use agents-and-middleware. langchain-classicchains, retrievers, document loaders/transformers, memory, indexes, classic agents, evaluation, and legacy maintenance or migration: use classic-chains.- Partner packages under
libs/partners, provider SDK dependencies, credentials, unit/integration test split, cassettes, vector-store services, and provider model profile data: use integrations. langchain-tests, native verification selection, pytest marker/snapshot safety, model-profile CLI internals, and safe test/profile command planning: use testing-and-profiles.
Package Boundaries
libs/corepublisheslangchain-core, the stable abstraction layer used by other packages.libs/langchain_v1publisheslangchain, the actively maintained high-level package.libs/langchainpublisheslangchain-classic, a legacy compatibility package; avoid new feature work there unless explicitly requested.libs/text-splitterspublisheslangchain-text-splitters, focused on chunking documents and text.libs/partners/<provider>publish maintained provider integrations such as OpenAI, Anthropic, Ollama, Qdrant, Chroma, DeepSeek, Fireworks, Groq, Hugging Face, MistralAI, Nomic, Perplexity, OpenRouter, xAI, and Exa.libs/standard-testspublisheslangchain-tests, shared conformance tests for integrations.libs/model-profilescontains the model profile refresh CLI and provider profile tooling.
Default Development Workflow
Run commands from the owning package directory unless a package reference says otherwise:
cd libs/<package>
uv sync --group test
uv run --group test pytest tests/unit_tests/path/to/test_file.py
make lint_package
make type
Use narrower commands first. Add --group lint, --group typing, --group test_integration, or --all-groups only when the package metadata and task require those dependencies. Do not use pip, poetry, conda, or ad-hoc virtual environments for normal LangChain development.
Safety and Validation
- Preserve public function/class signatures, argument order, names, defaults, and exported symbols unless the user accepts a breaking change.
- Add deterministic unit tests for bug fixes and feature changes; avoid network, credentials, provider services, or long-running checks by default.
- Use integration tests only when explicitly requested and credentials/services are available.
- For provider model examples in docs, verify current generally available model IDs against provider docs before updating examples.
- Use bundled scripts only as local helpers; they are read-only smoke/inspection utilities and do not replace package test suites.
Bundled References and Scripts
- Repository map gives the capability-to-package map and sub-skill ownership.
- Development commands gives command patterns and validation escalation rules.
- Troubleshooting covers cross-cutting failures and recovery decisions.
- Repo provenance records the source snapshot and evidence paths.
- Skill health check validates generated skill links and common leakage patterns.
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).