Home
Softono
l

langchain-ai

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
10

Software by langchain-ai

langchain
Open Source

langchain

LangChain .NET is a C implementation of the popular LangChain framework, designed to facilitate building applications with Large Language Models through composability. The project aims to closely mirror the abstractions of the original LangChain while remaining open to new entities specific to the .NET ecosystem. Unlike Microsoft Semantic Kernel, which is built on Microsoft-specific technologies, LangChain .NET prioritizes maximum flexibility and the ability to integrate third-party libraries freely. The library supports a modular architecture for developers to construct complex AI workflows. Key capabilities include initializing various LLM providers such as OpenAI, managing vector databases like SQLite for persistent storage, and loading documents from sources including PDFs. Developers can perform tasks such as creating embeddings from text, splitting documents into chunks, storing data in vector collections, and retrieving similar documents based on user queries. The retrieved context can then be combined

AI & Machine Learning AI Agents ML Frameworks
1K Github Stars
langgraph
Open Source

langgraph

<div align="center"> <a href="https://www.langchain.com/langgraph"> <picture> <source media="(prefers-color-scheme: dark)" srcset=".github/images/logo-dark.svg"> <source media="(prefers-color-scheme: light)" srcset=".github/images/logo-light.svg"> <img alt="LangGraph Logo" src=".github/images/logo-dark.svg" width="50%"> </picture> </a> </div> <div align="center"> <h3>Low-level orchestration framework for building stateful agents.</h3> </div> <div align="center"> <a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/pypi/l/langgraph" alt="PyPI - License"></a> <a href="https://pypistats.org/packages/langgraph" target="_blank"><img src="https://img.shields.io/pepy/dt/langgraph" alt="PyPI - Downloads"></a> <a href="https://pypi.org/project/langgraph/" target="_blank"><img src="https://img.shields.io/pypi/v/langgraph.svg?label=%20" alt="Version"></a> <a href="https://x.com/langchain_oss" target="_blank"><img src="https://img.shields.io/twitter/url/https/twitter.com/langchain_oss.svg?style=social&label=Follow%20%40LangChain" alt="Twitter / X"></a> </div> <br> Trusted by companies shaping the future of agents – including Klarna, Replit, Elastic, and more – LangGraph is a low-level orchestration framework for building, managing, and deploying long-running, stateful agents. ```bash pip install -U langgraph ``` > [!TIP] > If you're looking to quickly build agents, check out **[Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview)** β€” a higher-level package built on LangGraph for agents that can plan, use subagents, and leverage file systems for complex tasks. For an equivalent JS/TS library, check out [LangGraph.js](https://github.com/langchain-ai/langgraphjs) and the [JS docs](https://docs.langchain.com/oss/javascript/langgraph/overview). ## Why use LangGraph? LangGraph provides low-level supporting infrastructure for *any* long-running, stateful workflow or agent: - **[Durable execution](https://docs.langchain.com/oss/python/langgraph/durable-execution)** β€” Build agents that persist through failures and can run for extended periods, automatically resuming from exactly where they left off. - **[Human-in-the-loop](https://docs.langchain.com/oss/python/langgraph/interrupts)** β€” Seamlessly incorporate human oversight by inspecting and modifying agent state at any point during execution. - **[Comprehensive memory](https://docs.langchain.com/oss/python/langgraph/memory)** β€” Create truly stateful agents with both short-term working memory for ongoing reasoning and long-term persistent memory across sessions. - **[Debugging with LangSmith](https://www.langchain.com/langsmith)** β€” Gain deep visibility into complex agent behavior with visualization tools that trace execution paths, capture state transitions, and provide detailed runtime metrics. - **[Production-ready deployment](https://docs.langchain.com/langsmith/deployments)** β€” Deploy sophisticated agent systems confidently with scalable infrastructure designed to handle the unique challenges of stateful, long-running workflows. > [!TIP] > For developing, debugging, and deploying AI agents and LLM applications, see [LangSmith](https://docs.langchain.com/langsmith/home). ## LangGraph ecosystem While LangGraph can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools for building agents. To improve your LLM application development, pair LangGraph with: - [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) – Build agents that can plan, use subagents, and leverage file systems for complex tasks. - [LangChain](https://docs.langchain.com/oss/python/langchain/overview) – Provides integrations and composable components to streamline LLM application development. - [LangSmith](https://www.langchain.com/langsmith) – Helpful for agent evals and observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain visibility in production, and improve performance over time. - [LangSmith Deployment](https://docs.langchain.com/langsmith/deployments) – Deploy and scale agents effortlessly with a purpose-built deployment platform for long-running, stateful workflows. Discover, reuse, configure, and share agents across teams – and iterate quickly with visual prototyping in [LangSmith Studio](https://docs.langchain.com/langsmith/studio). --- ## Documentation - [docs.langchain.com](https://docs.langchain.com/oss/python/langgraph/overview) – Comprehensive documentation, including conceptual overviews and guides - [reference.langchain.com/python/langgraph](https://reference.langchain.com/python/langgraph) – API reference docs for LangGraph packages - [LangGraph Quickstart](https://docs.langchain.com/oss/python/langgraph/quickstart) – Get started building with LangGraph - [Chat LangChain](https://chat.langchain.com/) – Chat with the LangChain documentation and get answers to your questions **Discussions**: Visit the [LangChain Forum](https://forum.langchain.com) to connect with the community and share all of your technical questions, ideas, and feedback. ## Additional resources - **[Guides](https://docs.langchain.com/oss/python/learn)** – Quick, actionable code snippets for topics such as streaming, adding memory & persistence, and design patterns (e.g. branching, subgraphs, etc.). - **[LangChain Academy](https://academy.langchain.com/courses/intro-to-langgraph)** – Learn the basics of LangGraph in our free, structured course. - **[Case studies](https://www.langchain.com/built-with-langgraph)** – Hear how industry leaders use LangGraph to ship AI applications at scale. - [Contributing Guide](https://docs.langchain.com/oss/python/contributing/overview) – Learn how to contribute to LangChain projects and find good first issues. - [Code of Conduct](https://github.com/langchain-ai/langchain/?tab=coc-ov-file) – Our community guidelines and standards for participation. --- ## Acknowledgements LangGraph is inspired by [Pregel](https://research.google/pubs/pub37252/) and [Apache Beam](https://beam.apache.org/). The public interface draws inspiration from [NetworkX](https://networkx.org/documentation/latest/). LangGraph is built by LangChain Inc, the creators of LangChain, but can be used without LangChain.

