@aimform/search
v0.3.1
Published
Aimform Search — hybrid vector + full-text search over Entities and Blocks with ACL-aware filtering and a React command palette.
Maintainers
Readme
@aimform/search
Hybrid vector + full-text search with ACL-aware filtering and a React command palette.
Install
npm install @aimform/search @aimform/coreUsage
import { Search } from "@aimform/search";
// D1
const search = new Search({ database: env.DB });
// Platform API
const aimform = createAimform({ apiKey: "af_xxx" });
const search = new Search({ client: aimform.client });Query
const results = await search.query(ctx, "org_456", {
query: "quarterly report", mode: "auto", spaceId: "spc_123", limit: 20,
});Index
await search.index({
orgId: "org_456", spaceId: "spc_123", entityId: "ent_789",
entityType: "document", textContent: "Q4 2025 Report...",
aclTier: "read", sourceUpdatedAt: new Date().toISOString(),
});
await search.deindex("entry_1");
await search.reindexEntity("ent_789");
await search.reindexSpace("spc_123");