{"id":26261883,"url":"https://github.com/tdiprima/langchain-lab","last_synced_at":"2026-05-17T15:04:00.780Z","repository":{"id":282257602,"uuid":"947995091","full_name":"tdiprima/langchain-lab","owner":"tdiprima","description":"langchain, langgraph, langsmith","archived":false,"fork":false,"pushed_at":"2025-03-13T16:14:57.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T16:29:29.073Z","etag":null,"topics":["langchain","langgraph","langsmith"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdiprima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-13T15:19:57.000Z","updated_at":"2025-03-13T16:15:01.000Z","dependencies_parsed_at":"2025-03-13T16:29:34.088Z","dependency_job_id":"b7a00d7a-0678-442b-959c-c82e3138324f","html_url":"https://github.com/tdiprima/langchain-lab","commit_stats":null,"previous_names":["tdiprima/langchain-lab"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdiprima%2Flangchain-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdiprima%2Flangchain-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdiprima%2Flangchain-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdiprima%2Flangchain-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdiprima","download_url":"https://codeload.github.com/tdiprima/langchain-lab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500787,"owners_count":20300775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["langchain","langgraph","langsmith"],"created_at":"2025-03-14T00:16:30.489Z","updated_at":"2026-05-17T15:04:00.761Z","avatar_url":"https://github.com/tdiprima.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LangChain Lab\n\nA hands-on sandbox for exploring LangChain, LangGraph, and LangSmith — covering chains, agents, RAG, memory, tools, and stateful graph workflows through runnable examples and tutorials.\n\n## The Learning Curve Is Steep\n\nThe LangChain ecosystem spans multiple libraries (LangChain, LangGraph, LangSmith), each with distinct abstractions and use cases. Documentation is dense, API patterns shift between versions, and it's not obvious where to start or how the pieces fit together — especially when you're trying to build something real, not just follow a toy example.\n\n## Working Code You Can Actually Run\n\nThis repo is organized by library, with each module focused on a single concept. Every script is self-contained, pulls credentials from environment variables, and demonstrates one clear pattern. Tutorials include inline documentation that explains the *why*, not just the *what*. The goal is to build genuine intuition by running and modifying real examples.\n\n## Concrete Example\n\nA multi-step medical diagnosis agent (`LangChain/diagnose.py`) that:\n\n1. Retrieves clinical guidelines via FAISS vector search\n2. Queries a symptom database through a custom tool\n3. Combines both into a structured hypothesis using GPT-4\n\n```python\n# Run the diagnosis agent\nexport OPENAI_API_KEY=your_key_here\npython LangChain/diagnose.py\n```\n\n## Usage\n\n**Prerequisites**\n\n- Python 3.10+\n- API keys for the providers you want to use (OpenAI, Anthropic, Ollama for local)\n\n**Install dependencies**\n\n```bash\npip install -r requirements.txt\n```\n\n**Set environment variables**\n\n```bash\nexport OPENAI_API_KEY=your_openai_key\nexport ANTHROPIC_API_KEY=your_anthropic_key       # optional\nexport LANGSMITH_API_KEY=your_langsmith_key        # optional, for tracing\nexport SERPAPI_API_KEY=your_serpapi_key            # optional, for web search\n```\n\n**Run any example directly**\n\n```bash\n# Core LangChain concepts\npython LangChain/Tutorial/chains_example.py         # LCEL pipe operator and RunnableSequence\npython LangChain/Tutorial/agents_example.py         # LLM math agent with tools\npython LangChain/Tutorial/memory_example.py         # Conversation memory\npython LangChain/chat_with_memory.py                # Persistent chat history across sessions\n\n# Real-world agents\npython LangChain/spy_agent_rag.py                   # RAG with FAISS and RetrievalQA\npython LangChain/diagnose.py                        # Clinical symptom analysis with RAG + tools\npython LangChain/Tutorial1/web_search_agent.py      # Web search agent via Tavily\n\n# LangGraph stateful workflows\npython LangGraph/chatgraph.py                       # Intent-aware chat router\npython LangGraph/mathgraph.py                       # Multi-step math reasoning graph\npython LangGraph/calculator.py                      # Minimal graph with tool use\n\n# LangSmith tracing\npython LangSmith/hello_langsmith.py                 # Instrument a chain with tracing\n```\n\n## Project Structure\n\n```\nlangchain-lab/\n├── LangChain/\n│   ├── Tutorial/          # Foundational concepts: chains, memory, agents, tools, models\n│   ├── Tutorial1/         # Intermediate patterns: web search, task processing, RAG\n│   └── *.py               # Applied examples: medical advisor, RAG, diagnosis agent\n├── LangGraph/             # Stateful graph workflows with StateGraph and branching logic\n├── LangSmith/             # Tracing, debugging, and evaluation instrumentation\n├── docs/                  # Concept notes and framework comparisons\n└── requirements.txt\n```\n\n## License\n\nThis project is licensed under a modified MIT License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdiprima%2Flangchain-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdiprima%2Flangchain-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdiprima%2Flangchain-lab/lists"}