AI Agents ML Frameworks
34.3K Github Stars
open-swe
Open Source

open-swe

<div align="center"> <a href="https://github.com/langchain-ai/open-swe"> <picture> <source media="(prefers-color-scheme: dark)" srcset="static/dark.svg"> <source media="(prefers-color-scheme: light)" srcset="static/light.svg"> <img alt="Open SWE Logo" src="static/dark.svg" width="35%"> </picture> </a> </div> <div align="center"> <h3>Open-source framework for building your org's internal coding agent.</h3> </div> <div align="center"> <a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/github/license/langchain-ai/open-swe" alt="License"></a> <a href="https://github.com/langchain-ai/open-swe/stargazers" target="_blank"><img src="https://img.shields.io/github/stars/langchain-ai/open-swe" alt="GitHub Stars"></a> <a href="https://github.com/langchain-ai/langgraph" target="_blank"><img src="https://img.shields.io/badge/Built%20on-LangGraph-blue" alt="Built on LangGraph"></a> <a href="https://github.com/langchain-ai/deepagents" target="_blank"><img src="https://img.shields.io/badge/Built%20on-Deep%20Agents-blue" alt="Built on Deep Agents"></a> <a href="https://x.com/langchain" target="_blank"><img src="https://img.shields.io/twitter/url/https/twitter.com/langchain.svg?style=social&label=Follow%20%40LangChain" alt="Twitter / X"></a> </div> <br> Elite engineering orgs like Stripe, Ramp, and Coinbase are building their own internal coding agents β€” Slackbots, CLIs, and web apps that meet engineers where they already work. These agents are connected to internal systems with the right context, permissioning, and safety boundaries to operate with minimal human oversight. Open SWE is the open-source version of this pattern. Built on [LangGraph](https://langchain-ai.github.io/langgraph/) and [Deep Agents](https://github.com/langchain-ai/deepagents), it gives you the same architecture those companies built internally: cloud sandboxes, Slack and Linear invocation, subagent orchestration, and automatic PR creation β€” ready to customize for your own codebase and workflows. > [!NOTE] > πŸ’¬ Read the **announcement blog post [here](https://blog.langchain.com/open-swe-an-open-source-framework-for-internal-coding-agents/)** --- ## Architecture Open SWE makes the same core architectural decisions as the best internal coding agents. Here's how it maps to the patterns described in [this overview](https://x.com/kishan_dahya/status/2028971339974099317) of Stripe's Minions, Ramp's Inspect, and Coinbase's Cloudbot: ### 1. Agent Harness β€” Composed on Deep Agents Rather than forking an existing agent or building from scratch, Open SWE **composes** on the [Deep Agents](https://github.com/langchain-ai/deepagents) framework β€” similar to how Ramp built on top of OpenCode. This gives you an upgrade path (pull in upstream improvements) while letting you customize the orchestration, tools, and middleware for your org. ```python create_deep_agent( model="openai:gpt-5.5", system_prompt=construct_system_prompt(...), tools=[http_request, fetch_url, linear_comment, slack_thread_reply], backend=sandbox_backend, middleware=[ToolErrorMiddleware(), check_message_queue_before_model, ...], ) ``` ### 2. Sandbox β€” Isolated Cloud Environments Every task runs in its own **isolated cloud sandbox** β€” a remote Linux environment with full shell access. The repo is cloned in, the agent gets full permissions, and the blast radius of any mistake is fully contained. No production access, no confirmation prompts. Open SWE supports multiple sandbox providers out of the box β€” [Modal](https://modal.com/), [Daytona](https://www.daytona.io/), [Runloop](https://www.runloop.ai/), and [LangSmith](https://smith.langchain.com/) β€” and you can plug in your own. See the [Customization Guide](CUSTOMIZATION.md#1-sandbox) for details. This follows the principle all three companies converge on: **isolate first, then give full permissions inside the boundary.** - Each thread gets a persistent sandbox (reused across follow-up messages) - Sandboxes auto-recreate if they become unreachable - Multiple tasks run in parallel β€” each in its own sandbox, no queuing ### 3. Tools β€” Curated, Not Accumulated Stripe's key insight: *tool curation matters more than tool quantity.* Open SWE follows this principle with a small, focused toolset: | Tool | Purpose | |---|---| | `execute` | Shell commands in the sandbox | | `fetch_url` | Fetch web pages as markdown | | `http_request` | API calls (GET, POST, etc.) | | `linear_comment` | Post updates to Linear tickets | | `slack_thread_reply` | Reply in Slack threads | GitHub operations are performed with `GH_TOKEN=dummy gh` inside the sandbox, backed by the LangSmith proxy. Plus the built-in Deep Agents tools: `read_file`, `write_file`, `edit_file`, `ls`, `glob`, `grep`, `write_todos`, and `task` (subagent spawning). ### 4. Context Engineering β€” AGENTS.md + Source Context Open SWE gathers context from two sources: - **`AGENTS.md`** β€” If the repo contains an `AGENTS.md` file at the root, it's read from the sandbox and injected into the system prompt. This is your repo-level equivalent of Stripe's rule files: encoding conventions, testing requirements, and architectural decisions that every agent run should follow. - **Source context** β€” The full Linear issue (title, description, comments) or Slack thread history is assembled and passed to the agent, so it starts with rich context rather than discovering everything through tool calls. ### 5. Orchestration β€” Subagents + Middleware Open SWE's orchestration has two layers: **Subagents:** The Deep Agents framework natively supports spawning child agents via the `task` tool. The main agent can fan out independent subtasks to isolated subagents β€” each with its own middleware stack, todo list, and file operations. This is similar to Ramp's child sessions for parallel work. **Middleware:** Deterministic middleware hooks run around the agent loop: - **`check_message_queue_before_model`** β€” Injects follow-up messages (Linear comments or Slack messages that arrive mid-run) before the next model call. You can message the agent while it's working and it'll pick up your input at its next step. - **`notify_step_limit_reached`** β€” After-agent hook that posts a Slack reply when the agent hits the model-call limit, so users get a clear signal instead of silence. - **`ToolErrorMiddleware`** β€” Catches and handles tool errors gracefully. ### 6. Invocation β€” Slack, Linear, and GitHub All three companies in the article converge on **Slack as the primary invocation surface**. Open SWE does the same: - **Slack** β€” Mention the bot in any thread. Supports `repo:owner/name` syntax to specify which repo to work on. The agent replies in-thread with status updates and PR links. - **Linear** β€” Comment `@openswe` on any issue. The agent reads the full issue context, reacts with πŸ‘€ to acknowledge, and posts results back as comments. - **GitHub** β€” Tag `@openswe` in PR comments on agent-created PRs to have it address review feedback and push fixes to the same branch. Each invocation creates a deterministic thread ID, so follow-up messages on the same issue or thread route to the same running agent. ### 7. Validation β€” Prompt-Driven The agent is instructed to run linters, formatters, and tests before committing, and is responsible end-to-end for committing, pushing, opening/updating the draft PR, and replying in the source channel. This is an area where you can extend Open SWE for your org: add deterministic CI checks, visual verification, or review gates as additional middleware. See the [Customization Guide](CUSTOMIZATION.md#6-middleware) for how. --- ## Comparison | Decision | Open SWE | Stripe (Minions) | Ramp (Inspect) | Coinbase (Cloudbot) | |---|---|---|---|---| | **Harness** | Composed (Deep Agents/LangGraph) | Forked (Goose) | Composed (OpenCode) | Built from scratch | | **Sandbox** | Pluggable (Modal, Daytona, Runloop, etc.) | AWS EC2 devboxes (pre-warmed) | Modal containers (pre-warmed) | In-house | | **Tools** | ~15, curated | ~500, curated per-agent | OpenCode SDK + extensions | MCPs + custom Skills | | **Context** | AGENTS.md + issue/thread | Rule files + pre-hydration | OpenCode built-in | Linear-first + MCPs | | **Orchestration** | Subagents + middleware | Blueprints (deterministic + agentic) | Sessions + child sessions | Three modes | | **Invocation** | Slack, Linear, GitHub | Slack + embedded buttons | Slack + web + Chrome extension | Slack-native | | **Validation** | Prompt-driven | 3-layer (local + CI + 1 retry) | Visual DOM verification | Agent councils + auto-merge | --- ## Features - **Trigger from Linear, Slack, or GitHub** β€” mention `@openswe` in a comment to kick off a task - **Instant acknowledgement** β€” reacts with πŸ‘€ the moment it picks up your message - **Message it while it's running** β€” send follow-up messages mid-task and it'll pick them up before its next step - **Run multiple tasks in parallel** β€” each task runs in its own isolated cloud sandbox - **GitHub OAuth built-in** β€” authenticates with your GitHub account automatically - **Opens PRs automatically** β€” commits changes and opens a draft PR when done, linked back to your ticket - **Subagent support** β€” the agent can spawn child agents for parallel subtasks - **Web dashboard** β€” a companion app (in `ui/`) for GitHub login, per-user model/profile settings, team defaults, enabled-repo and review-style management, user mappings, and an Agents chat UI --- ## Getting Started - **[Installation Guide](INSTALLATION.md)** β€” local dev (backend + dashboard), GitHub App creation, LangSmith, Linear/Slack/GitHub triggers, and production deployment - **[Customization Guide](CUSTOMIZATION.md)** β€” swap the sandbox, model, tools, triggers, system prompt, and middleware for your org ## License MIT

AI Agents
9.9K Github Stars
deepagents
Open Source

deepagents

<div align="center"> <a href="https://docs.langchain.com/oss/python/deepagents/overview#deep-agents-overview"> <picture> <source media="(prefers-color-scheme: dark)" srcset=".github/images/logo-dark.svg"> <source media="(prefers-color-scheme: light)" srcset=".github/images/logo-light.svg"> <img alt="Deep Agents Logo" src=".github/images/logo-dark.svg" width="50%"> </picture> </a> </div> <div align="center"> <h3>The batteries-included agent harness.</h3> </div> <div align="center"> <a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/pypi/l/deepagents" alt="PyPI - License"></a> <a href="https://pypistats.org/packages/deepagents" target="_blank"><img src="https://img.shields.io/pepy/dt/deepagents" alt="PyPI - Downloads"></a> <a href="https://pypi.org/project/deepagents/#history" target="_blank"><img src="https://img.shields.io/pypi/v/deepagents?label=%20" alt="Version"></a> <a href="https://x.com/langchain_oss" target="_blank"><img src="https://img.shields.io/twitter/url/https/twitter.com/langchain_oss.svg?style=social&label=Follow%20%40LangChain" alt="Twitter / X"></a> </div> <br> Deep Agents is an open source agent harness β€” an opinionated agent that runs out of the box. Extend, override, or replace any piece. **Principles:** - **Opinionated** β€” defaults tuned for long-horizon, multi-step work - **Extensible** β€” override or replace any piece without forking - **Model-agnostic** β€” works with any LLM that supports tool calling: frontier, open-weight, or local - **Production-ready** β€” built on LangGraph (streaming, persistence, checkpointing) with first-class tracing, evaluation, and deployment via LangSmith **Features include:** - **Sub-agents** β€” delegate tasks to agents with isolated context windows - **Filesystem** β€” read, write, edit, or search over pluggable local, sandboxed, or remote backends - **Context management** β€” summarize long threads and offload tool outputs to disk - **Shell access** β€” run commands in your sandbox of choice - **Persistent memory** β€” pluggable state and store backends for cross-session recall - **Human-in-the-loop** β€” approve, edit, or reject tool calls before they run - **Skills** β€” reusable behaviors the agent can load on demand - **Tools** β€” bring your own functions or any MCP server > [!NOTE] > Deep Agents is available as a JavaScript/TypeScript library β€” see [deepagents.js](https://github.com/langchain-ai/deepagentsjs). ## Quickstart ```bash uv add deepagents ``` ```python from deepagents import create_deep_agent agent = create_deep_agent( model="openai:gpt-5.5", tools=[my_custom_tool], system_prompt="You are a research assistant.", ) result = agent.invoke({"messages": "Research LangGraph and write a summary"}) ``` The agent can plan, read/write files, and manage its own context. Add your own tools, swap models, customize prompts, configure sub-agents, and more. See the [documentation](https://docs.langchain.com/oss/python/deepagents/overview) for full details. > [!TIP] > For developing, debugging, and deploying AI agents and LLM applications, see [LangSmith](https://docs.langchain.com/langsmith/home). > [!NOTE] > **Deep Agents Code** β€” a pre-built coding agent in your terminal, similar to Claude Code or Cursor, powered by any LLM. Install with `curl -LsSf https://langch.in/dcode | bash`. See the [documentation](https://docs.langchain.com/deepagents-code) for the full feature set. ## FAQ ### How is this different from LangGraph or LangChain? LangGraph is the graph runtime. LangChain's `create_agent` is a minimal agent harness on top of it. Deep Agents is a more opinionated harness on top of `create_agent` β€” same building blocks, but with filesystem, sub-agents, context management, and skills bundled in. For how the three relate, see the [LangChain ecosystem overview](https://docs.langchain.com/oss/python/concepts/products). ### Does this work with open-weight or local models? Yes. Any model that supports tool calling works β€” frontier APIs (OpenAI, Anthropic, Google), open-weight models hosted on providers like Baseten or Fireworks, and self-hosted models via Ollama, vLLM, or llama.cpp. Use any [LangChain chat model](https://docs.langchain.com/oss/python/langchain/models). ### Can I use this in production? Yes! Deep Agents is built on LangGraph, designed for production agent deployments. Pair it with [LangSmith](https://docs.langchain.com/langsmith/home) for tracing, evaluation, and monitoring. See [Going to production](https://docs.langchain.com/oss/python/deepagents/going-to-production) for the full guide. ### When should I use Deep Agents vs. LangChain or LangGraph directly? All three are layers in the same stack β€” see the [LangChain ecosystem overview](https://docs.langchain.com/oss/python/concepts/products) for how they relate. Use **Deep Agents** when you want the full harness β€” planning, context management, delegation β€” out of the box. Use [**LangChain's `create_agent`**](https://docs.langchain.com/oss/python/langchain/agents) when you want a lighter harness without the bundled middleware. Drop to [**LangGraph**](https://docs.langchain.com/oss/python/langgraph/overview) when the agent loop itself isn't the right shape and you need a custom graph. The layers compose: any LangGraph `CompiledStateGraph` can be passed in as a sub-agent to a Deep Agent, so custom orchestration plugs in alongside the harness's defaults. --- ## Resources - [Examples](examples/) β€” working agents and patterns - [Documentation](https://docs.langchain.com/oss/python/deepagents/overview) β€” conceptual overviews and guides - [LangChain ecosystem overview](https://docs.langchain.com/oss/python/concepts/products) β€” how Deep Agents, LangChain, LangGraph, and LangSmith fit together - [API reference](https://reference.langchain.com/python/deepagents/) β€” complete reference for all public classes, functions, and types - [Discussions](https://forum.langchain.com/c/oss-product-help-lc-and-lg/deep-agents/18) β€” community forum for technical questions, ideas, and feedback - [Contributing Guide](https://docs.langchain.com/oss/python/contributing/overview) β€” how to contribute and find good first issues - [Code of Conduct](https://github.com/langchain-ai/langchain/?tab=coc-ov-file) β€” community guidelines and standards --- ## Acknowledgements Inspired by Claude Code: an attempt to identify what makes it general-purpose, and push that further. ## Security Deep Agents follows a "trust the LLM" model. The agent can do anything its tools allow. Enforce boundaries at the tool/sandbox level, not by expecting the model to self-police. See the [security policy](https://github.com/langchain-ai/deepagents?tab=security-ov-file) for more information.

AI & Machine Learning AI Agents
24.3K Github Stars
langchain-mcp-adapters
Open Source

langchain-mcp-adapters

# LangChain MCP Adapters This library provides a lightweight wrapper that makes [Anthropic Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) tools compatible with [LangChain](https://github.com/langchain-ai/langchain) and [LangGraph](https://github.com/langchain-ai/langgraph). ![MCP](static/img/mcp.png) > [!note] > A JavaScript/TypeScript version of this library is also available at [langchainjs](https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-mcp-adapters/). ## Features - πŸ› οΈ Convert MCP tools into [LangChain tools](https://python.langchain.com/docs/concepts/tools/) that can be used with [LangGraph](https://github.com/langchain-ai/langgraph) agents - πŸ“¦ A client implementation that allows you to connect to multiple MCP servers and load tools from them ## Installation ```bash pip install langchain-mcp-adapters ``` ## Quickstart Here is a simple example of using the MCP tools with a LangGraph agent. ```bash pip install langchain-mcp-adapters langgraph "langchain[openai]" export OPENAI_API_KEY=<your_api_key> ``` ### Server First, let's create an MCP server that can add and multiply numbers. ```python # math_server.py from mcp.server.fastmcp import FastMCP mcp = FastMCP("Math") @mcp.tool() def add(a: int, b: int) -> int: """Add two numbers""" return a + b @mcp.tool() def multiply(a: int, b: int) -> int: """Multiply two numbers""" return a * b if __name__ == "__main__": mcp.run(transport="stdio") ``` ### Client ```python # Create server parameters for stdio connection from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client from langchain_mcp_adapters.tools import load_mcp_tools from langchain.agents import create_agent server_params = StdioServerParameters( command="python", # Make sure to update to the full absolute path to your math_server.py file args=["/path/to/math_server.py"], ) async with stdio_client(server_params) as (read, write): async with ClientSession(read, write) as session: # Initialize the connection await session.initialize() # Get tools tools = await load_mcp_tools(session) # Create and run the agent agent = create_agent("openai:gpt-4.1", tools) agent_response = await agent.ainvoke({"messages": "what's (3 + 5) x 12?"}) ``` ## Multiple MCP Servers The library also allows you to connect to multiple MCP servers and load tools from them: ### Server ```python # math_server.py ... # weather_server.py from typing import List from mcp.server.fastmcp import FastMCP mcp = FastMCP("Weather") @mcp.tool() async def get_weather(location: str) -> str: """Get weather for location.""" return "It's always sunny in New York" if __name__ == "__main__": mcp.run(transport="http") ``` ```bash python weather_server.py ``` ### Client ```python from langchain_mcp_adapters.client import MultiServerMCPClient from langchain.agents import create_agent client = MultiServerMCPClient( { "math": { "command": "python", # Make sure to update to the full absolute path to your math_server.py file "args": ["/path/to/math_server.py"], "transport": "stdio", }, "weather": { # Make sure you start your weather server on port 8000 "url": "http://localhost:8000/mcp", "transport": "http", } } ) tools = await client.get_tools() agent = create_agent("openai:gpt-4.1", tools) math_response = await agent.ainvoke({"messages": "what's (3 + 5) x 12?"}) weather_response = await agent.ainvoke({"messages": "what is the weather in nyc?"}) ``` > [!note] > Example above will start a new MCP `ClientSession` for each tool invocation. If you would like to explicitly start a session for a given server, you can do: > > ```python > from langchain_mcp_adapters.tools import load_mcp_tools > > client = MultiServerMCPClient({...}) > async with client.session("math") as session: > tools = await load_mcp_tools(session) > ``` ## Streamable HTTP MCP now supports [streamable HTTP](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) transport. To start an [example](examples/servers/streamable-http-stateless/) streamable HTTP server, run the following: ```bash cd examples/servers/streamable-http-stateless/ uv run mcp-simple-streamablehttp-stateless --port 3000 ``` Alternatively, you can use FastMCP directly (as in the examples above). To use it with Python MCP SDK `streamablehttp_client`: ```python # Use server from examples/servers/streamable-http-stateless/ from mcp import ClientSession from mcp.client.streamable_http import streamablehttp_client from langchain.agents import create_agent from langchain_mcp_adapters.tools import load_mcp_tools async with streamablehttp_client("http://localhost:3000/mcp") as (read, write, _): async with ClientSession(read, write) as session: # Initialize the connection await session.initialize() # Get tools tools = await load_mcp_tools(session) agent = create_agent("openai:gpt-4.1", tools) math_response = await agent.ainvoke({"messages": "what's (3 + 5) x 12?"}) ``` Use it with `MultiServerMCPClient`: ```python # Use server from examples/servers/streamable-http-stateless/ from langchain_mcp_adapters.client import MultiServerMCPClient from langchain.agents import create_agent client = MultiServerMCPClient( { "math": { "transport": "http", "url": "http://localhost:3000/mcp" }, } ) tools = await client.get_tools() agent = create_agent("openai:gpt-4.1", tools) math_response = await agent.ainvoke({"messages": "what's (3 + 5) x 12?"}) ``` ## Passing runtime headers When connecting to MCP servers, you can include custom headers (e.g., for authentication or tracing) using the `headers` field in the connection configuration. This is supported for the following transports: - `sse` - `http` (or `streamable_http`) ### Example: passing headers with `MultiServerMCPClient` ```python from langchain_mcp_adapters.client import MultiServerMCPClient from langchain.agents import create_agent client = MultiServerMCPClient( { "weather": { "transport": "http", "url": "http://localhost:8000/mcp", "headers": { "Authorization": "Bearer YOUR_TOKEN", "X-Custom-Header": "custom-value" }, } } ) tools = await client.get_tools() agent = create_agent("openai:gpt-4.1", tools) response = await agent.ainvoke({"messages": "what is the weather in nyc?"}) ``` > Only `sse` and `http` transports support runtime headers. These headers are passed with every HTTP request to the MCP server. ## Tool error handling MCP distinguishes a tool *execution* error (`CallToolResult(isError=True)`, e.g. "project not found") from a protocol/transport failure. By default, an execution error is returned to the model as a `ToolMessage` with `status="error"`, so the agent can see what went wrong and self-correct instead of the run crashing: ```python client = MultiServerMCPClient({...}) tools = await client.get_tools() # handle_tool_errors=True by default ``` To restore the legacy behavior β€” raising a `ToolException` on execution errors β€” set `handle_tool_errors=False`: ```python client = MultiServerMCPClient({...}, handle_tool_errors=False) # or, at the tool-loading level: tools = await load_mcp_tools(session, handle_tool_errors=False) ``` > The error's content blocks are preserved verbatim on the `ToolMessage`. The one exception: if the MCP error has no content at all, a minimal placeholder text block is substituted so the tool message isn't empty (a fragile shape for some model providers) β€” this placeholder is adapter-generated, not server-provided error detail. > > Transport/session failures and content-conversion errors (e.g. unsupported audio content) always raise regardless of this setting; only MCP execution errors (`isError=True`) are governed by it. ## Using with LangGraph StateGraph ```python from langchain_mcp_adapters.client import MultiServerMCPClient from langgraph.graph import StateGraph, MessagesState, START from langgraph.prebuilt import ToolNode, tools_condition from langchain.chat_models import init_chat_model model = init_chat_model("openai:gpt-4.1") client = MultiServerMCPClient( { "math": { "command": "python", # Make sure to update to the full absolute path to your math_server.py file "args": ["./examples/math_server.py"], "transport": "stdio", }, "weather": { # make sure you start your weather server on port 8000 "url": "http://localhost:8000/mcp", "transport": "http", } } ) tools = await client.get_tools() def call_model(state: MessagesState): response = model.bind_tools(tools).invoke(state["messages"]) return {"messages": response} builder = StateGraph(MessagesState) builder.add_node(call_model) builder.add_node(ToolNode(tools)) builder.add_edge(START, "call_model") builder.add_conditional_edges( "call_model", tools_condition, ) builder.add_edge("tools", "call_model") graph = builder.compile() math_response = await graph.ainvoke({"messages": "what's (3 + 5) x 12?"}) weather_response = await graph.ainvoke({"messages": "what is the weather in nyc?"}) ``` ## Using with LangGraph API Server > [!TIP] > Check out [this guide](https://langchain-ai.github.io/langgraph/tutorials/langgraph-platform/local-server/) on getting started with LangGraph API server. If you want to run a LangGraph agent that uses MCP tools in a LangGraph API server, you can use the following setup: ```python # graph.py from contextlib import asynccontextmanager from langchain_mcp_adapters.client import MultiServerMCPClient from langchain.agents import create_agent async def make_graph(): client = MultiServerMCPClient( { "weather": { # make sure you start your weather server on port 8000 "url": "http://localhost:8000/mcp", "transport": "http", }, # ATTENTION: MCP's stdio transport was designed primarily to support applications running on a user's machine. # Before using stdio in a web server context, evaluate whether there's a more appropriate solution. # For example, do you actually need MCP? or can you get away with a simple `@tool`? "math": { "command": "python", # Make sure to update to the full absolute path to your math_server.py file "args": ["/path/to/math_server.py"], "transport": "stdio", }, } ) tools = await client.get_tools() agent = create_agent("openai:gpt-4.1", tools) return agent ``` In your [`langgraph.json`](https://langchain-ai.github.io/langgraph/cloud/reference/cli/#configuration-file) make sure to specify `make_graph` as your graph entrypoint: ```json { "dependencies": ["."], "graphs": { "agent": "./graph.py:make_graph" } } ```

AI & Machine Learning AI Agents
3.6K Github Stars
deepagentsjs
Open Source

deepagentsjs

<div align="center"> <a href="https://docs.langchain.com/oss/javascript/deepagents/overview#deep-agents-overview"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/.github/images/logo-light.svg"> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/.github/images/logo-dark.svg"> <img alt="Deep Agents Logo" src="https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/.github/images/logo-light.svg" width="50%"> </picture> </a> </div> <div align="center"> <h3>The batteries-included agent harness.</h3> </div> <div align="center"> <a href="https://www.npmjs.com/package/deepagents"><img src="https://img.shields.io/npm/v/deepagents.svg" alt="npm version"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.0+-blue.svg" alt="TypeScript"></a> <a href="https://x.com/langchain_js" target="_blank"><img src="https://img.shields.io/twitter/url/https/twitter.com/langchain_js.svg?style=social&label=Follow%20%40LangChain_JS" alt="Twitter / X"></a> </div> <br> Deep Agents is an agent harness. An opinionated, ready-to-run agent out of the box. Instead of wiring prompts, tools, and context management yourself, you get a working agent immediately and customize what you need. **What's included:** - **Planning** β€” `write_todos` for task breakdown and progress tracking - **Filesystem** β€” `read_file`, `write_file`, `edit_file`, `ls`, `glob`, `grep` for working memory - **Sub-agents** β€” `task` for delegating work with isolated context windows - **Smart defaults** β€” built-in prompt and middleware that make these tools useful out of the box - **Context management** β€” file-based workflows to keep long tasks manageable > [!NOTE] > Looking for the Python package? See [langchain-ai/deepagents](https://github.com/langchain-ai/deepagents). ## Quickstart ```bash npm install deepagents # or pnpm add deepagents # or yarn add deepagents ``` ```typescript import { createDeepAgent } from "deepagents"; const agent = createDeepAgent(); const result = await agent.invoke({ messages: [ { role: "user", content: "Research LangGraph and write a summary in summary.md", }, ], }); ``` The agent can plan, read/write files, and manage longer tasks with sub-agents and filesystem tools. > [!TIP] > For developing, debugging, and deploying AI agents and LLM applications, see [LangSmith](https://docs.langchain.com/langsmith/home). ## Runtime Entrypoints `deepagents` now publishes environment-specific entrypoints: - `deepagents` - default Node.js/server entrypoint with the full API. - `deepagents/browser` - recommended browser entrypoint (no Node-only exports). - `deepagents/node` - optional explicit Node.js entrypoint (same full API as `deepagents`). ```typescript // Browser-safe usage import { createDeepAgent, StateBackend } from "deepagents/browser"; // Node.js usage (recommended) import { createDeepAgent, FilesystemBackend } from "deepagents"; // Optional explicit Node.js usage // import { createDeepAgent, FilesystemBackend } from "deepagents/node"; ``` ## Customization Add tools, swap models, and customize prompts as needed: ```typescript import { ChatOpenAI } from "@langchain/openai"; import { createDeepAgent } from "deepagents"; const agent = createDeepAgent({ model: new ChatOpenAI({ model: "gpt-5", temperature: 0 }), tools: [myCustomTool], systemPrompt: "You are a research assistant.", }); ``` See the [JavaScript Deep Agents docs](https://docs.langchain.com/oss/javascript/deepagents/overview) for full configuration options. ## LangGraph Native `createDeepAgent` returns a compiled [LangGraph](https://docs.langchain.com/oss/javascript/langgraph/overview) graph, so you can use streaming, Studio, checkpointers, and other LangGraph features. ## Why Use It - **100% open source** β€” MIT licensed and extensible - **Provider agnostic** β€” works with tool-calling chat models - **Built on LangGraph** β€” production runtime with streaming and persistence - **Batteries included** β€” planning, file access, sub-agents, and defaults out of the box - **Fast to start** β€” install and run with sensible defaults - **Easy to customize** β€” add tools/models/prompts when you need to --- ## Documentation - [docs.langchain.com](https://docs.langchain.com/oss/javascript/deepagents/overview) - Concepts and guides - [Examples](/examples) - Working agents and patterns - [LangChain Forum](https://forum.langchain.com) - Community discussion and support ## Security Deep Agents follows a "trust the LLM" model. The agent can do anything its tools allow. Enforce boundaries at the tool/sandbox level, not by expecting the model to self-police. See the [security policy](https://github.com/langchain-ai/deepagentsjs?tab=security-ov-file) for more information.

AI Tools AI Agents
1.3K Github Stars
langchain-google
Open Source

langchain-google

# πŸ¦œοΈπŸ”— LangChain Google This repository centralizes Google integrations for [LangChain](https://github.com/langchain-ai/langchain) projects. ## Packages - [`langchain-google-genai`](https://pypi.org/project/langchain-google-genai/) implements integrations of Google [Generative AI](https://ai.google.dev/) (Gemini API) models. - [`langchain-google-vertexai`](https://pypi.org/project/langchain-google-vertexai/) implements integrations of Google Cloud [Generative AI on Vertex AI](https://cloud.google.com/vertex-ai/docs/generative-ai/learn/overview) - [`langchain-google-community`](https://pypi.org/project/langchain-google-community/) implements integrations for Google products that are not part of the above two packages See the [Google provider page](https://docs.langchain.com/oss/python/integrations/providers/google) in the LangChain Docs for more details. ## πŸ“– Documentation For full documentation, see the [API reference](https://reference.langchain.com/python/integrations/langchain_google/). For conceptual guides, tutorials, and examples on using these classes, see the [LangChain Google Docs](https://docs.langchain.com/oss/python/integrations/providers/google). > [!TIP] > For developing, debugging, and deploying AI agents and LLM applications, see [LangSmith](https://docs.langchain.com/langsmith/home). ## πŸ“• Releases & Versioning See our [Releases](https://docs.langchain.com/oss/python/release-policy) and [Versioning](https://docs.langchain.com/oss/python/versioning) policies. ## πŸ’ Contributing As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation. For detailed information on how to contribute, see the [Contributing Guide](https://docs.langchain.com/oss/python/contributing/overview). For contributing to this specific package, see the [`langchain-google` Contributing Guide](./CONTRIBUTING.md).

JavaScript Libraries & Components AI Tools
385 Github Stars
langchain-aws
Open Source

langchain-aws

# πŸ¦œοΈπŸ”— LangChain 🀝 Amazon Web Services (AWS) This monorepo provides LangChain and LangGraph components for various AWS services. It aims to replace and expand upon the existing LangChain AWS components found in the `langchain-community` package in the LangChain repository. The following packages are hosted in this repository: - `langchain-aws` ([PyPI](https://pypi.org/project/langchain-aws/)) - `langgraph-checkpoint-aws` ([PyPI](https://pypi.org/project/langgraph-checkpoint-aws/)) - `langchain-agentcore-codeinterpreter` ([PyPI](https://pypi.org/project/langchain-agentcore-codeinterpreter/)) ## Features ### LangChain - **LLMs**: Includes LLM classes for AWS services like [Bedrock](https://aws.amazon.com/bedrock) and [SageMaker Endpoints](https://aws.amazon.com/sagemaker/deploy/), allowing you to leverage their language models within LangChain. - **VectorStores**: Supports vectorstores for services like [Amazon MemoryDB](https://aws.amazon.com/memorydb/), [Amazon S3 Vectors](https://aws.amazon.com/s3/features/vectors/), and [AWS ElastiCache for Valkey](https://aws.amazon.com/elasticache/), providing efficient and scalable vector database for your applications. - **Retrievers**: Supports retrievers for services like [Amazon Kendra](https://aws.amazon.com/kendra/) and [KnowledgeBases for Amazon Bedrock](https://aws.amazon.com/bedrock/knowledge-bases/), enabling efficient retrieval of relevant information in your RAG applications. - **Graphs**: Provides components for working with [AWS Neptune](https://aws.amazon.com/neptune/) graphs within LangChain. - **Agents**: Includes Runnables to support [Amazon Bedrock Agents](https://aws.amazon.com/bedrock/agents/), allowing you to leverage Bedrock Agents within LangChain and LangGraph. - **Tools**: Includes tools and toolkits to enable use of [Amazon Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/)'s built-in tools with LangChain and LangGraph agents. ### LangGraph - **Checkpointers**: Provides custom checkpointing solutions for LangGraph agents using several AWS services, including [Bedrock AgentCore Memory](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html), [Bedrock Session Management](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html), [DynamoDB](https://aws.amazon.com/dynamodb/), and [ElastiCache Valkey](https://aws.amazon.com/elasticache/). - **Memory Stores** - Provides memory store solutions for saving, processing, and retrieving intelligent long term memories using services like [Bedrock AgentCore Memory](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html) and [ElastiCache Valkey](https://aws.amazon.com/elasticache/). ### Deep Agents - **Sandboxes**: Provides an [Amazon Bedrock AgentCore](https://aws.amazon.com/bedrock/agentcore/) Code Interpreter sandbox backend for [Deep Agents](https://github.com/langchain-ai/deepagents), enabling secure code execution in isolated MicroVM environments. ...and more to come. This repository will continue to expand and offer additional components for various AWS services as development progresses. **Note**: This repository will replace all AWS integrations currently present in the `langchain-community` package. Users are encouraged to migrate to this repository as soon as possible. ## Installation You can install the `langchain-aws` package from PyPI. ```bash pip install langchain-aws ``` The `langgraph-checkpoint-aws` package can also be installed from PyPI. ```bash pip install langgraph-checkpoint-aws ``` The `langchain-agentcore-codeinterpreter` package can also be installed from PyPI. ```bash pip install langchain-agentcore-codeinterpreter ``` ## Usage ### `langchain-aws` Here's a simple example of how to use the `langchain-aws` package. ```python from langchain_aws import ChatBedrockConverse # Initialize the Bedrock chat model model = ChatBedrockConverse( model="us.anthropic.claude-sonnet-4-5-20250929-v1:0" ) # Invoke the model response = model.invoke("Hello! How are you today?") print(response) ``` ### AgentCore Tools ```python from langchain_aws.tools import create_browser_toolkit, create_code_interpreter_toolkit # Browser automation browser_toolkit, browser_tools = create_browser_toolkit(region="us-west-2") # Code execution (async) code_toolkit, code_tools = await create_code_interpreter_toolkit(region="us-west-2") # Use with LangGraph agent agent = create_react_agent(model, tools=browser_tools + code_tools) result = await agent.ainvoke( {"messages": [{"role": "user", "content": "Navigate to example.com"}]}, config={"configurable": {"thread_id": "session-1"}} ) # Cleanup await browser_toolkit.cleanup() await code_toolkit.cleanup() ``` For more detailed usage examples and documentation, please refer to the [LangChain docs](https://python.langchain.com/docs/integrations/platforms/aws/). > [!TIP] > For developing, debugging, and deploying AI agents and LLM applications, see [LangSmith](https://docs.langchain.com/langsmith/home). ### `langgraph-checkpoint-aws` You can find usage examples for `langgraph-checkpoint-aws` [in the README](https://github.com/langchain-ai/langchain-aws/blob/main/libs/langgraph-checkpoint-aws/README.md). ### `langchain-agentcore-codeinterpreter` ```python from bedrock_agentcore.tools.code_interpreter_client import CodeInterpreter from langchain_agentcore_codeinterpreter import AgentCoreSandbox interpreter = CodeInterpreter(region="us-west-2") interpreter.start() backend = AgentCoreSandbox(interpreter=interpreter) result = backend.execute("echo hello") print(result.output) # hello interpreter.stop() ``` ## Contributing We welcome contributions to this repository! To get started, please follow the [Contributing Guide](https://github.com/langchain-ai/langchain-aws/blob/main/.github/CONTRIBUTING.md). This guide provides detailed instructions on how to set up each project for development and guidance on how to contribute effectively. ## License This project is licensed under the [MIT License](LICENSE).

DevOps & Infrastructure ML Frameworks
327 Github Stars
langchain-postgres
Open Source

langchain-postgres

# langchain-postgres [![Release Notes](https://img.shields.io/github/release/langchain-ai/langchain-postgres)](https://github.com/langchain-ai/langchain-postgres/releases) [![CI](https://github.com/langchain-ai/langchain-postgres/actions/workflows/ci.yml/badge.svg)](https://github.com/langchain-ai/langchain-postgres/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40LangChainAI)](https://twitter.com/langchainai) [![](https://dcbadge.vercel.app/api/server/6adMQxSpJS?compact=true&style=flat)](https://discord.gg/6adMQxSpJS) [![Open Issues](https://img.shields.io/github/issues-raw/langchain-ai/langchain-postgres)](https://github.com/langchain-ai/langchain-postgres/issues) The `langchain-postgres` package implementations of core LangChain abstractions using `Postgres`. The package is released under the MIT license. Feel free to use the abstraction as provided or else modify them / extend them as appropriate for your own application. ## Requirements The package supports the [asyncpg](https://github.com/MagicStack/asyncpg) and [psycopg3](https://www.psycopg.org/psycopg3/) drivers. ## Installation ```bash pip install -U langchain-postgres ``` ## Vectorstore > [!WARNING] > In v0.0.14+, `PGVector` is deprecated. Please migrate to `PGVectorStore` > for improved performance and manageability. > See the [migration guide](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/migrate_pgvector_to_pgvectorstore.ipynb) for details on how to migrate from `PGVector` to `PGVectorStore`. ### Documentation * [Quickstart](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/pg_vectorstore.ipynb) * [How-to](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/pg_vectorstore_how_to.ipynb) > [!TIP] > For developing, debugging, and deploying AI agents and LLM applications, see [LangSmith](https://docs.langchain.com/langsmith/home). ### Example ```python from langchain_core.documents import Document from langchain_core.embeddings import DeterministicFakeEmbedding from langchain_postgres import PGEngine, PGVectorStore # Replace the connection string with your own Postgres connection string CONNECTION_STRING = "postgresql+psycopg://langchain:langchain@localhost:6024/langchain" engine = PGEngine.from_connection_string(url=CONNECTION_STRING) # Replace the vector size with your own vector size VECTOR_SIZE = 768 embedding = DeterministicFakeEmbedding(size=VECTOR_SIZE) TABLE_NAME = "my_doc_collection" engine.init_vectorstore_table( table_name=TABLE_NAME, vector_size=VECTOR_SIZE, ) store = PGVectorStore.create_sync( engine=engine, table_name=TABLE_NAME, embedding_service=embedding, ) docs = [ Document(page_content="Apples and oranges"), Document(page_content="Cars and airplanes"), Document(page_content="Train") ] store.add_documents(docs) query = "I'd like a fruit." docs = store.similarity_search(query) print(docs) ``` > [!TIP] > All synchronous functions have corresponding asynchronous functions ### Hybrid Search with PGVectorStore With PGVectorStore you can use hybrid search for more comprehensive and relevant search results. ```python vs = PGVectorStore.create_sync( engine=engine, table_name=TABLE_NAME, embedding_service=embedding, hybrid_search_config=HybridSearchConfig( fusion_function=reciprocal_rank_fusion ), ) hybrid_docs = vector_store.similarity_search("products", k=5) ``` For a detailed guide on how to use hybrid search, see the [documentation](/examples/pg_vectorstore_how_to.ipynb#hybrid-search-with-pgvectorstore ). ## ChatMessageHistory The chat message history abstraction helps to persist chat message history in a postgres table. PostgresChatMessageHistory is parameterized using a `table_name` and a `session_id`. The `table_name` is the name of the table in the database where the chat messages will be stored. The `session_id` is a unique identifier for the chat session. It can be assigned by the caller using `uuid.uuid4()`. ```python import uuid from langchain_core.messages import SystemMessage, AIMessage, HumanMessage from langchain_postgres import PostgresChatMessageHistory import psycopg # Establish a synchronous connection to the database # (or use psycopg.AsyncConnection for async) conn_info = ... # Fill in with your connection info sync_connection = psycopg.connect(conn_info) # Create the table schema (only needs to be done once) table_name = "chat_history" PostgresChatMessageHistory.create_tables(sync_connection, table_name) session_id = str(uuid.uuid4()) # Initialize the chat history manager chat_history = PostgresChatMessageHistory( table_name, session_id, sync_connection=sync_connection ) # Add messages to the chat history chat_history.add_messages([ SystemMessage(content="Meow"), AIMessage(content="woof"), HumanMessage(content="bark"), ]) print(chat_history.messages) ``` ## Google Cloud Integrations [Google Cloud](https://python.langchain.com/docs/integrations/providers/google/) provides Vector Store, Chat Message History, and Data Loader integrations for [AlloyDB](https://cloud.google.com/alloydb) and [Cloud SQL](https://cloud.google.com/sql) for PostgreSQL databases via the following PyPi packages: * [`langchain-google-alloydb-pg`](https://github.com/googleapis/langchain-google-alloydb-pg-python) * [`langchain-google-cloud-sql-pg`](https://github.com/googleapis/langchain-google-cloud-sql-pg-python) Using the Google Cloud integrations provides the following benefits: - **Enhanced Security**: Securely connect to Google Cloud databases utilizing IAM for authorization and database authentication without needing to manage SSL certificates, configure firewall rules, or enable authorized networks. - **Simplified and Secure Connections:** Connect to Google Cloud databases effortlessly using the instance name instead of complex connection strings. The integrations creates a secure connection pool that can be easily shared across your application using the `engine` object. | Vector Store | Metadata filtering | Async support | Schema Flexibility | Improved metadata handling | Hybrid Search | |--------------------------|--------------------|----------------|--------------------|----------------------------|---------------| | Google AlloyDB | βœ“ | βœ“ | βœ“ | βœ“ | βœ— | | Google Cloud SQL Postgres| βœ“ | βœ“ | βœ“ | βœ“ | βœ— |

ML Frameworks NoSQL Databases
277 Github Stars
langsmith-docs
Open Source

langsmith-docs

> [!WARNING] > This repo is deprecated. To edit LangSmith documentation, please go to the [`langchain-ai/docs`](https://github.com/langchain-ai/docs) repo.

Documentation Testing & QA
170 Github Stars