Loading...
Loading...
Use when "LangChain", "LLM chains", "ReAct agents", "tool calling", or asking about "RAG pipelines", "conversation memory", "document QA", "agent tools", "LangSmith"
npx skill4agent add eyadsibai/ltk langchain-agents| Component | Purpose | Key Concept |
|---|---|---|
| Chat Models | LLM interface | Unified API across providers |
| Agents | Tool use + reasoning | ReAct pattern |
| Chains | Sequential operations | Composable pipelines |
| Memory | Conversation state | Buffer, summary, vector |
| Retrievers | Document lookup | Vector search, hybrid |
| Tools | External capabilities | Functions agents can call |
| Pattern | Description | Use Case |
|---|---|---|
| ReAct | Reason-Act-Observe loop | General tool use |
| Plan-and-Execute | Plan first, then execute | Complex multi-step |
| Self-Ask | Generate sub-questions | Research tasks |
| Structured Chat | JSON tool calling | API integration |
| Element | Purpose |
|---|---|
| Name | How agent refers to tool |
| Description | When to use (critical for selection) |
| Parameters | Input schema |
| Return type | What agent receives back |
| Stage | Purpose | Options |
|---|---|---|
| Load | Ingest documents | Web, PDF, GitHub, DBs |
| Split | Chunk into pieces | Recursive, semantic |
| Embed | Convert to vectors | OpenAI, Cohere, local |
| Store | Index vectors | Chroma, FAISS, Pinecone |
| Retrieve | Find relevant chunks | Similarity, MMR, hybrid |
| Generate | Create response | LLM with context |
| Strategy | Best For | Typical Size |
|---|---|---|
| Recursive | General text | 500-1000 chars |
| Semantic | Coherent passages | Variable |
| Token-based | LLM context limits | 256-512 tokens |
| Strategy | How It Works |
|---|---|
| Similarity | Nearest neighbors by embedding |
| MMR | Diversity + relevance balance |
| Hybrid | Keyword + semantic combined |
| Self-query | LLM generates metadata filters |
| Type | Stores | Best For |
|---|---|---|
| Buffer | Full conversation | Short conversations |
| Window | Last N messages | Medium conversations |
| Summary | LLM-generated summary | Long conversations |
| Vector | Embedded messages | Semantic recall |
| Entity | Extracted entities | Track facts about people/things |
| Source | Loader Type |
|---|---|
| Web pages | WebBaseLoader, AsyncChromium |
| PDFs | PyPDFLoader, UnstructuredPDF |
| Code | GitHubLoader, DirectoryLoader |
| Databases | SQLDatabase, Postgres |
| APIs | Custom loaders |
| Store | Type | Best For |
|---|---|---|
| Chroma | Local | Development, small datasets |
| FAISS | Local | Large local datasets |
| Pinecone | Cloud | Production, scale |
| Weaviate | Self-hosted/Cloud | Hybrid search |
| Qdrant | Self-hosted/Cloud | Filtering, metadata |
| Feature | Benefit |
|---|---|
| Tracing | See every LLM call, tool use |
| Evaluation | Test prompts systematically |
| Datasets | Store test cases |
| Monitoring | Track production performance |
| Practice | Why |
|---|---|
| Start simple | |
| Enable streaming | Better UX for long responses |
| Use LangSmith | Essential for debugging |
| Optimize chunk size | 500-1000 chars typically works |
| Cache embeddings | They're expensive to compute |
| Test retrieval separately | RAG quality depends on retrieval |
| Aspect | LangChain | LangGraph |
|---|---|---|
| Best for | Quick agents, RAG | Complex workflows |
| Code to start | <10 lines | ~30 lines |
| State management | Limited | Native |
| Branching logic | Basic | Advanced |
| Human-in-loop | Manual | Built-in |