Repository navigation
Replies: 1 comment
|
Hi @corgab! This is an excellent and very timely proposal. With the rise of AI-driven applications, having native support for the To make this a "first-class citizen" in Laravel, I believe a robust implementation should cover these three fundamental areas: 1. Schema & Blueprint SupportWe should be able to define vector columns directly in our migrations. A clean implementation would look like this: $table->vector('embedding', 1536); // Support for specific dimensions
Schema: Adding the logic to compile the VECTOR type. Query: Implementing a wrapper for distance functions (Cosine, Euclidean, or Dot Product).
$users = User::query()
->orderByDistance('embedding', $queryVector, 'cosine')
->limit(5)
->get();Why this belongs in the Core: Consistency: It aligns MySQL's capabilities with what is already becoming standard in the pgvector/PostgreSQL ecosystem within Laravel. Future-proofing: As LLMs become more integrated into web apps, vector search will be as common as full-text search. If you are willing to start the PR, I’d suggest looking at how geometry types or fulltext indexes are handled in the current MySqlGrammar for inspiration. I’m sure many of us would be happy to help with testing or code review! 🚀 |
Uh oh!
There was an error while loading. Please reload this page.
Hi! Now that MySQL 8.4 has native vector support, are there any plans to add official support (like VECTOR_DISTANCE) to the core, similar to what's available for Postgres?
If you're open to it, I'd love to take a crack at it and submit a PR
All reactions