定制 lochmueller/seal-ai 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lochmueller/seal-ai

Composer 安装命令:

composer require lochmueller/seal-ai

包简介

SEAL Search AI - Vector based search based on EXT:seal

README 文档

README

AI Vector search integration for EXT:seal based on symfony/ai.

Enables semantic (vector-based) search in TYPO3 by bridging the SEAL search abstraction with the Symfony AI platform and store components. Documents are automatically vectorized via configurable embedding models and stored in a vector database of your choice.

This extension was funded by the TYPO3 Association: community ideas I / community idea II & first blogpost / second blogpost

Requirements

Installation

composer require lochmueller/seal-ai

Additionally, install the symfony/ai packages for your chosen platform and store (see Supported Platforms and Supported Stores).

Configuration

  1. Set the SEAL search adapter to ai:// in your site configuration.
  2. Configure the two DSN fields added to the TYPO3 site configuration module:
    • AI Platform DSN (sealAiPlatformDsn) — connection to the embedding/AI provider
    • AI Store DSN (sealAiStoreDsn) — connection to the vector store

The platform DSN must include a model query parameter specifying the embedding model:

openai://YOUR_API_KEY@default?model=text-embedding-3-small

DSN Format

scheme://user@host:port?param1=value1&param2=value2
  • scheme — provider identifier (e.g. openai, qdrant)
  • user — API key (where applicable)
  • host / port — server address
  • Query parameters — provider-specific options

Supported Platforms

Each platform requires its own composer package. Install only what you need.

Scheme Package Example DSN
openai symfony/ai-open-ai-platform openai://api-key@default?model=text-embedding-3-small
anthropic symfony/ai-anthropic-platform anthropic://api-key@default
gemini symfony/ai-gemini-platform gemini://api-key@default
openrouter symfony/ai-open-router-platform openrouter://api-key@default?model=gemini-embedding-001
vertex symfony/ai-vertex-ai-platform vertex://location/project-id?api_key=key
bedrock symfony/ai-bedrock-platform bedrock://default
mistral symfony/ai-mistral-platform mistral://api-key@default
ollama symfony/ai-ollama-platform ollama://localhost:11434
huggingface symfony/ai-hugging-face-platform huggingface://api-key@default?provider=hf_inference
replicate symfony/ai-replicate-platform replicate://api-key@default
lmstudio symfony/ai-lm-studio-platform lmstudio://localhost:1234
deepseek symfony/ai-deep-seek-platform deepseek://api-key@default
voyage symfony/ai-voyage-platform voyage://api-key@default
albert symfony/ai-albert-platform albert://api-key@host
cartesia symfony/ai-cartesia-platform cartesia://api-key@default?version=v1
elevenlabs symfony/ai-eleven-labs-platform elevenlabs://api-key@host
perplexity symfony/ai-perplexity-platform perplexity://api-key@default
scaleway symfony/ai-scaleway-platform scaleway://api-key@default
cerebras symfony/ai-cerebras-platform cerebras://api-key@default
decart symfony/ai-decart-platform decart://api-key@host
aimlapi symfony/ai-ai-ml-api-platform aimlapi://api-key@host
docker symfony/ai-docker-model-runner-platform docker://localhost:12434
transformers symfony/ai-transformers-php-platform transformers://
generic symfony/ai-generic-platform generic://host?api_key=key
azure-openai symfony/ai-azure-platform azure-openai://api-key@host?deployment=dep&api_version=ver
azure-meta symfony/ai-azure-platform azure-meta://api-key@host

Supported Stores

