@apart-tech/intelligence-core 0.1.1 → 1.0.0
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.
- package/README.md +62 -0
- package/package.json +1 -1
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
|