agents-langchain
Build LLM applications with chain-style orchestration frameworks — prompts, chains, tool-calling agents, memory, and retrieval pipelines. Use when structuring multi-step LLM programs, adding tools to a model, or composing RAG systems in code.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- agents-langchain
- category
- ai-research
- description
- Build LLM applications with chain-style orchestration frameworks — prompts, chains, tool-calling agents, memory, and retrieval pipelines. Use when structuring multi-step LLM programs, adding tools to a model, or composing RAG systems in code.
03 SKILL.md 正文
Agents with Chain-Style LLM Frameworks
Chain-style orchestration libraries give you composable building blocks — prompt templates, model wrappers, output parsers, memory, document loaders, and agent loops — so you write pipelines instead of raw API calls.
Overview
The core idea is composition: small, typed units (prompt -> model -> parser) that snap together into chains, which in turn become tools inside an agent loop. A model provider wrapper normalizes API differences; a prompt template keeps prompts version-controlled and parameterizable; a parser turns model text into structured data; a retriever plus chain gives you retrieval-augmented generation. Agents emerge when a model is allowed to choose between tools in a loop until the task is done.
When to use
- Turning a hand-rolled prompt script into a maintainable multi-step pipeline.
- Giving a model tools (search, calculator, database) via a standard agent loop.
- Building RAG: load documents, split them, embed, store, retrieve, generate.
- Adding conversation or entity memory to a prototype agent.
- Evaluating and streaming: you need token streaming, callbacks, or trace hooks out of the box.
Core concepts
- Prompt templates: parameterized prompt strings with named variables (
{question},{context}) so prompts are testable artifacts, not inline string soup. Keep few-shot examples in the template, not in code. - Chains: sequential composition —
prompt | model | parser. The classic patterns are simple chains, sequential chains (output of step N feeds step N+1), and map-reduce chains (summarize chunks, then combine). - Tool-calling agents: the model sees tool descriptions and emits structured calls; a loop executes the call and feeds the result back. Prefer structured tool-calling models over regex parsing of free text.
- Memory: short-term chat history, sliding windows, or summary memory that compresses old turns. Choose memory by cost budget — raw history is exact but expensive.
- Retrieval: loaders split documents into chunks, embeddings index them, and a retriever fetches top-k passages into the prompt. Chain the retriever with a QA chain for the standard RAG recipe.
- Callbacks and tracing: hooks for logging, streaming tokens, and timing each component. Turn these on early; debugging agents without traces is guesswork.
Practical workflow
- Start with the simplest chain: prompt template + model + output parser. Validate end-to-end before adding tools.
- Define tools as small functions with clear names and docstring-style descriptions; test each tool standalone.
- Wrap the chain in an agent loop with a max-iteration cap and a fallback answer so it always terminates.
- Add memory: try a sliding-window chat history first; switch to summary memory only if tokens blow up.
- For RAG, prototype the retriever offline — inspect which chunks actually come back for sample queries before wiring generation.
- Enable tracing/callbacks from day one and keep a small eval set of representative tasks to rerun after every change.
# Mental model of a standard agent loop
while not done and iterations < MAX:
thought = model(prompt(history, tools))
if thought is tool_call:
result = execute(tool, args)
history.append(result)
else:
answer = thought; done = True
Common pitfalls
- Regex-parsed actions: letting the model emit free text like "Action: Search" and parsing with regex is brittle. Use models with native structured tool calling.
- Unbounded agent loops: no iteration cap or time budget means infinite loops and runaway costs. Always cap and add a graceful fallback.
- Giant context windows as memory: dumping full history is simple but slow and expensive; compress or summarize.
- Retrieval never inspected: trusting a vector store blindly. Look at the actual chunks retrieved for real queries; bad chunks explain most RAG failures.
- Prompt drift: prompts edited inline across the codebase. Keep them as versioned templates with a changelog.
- Skipping evals: agent changes that "feel better" but aren't measured. Keep a fixed eval set and score it on every iteration.
04 同仓库更多 Skills
web-scrape
Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.
design-taste-frontend
tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
requesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).