sails-vectorai
v0.0.0
Published
Experimental Sails/Waterline adapter for VectorAI.
Downloads
21
Maintainers
Readme
sails-vectorai
Experimental Sails/Waterline adapter for proving the VectorAI datastore contract. It is currently developed inside PairLore and published as sails-vectorai.
It was generated with:
npx sails generate adapter vectoraiThen it was narrowed into a local-first adapter inspired by sails-sqlite: register a datastore, keep a datastore manager, expose Waterline stage-3 methods, and keep the implementation small until the real backend contract settles.
Current DX
Configure a datastore with adapter: 'sails-vectorai', point models at that datastore, and use normal Waterline calls for local development:
await CulturalReferenceEmbedding.createEach([
{
text: 'AI memory tool launch post',
embedding: [1, 0, 0],
topic: 'ai'
}
])
var matches = await CulturalReferenceEmbedding.find({
where: { topic: 'ai' },
limit: 5
}).meta({
vectorSearch: {
column: 'embedding',
nearestTo: [0.98, 0.02, 0],
metric: 'cosine',
scoreField: 'similarity',
distanceField: 'distance'
}
})meta.vectorSearch is the adapter-specific escape hatch. It keeps the model API boring while leaving room for Actian VectorAI DB or another vector backend behind the same Waterline boundary.
Implemented Methods
| Method | Status | Category | | :---------------- | :---------- | :-------- | | registerDatastore | Implemented | LIFECYCLE | | teardown | Implemented | LIFECYCLE | | create | Implemented | DML | | createEach | Implemented | DML | | update | Implemented | DML | | destroy | Implemented | DML | | find | Implemented | DQL | | count | Implemented | DQL | | sum | Implemented | DQL | | avg | Implemented | DQL | | define | Implemented | DDL | | drop | Implemented | DDL |
Not Yet
The adapter does not implement joins, associations, persistence, connection pooling, native queries, or Actian-specific SQL yet. Those should be added only when PairLore's product loop proves the need.
License
This local adapter is available under the MIT license.
