Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Larai Kit Laravel Package

laraigent/larai-kit

View on GitHub
Deep Wiki
Context7

Ingestion Pipeline

The ingestion pipeline converts files, text, and URLs into searchable vectors.

Entry Points

use LarAIgent\AiKit\Services\Ingestion\IngestionService;

$ingestion = app(IngestionService::class);

// Upload from request
$asset = $ingestion->ingestFile($request->file('document'), scope: ['chatbot_id' => 42]);

// Re-ingest file already stored on a Laravel disk
$asset = $ingestion->ingestFromDisk('public', 'knowledge/report.pdf', scope: ['chatbot_id' => 42]);

// Raw text
$asset = $ingestion->ingestText('Company policy text...', name: 'Policy', scope: ['chatbot_id' => 42]);

// URL (safety checks run immediately; fetch/parse/chunk runs in jobs)
$asset = $ingestion->ingestUrl('https://example.com/docs/faq', scope: ['chatbot_id' => 42]);

Processing Flow

All entry points now use queued jobs for heavy work:

queued -> parsing -> chunking -> embedding -> indexed
                                 \-> failed

Jobs involved:

  • ParseAssetJob for uploaded/disk files
  • ProcessTextAssetJob for raw text ingestion
  • FetchUrlAssetJob for URL fetch + content extraction
  • ChunkAssetJob for chunk creation
  • EmbedChunksJob for embedding + vector upsert

States

State Meaning
queued Accepted and waiting for queued processing
parsing Parsing/extraction stage (including URL fetch)
chunking Chunk creation in progress
embedding Embeddings + vector upsert in progress
indexed Successfully indexed and searchable
failed Terminal failure (error column contains details)

Events

Event Fires When Timing
IngestionStateChanged Every state transition Immediate
AssetIndexed Terminal success After commit when inside transaction
AssetFailed Terminal failure After commit when inside transaction

Use terminal events for business workflows that depend on committed domain writes:

use Illuminate\Support\Facades\Event;
use LarAIgent\AiKit\Events\AssetIndexed;

Event::listen(AssetIndexed::class, function ($event) {
    KnowledgeBase::where('ai_asset_id', $event->asset->id)->update([
        'status' => 'indexed',
        'chunk_count' => $event->ingestion->chunk_count,
        'indexed_at' => now(),
    ]);
});

Queue Notes

  • QUEUE_CONNECTION=sync still executes inline (Laravel default behavior).
  • For true async offload in production, use database, redis, etc. and run workers.
QUEUE_CONNECTION=database
php artisan queue:work

Supported File Types

Type MIME Parser
Text text/plain, text/markdown, text/csv Built-in
HTML text/html, application/xhtml+xml Built-in
PDF application/pdf smalot/pdfparser
DOCX application/vnd.openxmlformats-officedocument.wordprocessingml.document phpoffice/phpword
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle