Skip to content

Conversation

@lvca
Copy link
Contributor

@lvca lvca commented Dec 20, 2025

No description provided.

@lvca lvca requested a review from gramian December 20, 2025 07:28
@lvca lvca self-assigned this Dec 20, 2025
@lvca lvca added the documentation Improvements or additions to documentation label Dec 20, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @lvca, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the SQL query language by introducing a comprehensive set of new vector functions. These additions are designed to empower users with advanced capabilities for similarity search, embeddings processing, and vector analytics directly within SQL queries. The functions cover a wide range of operations, from basic arithmetic and normalization to sophisticated techniques like quantization, sparse vector handling, and hybrid search reranking, providing a robust toolkit for modern data applications.

Highlights

  • Essential Vector Operations: Introduced functions for fundamental vector manipulations including normalization (vectorNormalize), magnitude calculation (vectorMagnitude), dimensionality (vectorDims), dot product (vectorDotProduct), cosine similarity (vectorCosineSimilarity), L2 distance (vectorL2Distance), and inner product (vectorInnerProduct).
  • Vector Arithmetic and Aggregations: Added functions for element-wise vector arithmetic such as addition (vectorAdd), subtraction (vectorSubtract), multiplication (vectorMultiply), and scalar scaling (vectorScale). Also included aggregate functions like VECTOR_AVG, VECTOR_SUM, VECTOR_MIN, and VECTOR_MAX for processing vector sets.
  • Reranking and Hybrid Search: Implemented functions to enhance search capabilities, including Reciprocal Rank Fusion (RRF) scoring (vectorRRFScore), score normalization (vectorNormalizeScores), hybrid search scoring (vectorHybridScore), and general score transformations (vectorScoreTransform).
  • Sparse Vectors and Multi-Vector Support: Introduced functions for handling sparse vectors, allowing creation (sparseVectorCreate), efficient dot product calculation (sparseVectorDot), conversion between sparse and dense formats (sparseVectorToDense, denseVectorToSparse), and combining multiple scores (multiVectorScore).
  • Vector Quantization and Optimization: Added functions for optimizing vector storage and comparison through quantization. This includes INT8 quantization (vectorQuantizeInt8), binary quantization (vectorQuantizeBinary), dequantization of INT8 vectors (vectorDequantizeInt8), and approximate distance calculations for quantized vectors (vectorApproxDistance).
  • Vector Analysis and Validation: Provided a suite of functions for analyzing and validating vector properties, such as L1 norm (vectorL1Norm), L-infinity norm (vectorLInfNorm), variance (vectorVariance), standard deviation (vectorStdDev), sparsity (vectorSparsity), normalization checks (vectorIsNormalized), detection of NaN (vectorHasNaN) and infinite values (vectorHasInf), element clipping (vectorClip), and string representation conversion (vectorToString).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify
Copy link
Contributor

mergify bot commented Dec 20, 2025

🧪 CI Insights

Here's what we observed from your CI run for be4bc98.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces extensive documentation for a new set of SQL vector functions. The documentation is well-structured and comprehensive, covering a wide range of operations from basic arithmetic to advanced features like quantization and sparse vectors. My review focuses on ensuring the accuracy and clarity of the provided examples and descriptions. I've identified a few minor issues, such as an incorrect range for cosine similarity, a potential miscalculation in an example, and areas where more clarification would be beneficial for the user. Overall, this is a great addition to the documentation.

Comment on lines +1583 to +1586
====== vectorInnerProduct()

Calculates the inner product of two vectors.
Can be negative. Primarily used with normalized vectors where it equals cosine similarity * magnitude product.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The function vectorInnerProduct appears to have the same functionality as vectorDotProduct. The documentation for vectorDotProduct even mentions "(inner product)" in its description. This duplication can be confusing for users. If they are aliases, it would be helpful to state that explicitly. If there is a subtle difference in implementation or use case (e.g., performance characteristics, as hinted by the SIMD optimization note for vectorDotProduct), it should be clearly documented to guide users on when to use which function.

SELECT multiVectorScore([0.9, 0.8, 0.85], 'WEIGHTED', [0.5, 0.3, 0.2]) as weighted_score
----

Result: `0.87`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The result for the WEIGHTED example of multiVectorScore seems to be incorrect. The calculation (0.9 * 0.5) + (0.8 * 0.3) + (0.85 * 0.2) equals 0.45 + 0.24 + 0.17 = 0.86. The documentation states the result is 0.87. Please correct the example result.

Result: `0.86`

Update all 26 vector function references in SQL documentation
to match the new camelCase naming convention.

Changes:
- Updated all UPPER_CASE_WITH_UNDERSCORE function names to camelCase
- Updated all function headers (====== sections)
- Updated all function signatures and examples
- 33 vector function documentation sections updated

Examples:
- VECTOR_AVG() → vectorAvg()
- VECTOR_SUM() → vectorSum()
- SPARSE_VECTOR_CREATE() → sparseVectorCreate()
- VECTOR_QUANTIZE_INT8() → vectorQuantizeInt8()
- VECTOR_RRF_SCORE() → vectorRRFScore()

Documentation remains accurate with function behavior unchanged,
only naming convention updated to match ArcadeDB standards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant