8000 Bug fix/improve visualizer performance by mchacki · Pull Request #21819 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix/improve visualizer performance #21819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5026212
Added a test stuie for the graph visualizer backend
mchacki Jun 23, 2025
0e7a6ce
Refactored graphs-v2
mchacki Jun 23, 2025
28a533f
Added a performance test, and started refactoring the backend code fo…
mchacki Jun 23, 2025
b0b924d
Further optimization by using 'KEEP' on required attributes only
mchacki Jun 23, 2025
f331f1a
Applied more complex optimization to make use of projections
mchacki Jun 24, 2025
d06b6d7
Allowed for edge Projections
mchacki Jun 24, 2025
c77b6c8
Removed debug output
mchacki Jun 24, 2025
6d79542
Added CHANGELOG entry
mchacki Jun 24, 2025
dd78cd4
Fixed behaviour for multi-labels
mchacki Jun 24, 2025
44cc13d
disable test, its not working for coverage on all of its parts (#21805)
dothebart Jun 23, 2025
0ab78de
Add inner product metric to vector index (#21814)
mchacki Jun 25, 2025
3279c21
Stop using a streaming transaction after an operation timeouts (#21796)
goedderz Jun 24, 2025
3df4b42
Update README.md for v3.12.5+ (#21804)
Simran-B Jun 24, 2025
0f46ad5
Docs: Reword arangimport startup option description for collection na…
Simran-B Jun 24, 2025
29d1f6b
properly handle connection and make sure we don't forget it (#21822)
dothebart Jun 24, 2025
a67be6c
Fix load memory order (#21818)
jvolmer Jun 25, 2025
5021b04
FE-611 | Add Vector Index Feature (#21793)
bluepal-nadeem-abdun Jun 25, 2025
ed243d0
Added CHANGELOG entry 8000
mchacki Jun 24, 2025
70777db
Merge remote-tracking branch 'origin' into bug-fix/improve-visualizer…
mchacki Jun 25, 2025
6b2e822
Added tests and bugfix for attribute not found behaviour
mchacki Jul 2, 2025
b2213df
Merge remote-tracking branch 'origin' into bug-fix/improve-visualizer…
mchacki Jul 8, 2025
072e309
Merge remote-tracking branch 'origin' into bug-fix/improve-visualizer…
mchacki Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FE-611 | Add Vector Index Feature (#21793)
  • Loading branch information
bluepal-nadeem-abdun authored and mchacki committed Jun 25, 2025
commit 5021b04f8459c7776bb2e529b43db3695ff0a1b6
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ devel
a better performing query. This should help on larger graphs
having more, not displayed data.

* FE-611: Add support for experimental vector index to the collection Indexes view with "beta" label, shown only if --experimental-vector-index flag is enabled.

* Add inner product metric for vector index and APPROX_NEAR_INNER_PRODUCT()
AQL function. The inner product metric is similar to cosine metric except
vectors are not normalized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,20 @@ type MdiPrefixed = Omit<MdiIndex, "type"> & {
prefixFields: string[];
};

export type CollectionIndex = Index | MdiIndex | MdiPrefixed;
type Vector = {
type: "vector";
fields: string[];
name?: string;
params: {
metric: "cosine" | "l2" | string;
dimension: number;
nLists: number;
defaultNProbe?: number;
trainingIterations?: number;
factory?: string;
};
parallelism: number;
inBackground: boolean;
};

export type CollectionIndex = Index | MdiIndex | MdiPrefixed | Vector;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { MDIIndexForm } from "./MDIIndexForm";
import { MDIPrefixedIndexForm } from "./MDIPrefixedIndexForm";
import { PersistentIndexForm } from "./PersistentIndexForm";
import { TTLIndexForm } from "./TTLIndexForm";
import { VectorIndexForm } from "./vectorIndex/VectorIndexForm";

export const AddIndexForm = ({ onClose }: { onClose: () => void }) => {
const { indexTypeOptions } = useCollectionIndicesContext();
Expand Down Expand Up @@ -79,5 +80,8 @@ const IndexTypeForm = ({
if (type === "mdi-prefixed") {
return <MDIPrefixedIndexForm onClose={onClose} />;
}
if (type === "vector") {
return <VectorIndexForm onClose={onClose} />;
}
return <></>;
};
8000
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ export const commonFieldsMap = {
label: "Name",
name: "name",
type: "text",
tooltip:
"Index name. If left blank, the name will be auto-generated. Example: byValue",
tooltip: "Index name. If left blank, the name will be auto-generated. Example: byValue",
initialValue: ""
},
inBackground: {
label: "Create in background",
name: "inBackground",
type: "boolean",
initialValue: true,
tooltip: "Create the index in background."
tooltip: "Enable this option to keep the collection/shards available for write operations by not using an exclusive write lock for the duration of the index creation."
}
};
const traditionalNameSchema = Yup.string()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";
import { IndexFormInner } from "../IndexFormInner";
import {
FIELDS,
INITIAL_VALUES,
SCHEMA,
useCreateVectorIndex
} from "./useCreateVectorIndex";

export const VectorIndexForm = ({ onClose }: { onClose: () => void }) => {
const { onCreate } = useCreateVectorIndex();

return (
<IndexFormInner<typeof INITIAL_VALUES, typeof FIELDS, typeof SCHEMA>
initialValues={INITIAL_VALUES}
schema={SCHEMA}
fields={FIELDS}
onCreate={onCreate}
onClose={onClose}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import * as Yup from "yup";
import { commonFieldsMap, commonSchema } from "../IndexFieldsHelper";
import { useCreateIndex } from "../useCreateIndex";

export const INITIAL_VALUES = {
type: "vector",
fields: "",
name: commonFieldsMap.name.initialValue,
params: {
metric: "",
dimension: undefined,
nLists: undefined,
defaultNProbe: 1,
trainingIterations: 25,
factory: undefined
},
parallelism: 2,
inBackground: commonFieldsMap.inBackground.initialValue
};

export const FIELDS = [
{
label: "Field",
name: "fields",
type: "text",
isRequired: true,
tooltip: "The name of the attribute that contains the vector embeddings. Only a single attribute is supported."
},
commonFieldsMap.name,
{
label: "Metric",
name: "params.metric",
type: "creatableSingleSelect",
isRequired: true,
options: [
{ label: "Cosine", value: "cosine" },
{ label: "L2 (Euclidean)", value: "l2" }
],
tooltip: "Distance metric used for similarity search. Choose between cosine similarity or Euclidean distance."
},
{
label: "Dimension",
name: "params.dimension",
type: "number",
isRequired: true,
tooltip: "The dimensionality of the vector embeddings. The indexed attribute must contain vectors of this length."
},
{
label: "Number of Lists (nLists)",
name: "params.nLists",
type: "number",
isRequired: true,
tooltip: "The number of Voronoi cells (nLists) to partition the vector space into. A higher value improves recall but increases indexing time. The value must not exceed the number of documents. Suggested: 15 * sqrt(N), where N is the number of documents."
},
{
label: "Default Number of Probes",
name: "params.defaultNProbe",
type: "number",
tooltip: "The number of inverted lists (clusters) to search during queries by default. Increasing this value improves recall at the cost of speed. The default is 1."
},
{
label: "Training Iterations",
name: "params.trainingIterations",
type: "number",
tooltip: "The number of iterations to use during index training. More iterations improve cluster quality and accuracy, but increase training time. The default is 25."
},
{
label: "Index Factory",
name: "params.factory",
type: "text",
tooltip: `Defines the FAISS index factory. Must start with "IVF". Example: IVF100_HNSW10,Flat. The number following "IVF" must match nLists (e.g. IVF100 → nLists = 100).`
},
{
label: "Parallelism",
name: "parallelism",
type: "number",
tooltip: "Number of threads to use for indexing. The default is 2."
},
commonFieldsMap.inBackground,
];

export const SCHEMA = Yup.object({
fields: Yup.string().trim().required("Field is required"),
name: commonSchema.name,
params: Yup.object({
metric: Yup.string().required("Metric is required"),
dimension: Yup.number().required("Dimension is required"),
nLists: Yup.number().required("Number of lists (nLists) is required"),
defaultNProbe: Yup.number().optional(),
trainingIterations: Yup.number().optional(),
factory: Yup.string().optional()
}),
parallelism: Yup.number().optional(),
inBackground: commonSchema.inBackground
});

type ValuesType = Omit<typeof INITIAL_VALUES, "fields"> & {
fields: string[];
};

export const useCreateVectorIndex = () => {
const { onCreate: onCreateIndex } = useCreateIndex<ValuesType>();
const onCreate = async ({ values }: { values: typeof INITIAL_VALUES }) => {
return onCreateIndex({
type: values.type,
fields: [values.fields.trim()],
name: values.name,
params: values.params,
parallelism: values.parallelism,
inBackground: values.inBackground
});
};
return { onCreate };
};
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,9 @@ const indexTypeOptions: {
{
label: "Inverted Index",
value: "inverted"
},
{
label: "Vector index (beta)",
value: "vector"
}
];
0