langchain-agents-langchain-code
- Repo stars 0
- Author updated Live
- Author repo skills-registry
- Domain
- AI
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @tomevault-io · no license declared
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Required · OpenAI / Anthropic
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- External requests
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: langchain-agents-langchain-code
description: Use when editing a non-agentic LCEL pipeline — composing Runnables, retrievers, embeddings, chat…
category: ai
runtime: Python
---
# langchain-agents-langchain-code output preview
## PART A: Task fit
- Use case: Use when editing a non-agentic LCEL pipeline — composing Runnables, retrievers, embeddings, chat models, parsers, or building a RAG chain. For agents (LLM + tools loop), use the middleware skill instead..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “When to use LCEL vs createagent / Things the docs won't warn you about / Production rules of thumb” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Use when editing a non-agentic LCEL pipeline — composing Runnables, retrievers, embeddings, chat models, parsers, or building a RAG chain. For agents (LLM + tools loop), use the middleware skill instead.”.
- **02** When the source has headings, the agent prioritizes “When to use LCEL vs createagent / Things the docs won't warn you about / Production rules of thumb” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; may access external network resources; requires OpenAI / Anthropic API keys.
## Running Rules
- read files, write/modify files; may access external network resources; requires OpenAI / Anthropic API keys.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “When to use LCEL vs createagent / Things the docs won't warn you about / Production rules of thumb”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: langchain-agents-langchain-code
description: Use when editing a non-agentic LCEL pipeline — composing Runnables, retrievers, embeddings, chat…
category: ai
source: tomevault-io/skills-registry
---
# langchain-agents-langchain-code
## When to use
- Use when editing a non-agentic LCEL pipeline — composing Runnables, retrievers, embeddings, chat models, parsers, or b…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “When to use LCEL vs createagent / Things the docs won't warn you about / Production rules of thumb” and keep inference separate from source facts.
- read files, write/modify files; may access external network resources; requires OpenAI / Anthropic API keys.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "langchain-agents-langchain-code" {
input -> user goal + target files + boundaries + acceptance criteria
context -> When to use LCEL vs createagent / Things the docs won't warn you about / Production rules of thumb
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files | may access external network resources
guardrails -> requires OpenAI / Anthropic API keys + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} LangChain (LCEL): editorial guidance
For API reference (full Runnable list, parser types, retriever interfaces), use the mcpdoc MCP tools: fetch_docs("https://docs.langchain.com/oss/python/langchain/..."). This skill is the opinions layer.
When to use LCEL vs create_agent
LCEL is for non-agentic flows: deterministic pipelines (RAG, summarization, classification, structured extraction). The pipeline runs once, end-to-end, no loop, no tool-calling LLM driving control flow.
If the task involves an LLM deciding which tools to call, don't use LCEL — use create_agent(...) + middleware. Trying to bolt agentic behavior onto an LCEL chain is the most common mistake here. The dividing line: does the LLM choose what happens next, or does the code? If LLM, agents. If code, LCEL.
Things the docs won't warn you about
chain.invoke(x)wherexis a string but the chain expects a dict will silently coerce in some configurations and fail in others — pass a dict explicitly.init_chat_modelreads provider creds from env (OPENAI_API_KEY,ANTHROPIC_API_KEY). It will not prompt; missing env raises at first call, not at construction.- Parsers are part of the chain.
chat_model.invoke(...)returns anAIMessage; pipe throughStrOutputParser()to get a plain string. - Middleware does NOT apply to LCEL chains. Middleware is
create_agent-only. For chains, use chain-levelchain.with_retry(...)andchain.with_fallbacks([...])instead. with_structured_outputdoes not stream — it accumulates the full response and returns the validated object. If you need streaming AND typed output, you can't have both via this API.
Production rules of thumb
- Always wrap production chains with
.with_retry(stop_after_attempt=3, wait_exponential_jitter=True)for resilience to transient model failures. - For provider redundancy, use
.with_fallbacks([cheaper_model_chain])— fallback chains run if the primary raises. The fallback is a full chain, not just a model. - For typed output, use
model.with_structured_output(PydanticModel)before composing into the chain. Validation is automatic; you get the Pydantic instance, not a dict. - For RAG, add a guardrail stage that returns "I don't know" when
len(context) == 0. Without it, the LLM hallucinates from empty context. - For RAG, consider a reranker between retriever and prompt. Recall@k improves substantially. The retriever's first 20 results passed through a reranker that picks the top 5 outperforms a retriever that fetches 5 directly.
When to reach for what
| Need | Tool |
|---|---|
| LLM + tools, deciding what to do next | create_agent (NOT LCEL) |
| Deterministic transformation (text → structured) | LCEL with with_structured_output |
| RAG over a vector store | LCEL with RunnableParallel of retriever + question |
| Multi-step pipeline with branches | LCEL with RunnableBranch or upgrade to StateGraph if branches need state |
| Streaming token output | LCEL chain (most parsers stream); NOT with_structured_output |
| Async at scale | LCEL .ainvoke / .astream |
Doc URLs to fetch with mcpdoc
https://docs.langchain.com/oss/python/langchain/lcel.md— LCEL primerhttps://docs.langchain.com/oss/python/langchain/structured-output.md—with_structured_outputhttps://docs.langchain.com/oss/python/langchain/runnables.md— Runnable types and methodshttps://docs.langchain.com/oss/python/langchain/retrievers.md— retriever interfaceshttps://docs.langchain.com/oss/python/langchain/chat-models.md—init_chat_modeland provider model names
When you need a specific class signature or kwarg, fetch from these. Don't guess at constructor args.
Source: cwijayasundara/agent_cli_langchain — distributed by TomeVault.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review