PHPackages                             kambo/langchain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kambo/langchain

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kambo/langchain
===============

 ⚡ Building applications with LLMs through composability in PHP ⚡

0.2.0-alpha(3y ago)3224.9k↓76.7%36[7 issues](https://github.com/kambo-1st/langchain-php/issues)[1 PRs](https://github.com/kambo-1st/langchain-php/pulls)MITPHPPHP ^8.1

Since Apr 2Pushed 3y ago18 watchersCompare

[ Source](https://github.com/kambo-1st/langchain-php)[ Packagist](https://packagist.org/packages/kambo/langchain)[ Docs](https://github.com/kambo/langchain)[ GitHub Sponsors](https://github.com/kambo)[ RSS](/packages/kambo-langchain/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (7)Versions (7)Used By (0)

🐘🦜️🔗 PHP LangChain
==================

[](#️-php-langchain)

⚡ Building applications with LLMs through composability in PHP ⚡

[![Latest Version on Packagist](https://camo.githubusercontent.com/9e42890aa39900df4b0a8bee0f031fa515ab9614d8d9e6052f572c367389471b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b616d626f2f6c616e67636861696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kambo/langchain)[![Tests](https://camo.githubusercontent.com/758ce47e135e73cbd18c3edc11277c9efc5d2f548afe51063d26452e4dc130e3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b616d626f2d3173742f6c616e67636861696e2d7068702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kambo-1st/langchain-php/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/21a4783950eb9b614bcbf5dde696e4e253f04b3081b38be0e3d05738b575a9bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b616d626f2f6c616e67636861696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kambo/langchain)[![License: MIT](https://camo.githubusercontent.com/1b01ef0024ba0866c115986b895301f657c1b21fc29f05c4844b7f2e8d89204d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

The LangChain PHP Port is a meticulously crafted adaptation of the original [LangChain library](https://github.com/hwchase17/langchain), bringing its robust natural language processing capabilities to the PHP ecosystem. This faithful port allows developers to harness the full potential of LangChain's features, while preserving the familiar PHP syntax and structure.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require kambo/langchain
```

🤔 What is this?
---------------

[](#-what-is-this)

Large language models (LLMs) are emerging as a transformative technology, enabling developers to build applications that they previously could not. But using these LLMs in isolation is often not enough to create a truly powerful app - the real power comes when you can combine them with other sources of computation or knowledge.

This library is aimed at assisting in the development of those types of applications. Common examples of these types of applications include:

Work in progress
----------------

[](#work-in-progress)

This library is still in development. Use at your own risk!

### Supported features

[](#supported-features)

- Prompt formatting
- LLMs: OpenAI GPT-3, ChatGPT, llama.cpp
- Vector stores: Simple stupid vector store
- Texts splitters: CharacterTextSplitter, RecursiveCharacterTextSplitter
- Embeddings: OpenAI
- Document loaders: TextLoader

More to come!

### Documentation

[](#documentation)

- [PHP specific](docs/PHP/TOC.md)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

2

Last Release

1168d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1073586?v=4)[Øystein Kambo Tangerås](/maintainers/kambo)[@kambo](https://github.com/kambo)

---

Top Contributors

[![kambo-1st](https://avatars.githubusercontent.com/u/6493048?v=4)](https://github.com/kambo-1st "kambo-1st (14 commits)")[![nik-418](https://avatars.githubusercontent.com/u/6206742?v=4)](https://github.com/nik-418 "nik-418 (1 commits)")

---

Tags

langchainkambo

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/kambo-langchain/health.svg)

```
[![Health](https://phpackages.com/badges/kambo-langchain/health.svg)](https://phpackages.com/packages/kambo-langchain)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[illuminate/contracts

The Illuminate Contracts package.

706130.3M13.3k](/packages/illuminate-contracts)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k78.3k90](/packages/pocketmine-pocketmine-mp)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
