@apart-tech/intelligence-core 0.1.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +62 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @apart-tech/intelligence-core
2
+
3
+ Core library for Apart Intelligence — database schema, services, embedding providers, and configuration.
4
+
5
+ This package is used internally by the [`@apart-tech/apart-intelligence`](https://www.npmjs.com/package/@apart-tech/apart-intelligence) CLI and the Apart Intelligence API server. You generally don't need to install this directly unless you're building custom integrations.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @apart-tech/intelligence-core
11
+ ```
12
+
13
+ ## What's Included
14
+
15
+ - **Database** — Prisma schema with pgvector embeddings and tsvector full-text search
16
+ - **Services** — NodeService, EdgeService, SearchService, ContextService, DomainService, CleaningService
17
+ - **Providers** — Pluggable embedding providers (OpenAI)
18
+ - **Config** — YAML-based configuration loader
19
+ - **Multi-tenancy** — Organization-scoped data isolation
20
+
21
+ ## Usage
22
+
23
+ ```typescript
24
+ import {
25
+ loadConfig,
26
+ getTenantDb,
27
+ NodeService,
28
+ SearchService,
29
+ createEmbeddingProvider,
30
+ } from "@apart-tech/intelligence-core";
31
+
32
+ const config = loadConfig();
33
+ const db = getTenantDb(config.database.url, { organizationId: "your-org-id" });
34
+ const embeddings = createEmbeddingProvider(config);
35
+
36
+ const nodeService = new NodeService(db, embeddings);
37
+ const node = await nodeService.create({
38
+ type: "decision",
39
+ title: "Use Hono for API",
40
+ content: "We chose Hono over Express because...",
41
+ createdBy: "sdk",
42
+ });
43
+ ```
44
+
45
+ ## Database Setup
46
+
47
+ Requires PostgreSQL 16+ with the `pgvector` extension:
48
+
49
+ ```bash
50
+ psql -c "CREATE DATABASE apart;"
51
+ psql -d apart -c "CREATE EXTENSION IF NOT EXISTS vector;"
52
+ ```
53
+
54
+ Generate the Prisma client:
55
+
56
+ ```bash
57
+ npx prisma generate --schema node_modules/@apart-tech/intelligence-core/prisma/schema.prisma
58
+ ```
59
+
60
+ ## License
61
+
62
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apart-tech/intelligence-core",
3
- "version": "0.1.1",
3
+ "version": "1.0.1",
4
4
  "description": "Core library: database, services, and providers for Apart Intelligence",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,16 +21,17 @@
21
21
  "dependencies": {
22
22
  "@prisma/client": "^6.6.0",
23
23
  "@prisma/extension-accelerate": "^3.0.1",
24
+ "prisma": "^6.6.0",
24
25
  "yaml": "^2.6.0",
25
26
  "zod": "^3.24.0"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/node": "^25.5.0",
29
- "prisma": "^6.6.0",
30
30
  "typescript": "^5.7.0",
31
31
  "vitest": "^3.0.0"
32
32
  },
33
33
  "scripts": {
34
+ "postinstall": "prisma generate --schema ./prisma/schema.prisma 2>/dev/null || true",
34
35
  "build": "tsc",
35
36
  "dev": "tsc --watch",
36
37
  "lint": "tsc --noEmit",