PHPackages                             stanrevko/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. stanrevko/langchain

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

stanrevko/langchain
===================

 ⚡ Building applications with LLMs through composability in PHP ⚡

1.0.1(2y ago)115MITPHPPHP ^8.1

Since Jul 25Pushed 2y agoCompare

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

READMEChangelog (2)Dependencies (7)Versions (3)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 stanrevko/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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.7% 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 ~0 days

Total

2

Last Release

1027d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/85736098aa2966e4e318b26cd4618c33a4be599b28e3d883cd1cf3e5eaa761be?d=identicon)[stanrevko](/maintainers/stanrevko)

---

Top Contributors

[![kambo-1st](https://avatars.githubusercontent.com/u/6493048?v=4)](https://github.com/kambo-1st "kambo-1st (14 commits)")[![stanrevko](https://avatars.githubusercontent.com/u/4658969?v=4)](https://github.com/stanrevko "stanrevko (4 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/stanrevko-langchain/health.svg)

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

###  Alternatives

[kambo/langchain

 ⚡ Building applications with LLMs through composability in PHP ⚡

3224.4k](/packages/kambo-langchain)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k74.6k86](/packages/pocketmine-pocketmine-mp)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)[gehrisandro/tailwind-merge-php

TailwindMerge for PHP merges multiple Tailwind CSS classes by automatically resolving conflicts between them

1391.5M9](/packages/gehrisandro-tailwind-merge-php)[llm-agents/agents

LLM Agents PHP SDK - Autonomous Language Model Agents for PHP

16410.9k9](/packages/llm-agents-agents)[mfd/ai-filemetadata

Automatically generates FAL metadata for files by means of public LLMs

1142.1k](/packages/mfd-ai-filemetadata)

PHPackages © 2026

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