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

Ai Doctrine Message Store Laravel Package

symfony/ai-doctrine-message-store

Doctrine DBAL message store integration for Symfony AI Chat. Persist and retrieve chat messages in a relational database using Doctrine DBAL, enabling durable conversation history and easy storage configuration within Symfony applications.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • AI-Driven Conversational Features: Enables persistent storage of chat histories, user prompts, and AI responses in a relational database, critical for features like:
    • Multi-turn dialogues (e.g., customer support bots, internal knowledge assistants).
    • Audit trails for compliance (GDPR, HIPAA) or legal requirements.
    • Data retention policies (e.g., archiving old conversations).
  • Database-Centric AI Workflows: Ideal for Laravel apps where Doctrine DBAL is already used (e.g., legacy systems, microservices with shared DBs). Avoids vendor lock-in to Redis/NoSQL for structured data.
  • Build vs. Buy Tradeoff:
    • Buy: Leverages Symfony’s battle-tested DBAL integration and PSR-15 message store standard, reducing dev time.
    • Build Alternative: Custom Laravel message store would require schema design, migrations, and PSR-15 compliance—this package abstracts that.
  • Use Cases:
    • Enterprise Chatbots: Store agent-user interactions in PostgreSQL for analytics (e.g., sentiment analysis via SQL).
    • Regulated Industries: HIPAA-compliant patient-AI interactions in a controlled DB environment.
    • Hybrid AI Systems: Combine AI responses with existing CRM/ERP data via SQL joins.
  • Roadmap Enablers:
    • Scalable AI Features: Foundation for future upgrades like conversation summarization (via SQL window functions) or fine-tuning datasets.
    • Multi-Environment Sync: Ensures dev/stage/prod parity for AI chat behavior (e.g., testing prompts in staging with real data).

When to Consider This Package

  • Adopt When:
    • Your Laravel app already uses Doctrine DBAL (or is open to adding it) and needs relational storage for AI messages.
    • You prioritize SQL-based querying over speed (e.g., filtering conversations by user_id, timestamp, or response_length).
    • Compliance/audit requirements mandate relational storage (e.g., exportable SQL dumps for legal holds).
    • You’re using Symfony AI Chat or a PSR-15-compatible AI framework (or willing to adapt Laravel to PSR-15).
    • Your team prefers open-source, MIT-licensed dependencies with Symfony’s long-term support.
  • Look Elsewhere If:
    • Performance is critical: DBAL introduces ~10–100ms latency per message vs. Redis (~1ms). Use Redis or Elasticsearch for high-throughput apps.
    • Schema is read-only: This package requires write access to create tables (conflicts with DB replicas).
    • Non-Symfony/Laravel stack: Django, Spring Boot, or serverless apps lack DBAL/Symfony integration.
    • Advanced AI features needed: Embeddings, vector search, or hybrid semantic storage require vector databases (e.g., Weaviate, Pinecone).
    • Zero Symfony dependency: The package is tightly coupled to Symfony’s AI ecosystem; Laravel may need custom adapters.

How to Pitch It (Stakeholders)

For Executives: *"This package lets us store AI chat conversations in our existing database—no new infrastructure or vendor lock-in. It’s a drop-in solution for Laravel that:

  • Reduces costs by eliminating separate message store services (e.g., Redis clusters).
  • Simplifies compliance with SQL-based audit trails (e.g., GDPR data exports via COPY commands).
  • Future-proofs AI features like conversation analytics or fine-tuning datasets. Low risk: Uses open-source Symfony tools with MIT license, and we can fallback to custom DBAL queries if needed."*

For Engineers: *"Symfony’s ai-doctrine-message-store gives us:

  • Zero schema migrations (works with existing tables if we use raw DBAL queries).
  • PSR-15 compliance (standardized message storage, but we’ll need a Laravel adapter).
  • Doctrine DBAL integration (already supported in Laravel via doctrine/dbal). Tradeoffs:
  • Not for high-speed apps: DBAL adds latency vs. Redis.
  • Symfony dependency: We’ll need to wrap PSR-15 for Laravel. Alternative: Build a custom ai_messages table, but this saves us 2–4 weeks of dev time."*

For Data/Compliance Teams: *"This ensures AI chat logs are stored in our controlled database environment, enabling:

  • SQL-based retention policies (e.g., DELETE FROM ai_messages WHERE created_at < NOW() - INTERVAL '1 year').
  • Seamless exports for legal holds (no proprietary formats).
  • Access controls via existing DB permissions (e.g., row-level security in PostgreSQL). Downside: Slower than Redis for real-time analytics, but we can cache hot data in Redis while keeping the source of truth in SQL."*

For Product Managers: *"Key benefits for our roadmap:

  1. Auditability: Track every AI interaction for transparency (e.g., ‘Why did the bot suggest X?’).
  2. Cross-team data: Join chat messages with user profiles or CRM data in one query.
  3. Offline support: Persistent storage works even if AI APIs are down.
  4. Cost savings: No need for a separate message store service. Risk: If we need millions of messages/sec, we’ll need to hybridize with Redis—but that’s a future problem."*
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope