wishborn/alt-php-cognee-sdk

PHP SDK for Cognee - AI Memory Platform (Cognee v0.5.1+ compatible)

Installs: 6

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/wishborn/alt-php-cognee-sdk

v0.1.0 2026-01-16 18:13 UTC

This package is auto-updated.

Last update: 2026-01-16 18:19:09 UTC


README

Latest Version on Packagist License

A PHP SDK for Cognee - the AI Memory Platform. This package is compatible with Cognee v0.5.1+.

Note: This is an independently maintained alternative to mikewolfxyou/php-cognee-sdk, updated for Cognee v0.5.1 API compatibility. Once the upstream package is updated, we recommend switching back to it.

Requirements

  • PHP 8.2 or higher
  • A running Cognee instance (v0.5.1+)

Installation

composer require wishborn/alt-php-cognee-sdk

Quick Start

use Cognee\Client;
use Cognee\Config;
use Cognee\Requests\SearchRequest;
use Cognee\Enums\SearchType;

// Create a client
$config = new Config(
    baseUrl: 'http://localhost:8000',
    apiKey: 'your-api-key',
);

$client = new Client($config);

// Check health
$health = $client->health()->check();

// Create a dataset
$dataset = $client->datasets()->create('my-dataset');

// Search the knowledge graph
$results = $client->search()->search(new SearchRequest(
    query: 'your search query',
    searchType: SearchType::CHUNKS,
));

Available Search Types

The SDK supports all Cognee v0.5.1 search types:

  • SearchType::SUMMARIES
  • SearchType::CHUNKS (default)
  • SearchType::CHUNKS_LEXICAL
  • SearchType::RAG_COMPLETION
  • SearchType::TRIPLET_COMPLETION
  • SearchType::GRAPH_COMPLETION
  • SearchType::GRAPH_SUMMARY_COMPLETION
  • SearchType::CYPHER
  • SearchType::NATURAL_LANGUAGE
  • SearchType::GRAPH_COMPLETION_COT
  • SearchType::GRAPH_COMPLETION_CONTEXT_EXTENSION
  • SearchType::FEELING_LUCKY
  • SearchType::FEEDBACK
  • SearchType::TEMPORAL
  • SearchType::CODING_RULES

Available Resources

Datasets

$client->datasets()->create($name, $metadata);  // Create dataset
$client->datasets()->list();                     // List all datasets
$client->datasets()->get($id);                   // Get specific dataset
$client->datasets()->delete($id);                // Delete dataset
$client->datasets()->add($request);              // Add data to dataset
$client->datasets()->cognify($request);          // Process into knowledge graph
$client->datasets()->getGraph($id);              // Get dataset graph
$client->datasets()->getStatus($id);             // Get processing status

Search

$client->search()->search($request);  // Search knowledge graph
$client->search()->history();         // Get search history

Health

$client->health()->check();     // Basic health check
$client->health()->detailed();  // Detailed health check

Auth & Permissions

$client->auth()->login($email, $password);
$client->permissions()->list();

Testing

composer test

Changelog

v0.1.0

  • Initial release with Cognee v0.5.1 API compatibility
  • Updated SearchType enum with all supported values
  • Default search type set to CHUNKS

Credits

License

The MIT License (MIT). Please see License File for more information.