8000 GitHub - infinispan/mastra-infinispan: Infinispan native integration with Mastra framweork · GitHub
[go: up one dir, main page]

Skip to content

About

Infinispan native integration with Mastra framweork

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

infinispan-mastra

Infinispan vector store provider for Mastra.

Provides vector search (kNN) capabilities using Infinispan as the backend, via the Hot Rod protocol.

Installation

npm install infinispan-mastra

Usage

import { InfinispanVector } from 'infinispan-mastra';

const store = new InfinispanVector({
  id: 'my-store',
  host: 'localhost',
  port: 11222,
  username: 'admin',
  password: 'password',
});

// Create an index
await store.createIndex({
  indexName: 'documents',
  dimension: 1536,
  metric: 'cosine',
});

// Upsert vectors
await store.upsert({
  indexName: 'documents',
  vectors: [embedding],
  metadata: [{ source: 'doc.pdf' }],
});

// Query
const results = await store.query({
  indexName: 'documents',
  queryVector: queryEmbedding,
  topK: 10,
});

Use with Mastra

import { Mastra } from '@mastra/core';
import { InfinispanVector } from 'infinispan-mastra';

const mastra = new Mastra({
  vectors: {
    infinispan: new InfinispanVector({
      id: 'infinispan',
      host: 'localhost',
      port: 11222,
      username: 'admin',
      password: 'password',
    }),
  },
});

Features

  • kNN vector search with cosine, euclidean, and dot product metrics
  • Hybrid queries (vector + metadata filtering)
  • Full CRUD operations on vectors
  • Uses Hot Rod binary protocol for performance
  • Automatic protobuf schema and indexed cache management

Running tests

npm run test

Tests require Docker to run an Infinispan server.

License

Apache-2.0

About

Infinispan native integration with Mastra framweork

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0