Scheme Package Example DSN
mariadb symfony/ai-maria-db-store mariadb://default?tableName=my_table
postgres symfony/ai-postgres-store postgres://default?tableName=my_table
qdrant symfony/ai-qdrant-store qdrant://api-key@host:6333?collectionName=col
elasticsearch symfony/ai-elasticsearch-store elasticsearch://host:9200?indexName=idx
opensearch symfony/ai-open-search-store opensearch://host:9200?indexName=idx
meilisearch symfony/ai-meilisearch-store meilisearch://api-key@host:7700?indexName=idx
milvus symfony/ai-milvus-store milvus://api-key@host:19530?database=db&collection=col
redis symfony/ai-redis-store redis://host:6379?indexName=idx
weaviate symfony/ai-weaviate-store weaviate://api-key@host:8080?collection=col
typesense symfony/ai-typesense-store typesense://api-key@host:8108?collection=col
neo4j symfony/ai-neo4j-store neo4j://user:pass@host:7474?databaseName=neo4j&vectorIndexName=idx
cloudflare symfony/ai-cloudflare-store cloudflare://api-key@default?accountId=acc&index=idx
pinecone symfony/ai-pinecone-store pinecone://api-key@default?indexName=idx
mongodb symfony/ai-mongo-db-store mongodb://host:27017?databaseName=db&collectionName=col&indexName=idx
surrealdb symfony/ai-surreal-db-store surrealdb://user:pass@host:8000?namespace=ns&database=db
manticore symfony/ai-manticore-search-store manticore://host:9308?table=tbl
clickhouse symfony/ai-click-house-store clickhouse://host:8123?databaseName=db&tableName=tbl
vektor symfony/ai-vektor-store vektor://default/path?dimensions=1536

For mariadb and postgres stores, the extension reuses the existing TYPO3 database connection automatically.

Extending via Events

Both factories support the event:// DSN scheme, allowing you to provide custom platform or store implementations via PSR-14 event listeners.

  • Lochmueller\SealAi\Event\PlatformFactoryEvent — dispatched for event:// platform DSN
  • Lochmueller\SealAi\Event\StoreFactoryEvent — dispatched for event:// store DSN

Example event listener:

use Lochmueller\SealAi\Event\PlatformFactoryEvent;

final class CustomPlatformListener
{
    public function __invoke(PlatformFactoryEvent $event): void
    {
        $dsn = $event->getDsn();
        // Build your custom platform...
        $event->setPlatform($myCustomPlatform);
    }
}

Architecture

Structure overview

The extension implements the CmsIg\Seal\Adapter\AdapterInterface with these components:

  • AiAdapterFactory — registered as SEAL adapter factory for the ai:// scheme, initializes the bridge from the current site configuration
  • AiBridge — central service that holds the initialized platform, store, and vectorizer
  • AiSchemaManager — manages index creation/deletion in the vector store
  • AiIndexer — vectorizes documents and stores them; handles save, delete, and bulk operations
  • AiSearcher — performs semantic search by vectorizing the query and querying the store

Development

# Install dependencies
composer install

# Fix code style (PHP-CS-Fixer, PER-CS 3.0)
composer code-fix

# Static analysis (PHPStan level 8)
composer code-check

# Run unit tests
composer code-test

# Tests with coverage (requires Xdebug)
composer code-test-coverage

Comparing available symfony/ai packages

diff --color \
  <(grep -E 'symfony\/ai-[a-z0-9-]+-(store|platform)' composer.json) \
  <(curl -s https://raw.githubusercontent.com/symfony/ai-bundle/refs/heads/main/composer.json \
  | sed -nE '/"symfony\/ai-[a-z0-9-]+-(store|platform)":/s/^    //p')

Updating available symfony/ai packages

jq --argjson updates "$(curl -sL https://raw.githubusercontent.com/symfony/ai-bundle/main/composer.json | jq '."require-dev" | with_entries(select(.key | test("^symfony/ai-.*-(store|platform)$")))')" '."require-dev" |= ((. // {}) + $updates | to_entries | sort_by(.key) | from_entries)' composer.json | sponge composer.json

lochmueller/seal-ai 适用场景与选型建议

lochmueller/seal-ai 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 31 次下载、GitHub Stars 达 4, 最近一次更新时间为 2025 年 09 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「search」 「typo3」 「ai」 「seal」 「seal-adapter」 「search-client」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 lochmueller/seal-ai 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lochmueller/seal-ai 我们能提供哪些服务?
定制开发 / 二次开发

基于 lochmueller/seal-ai 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 31
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-09-02