@semiont/make-meaning 0.2.45 → 0.3.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 +141 -262
- package/dist/index.d.ts +512 -548
- package/dist/index.js +13046 -5104
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -6,14 +6,18 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@semiont/make-meaning)
|
|
7
7
|
[](https://github.com/The-AI-Alliance/semiont/blob/main/LICENSE)
|
|
8
8
|
|
|
9
|
-
**Making meaning from resources through context assembly,
|
|
9
|
+
**Making meaning from resources through actors, context assembly, and relationship reasoning.**
|
|
10
10
|
|
|
11
|
-
This package
|
|
11
|
+
This package implements the actor model from [ARCHITECTURE.md](../../docs/ARCHITECTURE.md). It owns the **Knowledge Base** and the actors that interface with it:
|
|
12
12
|
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
13
|
+
- **Stower** (write) — the single write gateway to the Knowledge Base
|
|
14
|
+
- **Gatherer** (read) — handles all browse reads, context assembly (passage + graph neighborhood + optional inference summary), and entity type listing
|
|
15
|
+
- **Binder** (search/link) — context-driven search with multi-source retrieval, composite structural scoring, optional LLM semantic scoring, and graph queries
|
|
16
|
+
- **CloneTokenManager** (yield) — manages clone token lifecycle for resource cloning
|
|
17
|
+
|
|
18
|
+
All actors subscribe to the EventBus via RxJS pipelines. They expose only `initialize()` and `stop()` — no public business methods. Callers communicate with actors by putting events on the bus.
|
|
19
|
+
|
|
20
|
+
The EventBus is a **complete interface** for all knowledge-domain operations. HTTP routes in the backend are thin wrappers that delegate to EventBus actors. The system can operate entirely without HTTP — see `EventBusClient` in `@semiont/api-client`.
|
|
17
21
|
|
|
18
22
|
## Quick Start
|
|
19
23
|
|
|
@@ -23,319 +27,194 @@ npm install @semiont/make-meaning
|
|
|
23
27
|
|
|
24
28
|
### Start Make-Meaning Service
|
|
25
29
|
|
|
26
|
-
The simplest way to use make-meaning infrastructure is through the service module:
|
|
27
|
-
|
|
28
30
|
```typescript
|
|
29
31
|
import { startMakeMeaning } from '@semiont/make-meaning';
|
|
30
|
-
import
|
|
32
|
+
import { EventBus } from '@semiont/core';
|
|
33
|
+
import type { EnvironmentConfig, Logger } from '@semiont/core';
|
|
31
34
|
|
|
32
|
-
//
|
|
33
|
-
const
|
|
35
|
+
// EventBus is created outside make-meaning — it is not encapsulated by this package
|
|
36
|
+
const eventBus = new EventBus();
|
|
34
37
|
|
|
35
|
-
//
|
|
36
|
-
const
|
|
38
|
+
// Start all infrastructure
|
|
39
|
+
const makeMeaning = await startMakeMeaning(config, eventBus, logger);
|
|
40
|
+
|
|
41
|
+
// Access components
|
|
42
|
+
const { kb, jobQueue, stower, gatherer, binder, cloneTokenManager } = makeMeaning;
|
|
37
43
|
|
|
38
44
|
// Graceful shutdown
|
|
39
45
|
await makeMeaning.stop();
|
|
40
46
|
```
|
|
41
47
|
|
|
42
48
|
This single call initializes:
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
import { ResourceContext } from '@semiont/make-meaning';
|
|
52
|
-
|
|
53
|
-
const resource = await ResourceContext.getResourceMetadata(resourceId, config);
|
|
54
|
-
const resources = await ResourceContext.listResources({ createdAfter: '2024-01-01' }, config);
|
|
55
|
-
const withContent = await ResourceContext.addContentPreviews(resources, config);
|
|
56
|
-
```
|
|
49
|
+
- **KnowledgeBase** — groups EventStore, ViewStorage, RepresentationStore, GraphDatabase
|
|
50
|
+
- **Stower** — subscribes to write commands on EventBus
|
|
51
|
+
- **Gatherer** — subscribes to browse reads, gather context, and entity type listing on EventBus
|
|
52
|
+
- **Binder** — subscribes to search and referenced-by queries on EventBus
|
|
53
|
+
- **CloneTokenManager** — subscribes to clone token operations on EventBus
|
|
54
|
+
- **GraphDBConsumer** — event-to-graph synchronization (RxJS burst-buffered pipeline)
|
|
55
|
+
- **JobQueue** — background job processing queue + job status subscription
|
|
56
|
+
- **6 annotation workers** — poll job queue for async AI tasks
|
|
57
57
|
|
|
58
|
-
###
|
|
58
|
+
### Create a Resource (via EventBus)
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
|
-
import {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
import { ResourceOperations } from '@semiont/make-meaning';
|
|
62
|
+
import { userId } from '@semiont/core';
|
|
63
|
+
|
|
64
|
+
const result = await ResourceOperations.createResource(
|
|
65
|
+
{
|
|
66
|
+
name: 'My Document',
|
|
67
|
+
content: Buffer.from('Document content here'),
|
|
68
|
+
format: 'text/plain',
|
|
69
|
+
language: 'en',
|
|
70
|
+
},
|
|
71
|
+
userId('user-123'),
|
|
72
|
+
eventBus,
|
|
73
|
+
config.services.backend.publicURL,
|
|
72
74
|
);
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
`ResourceOperations.createResource` emits `yield:create` on the EventBus. The Stower subscribes to this event, persists the resource to the EventStore and ContentStore, and emits `yield:created` back on the bus.
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
import { AnnotationDetection } from '@semiont/make-meaning';
|
|
79
|
-
|
|
80
|
-
// AI-powered detection of passages that merit commentary
|
|
81
|
-
const comments = await AnnotationDetection.detectComments(
|
|
82
|
-
resourceId,
|
|
83
|
-
config,
|
|
84
|
-
'Focus on technical explanations',
|
|
85
|
-
'educational',
|
|
86
|
-
0.7
|
|
87
|
-
);
|
|
79
|
+
### Gather Context (via EventBus)
|
|
88
80
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
resourceId,
|
|
92
|
-
config,
|
|
93
|
-
'Find key definitions and important concepts',
|
|
94
|
-
0.5
|
|
95
|
-
);
|
|
81
|
+
```typescript
|
|
82
|
+
import { firstValueFrom, race, filter, timeout } from 'rxjs';
|
|
96
83
|
|
|
97
|
-
//
|
|
98
|
-
|
|
84
|
+
// Emit gather request
|
|
85
|
+
eventBus.get('gather:requested').next({
|
|
86
|
+
annotationUri,
|
|
99
87
|
resourceId,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
options: { contextLines: 5 },
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// Await result
|
|
92
|
+
const result = await firstValueFrom(
|
|
93
|
+
race(
|
|
94
|
+
eventBus.get('gather:complete').pipe(filter(e => e.annotationUri === annotationUri)),
|
|
95
|
+
eventBus.get('gather:failed').pipe(filter(e => e.annotationUri === annotationUri)),
|
|
96
|
+
).pipe(timeout(30_000)),
|
|
103
97
|
);
|
|
104
98
|
```
|
|
105
99
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
import { GraphContext } from '@semiont/make-meaning';
|
|
110
|
-
|
|
111
|
-
// Find resources that link to this resource (backlinks)
|
|
112
|
-
const backlinks = await GraphContext.getBacklinks(resourceId, config);
|
|
113
|
-
|
|
114
|
-
// Find shortest path between two resources
|
|
115
|
-
const paths = await GraphContext.findPath(fromResourceId, toResourceId, config, 3);
|
|
116
|
-
|
|
117
|
-
// Full-text search across all resources
|
|
118
|
-
const results = await GraphContext.searchResources('neural networks', config, 10);
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Use Individual Workers (Advanced)
|
|
122
|
-
|
|
123
|
-
For fine-grained control, workers can be instantiated directly:
|
|
124
|
-
|
|
125
|
-
```typescript
|
|
126
|
-
import {
|
|
127
|
-
ReferenceDetectionWorker,
|
|
128
|
-
HighlightDetectionWorker,
|
|
129
|
-
GenerationWorker,
|
|
130
|
-
} from '@semiont/make-meaning';
|
|
131
|
-
import { JobQueue } from '@semiont/jobs';
|
|
132
|
-
import { createEventStore } from '@semiont/event-sourcing';
|
|
133
|
-
|
|
134
|
-
// Create shared dependencies
|
|
135
|
-
const jobQueue = new JobQueue({ dataDir: './data' });
|
|
136
|
-
await jobQueue.initialize();
|
|
137
|
-
const eventStore = createEventStore('./data', 'http://localhost:3000');
|
|
138
|
-
|
|
139
|
-
// Create workers with explicit dependencies
|
|
140
|
-
const referenceWorker = new ReferenceDetectionWorker(jobQueue, config, eventStore);
|
|
141
|
-
const highlightWorker = new HighlightDetectionWorker(jobQueue, config, eventStore);
|
|
142
|
-
const generationWorker = new GenerationWorker(jobQueue, config, eventStore);
|
|
143
|
-
|
|
144
|
-
// Start workers
|
|
145
|
-
await Promise.all([
|
|
146
|
-
referenceWorker.start(),
|
|
147
|
-
highlightWorker.start(),
|
|
148
|
-
generationWorker.start(),
|
|
149
|
-
]);
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**Note**: In most cases, use `startMakeMeaning()` instead, which handles all initialization automatically.
|
|
153
|
-
|
|
154
|
-
## Documentation
|
|
155
|
-
|
|
156
|
-
- **[API Reference](./docs/api-reference.md)** - Complete API documentation for all classes and methods
|
|
157
|
-
- **[Job Workers](./docs/job-workers.md)** - Asynchronous task processing with progress tracking
|
|
158
|
-
- **[Architecture](./docs/architecture.md)** - System design and data flow
|
|
159
|
-
- **[Examples](./docs/examples.md)** - Common use cases and patterns
|
|
160
|
-
|
|
161
|
-
## Philosophy
|
|
162
|
-
|
|
163
|
-
Resources don't exist in isolation. A document becomes meaningful when we understand its annotations, its relationships to other resources, and the patterns within its content. `@semiont/make-meaning` provides the infrastructure to:
|
|
164
|
-
|
|
165
|
-
1. **Assemble context** from event-sourced storage
|
|
166
|
-
2. **Detect patterns** using AI inference
|
|
167
|
-
3. **Reason about relationships** through graph traversal
|
|
168
|
-
|
|
169
|
-
This is the "applied meaning-making" layer - it sits between low-level AI primitives ([@semiont/inference](../inference/)) and high-level application orchestration ([apps/backend](../../apps/backend/)).
|
|
170
|
-
|
|
171
|
-
## Infrastructure Ownership
|
|
172
|
-
|
|
173
|
-
**MakeMeaningService is the single source of truth for all infrastructure:**
|
|
100
|
+
## Architecture
|
|
174
101
|
|
|
175
|
-
|
|
176
|
-
import { startMakeMeaning } from '@semiont/make-meaning';
|
|
102
|
+
### Actor Model
|
|
177
103
|
|
|
178
|
-
|
|
179
|
-
const makeMeaning = await startMakeMeaning(config);
|
|
104
|
+
All meaningful actions flow through the EventBus. The three KB actors are reactive — they subscribe via RxJS pipelines in `initialize()` and communicate results by emitting on the bus.
|
|
180
105
|
|
|
181
|
-
|
|
182
|
-
|
|
106
|
+
```mermaid
|
|
107
|
+
graph TB
|
|
108
|
+
Routes["Backend Routes"] -->|commands| BUS["Event Bus"]
|
|
109
|
+
Workers["Job Workers"] -->|commands| BUS
|
|
110
|
+
EBC["EventBusClient"] -->|commands| BUS
|
|
111
|
+
|
|
112
|
+
BUS -->|"yield:create, mark:create,<br/>mark:delete, job:*"| STOWER["Stower<br/>(write)"]
|
|
113
|
+
BUS -->|"browse:*, gather:*,<br/>mark:entity-types-*"| GATHERER["Gatherer<br/>(read)"]
|
|
114
|
+
BUS -->|"bind:search-*,<br/>bind:referenced-by-*"| BINDER["Binder<br/>(search/link)"]
|
|
115
|
+
BUS -->|"yield:clone-*"| CTM["CloneTokenManager<br/>(clone)"]
|
|
116
|
+
|
|
117
|
+
STOWER -->|persist| KB["Knowledge Base"]
|
|
118
|
+
GATHERER -->|query| KB
|
|
119
|
+
BINDER -->|query| KB
|
|
120
|
+
CTM -->|query| KB
|
|
121
|
+
|
|
122
|
+
STOWER -->|"yield:created, mark:created"| BUS
|
|
123
|
+
GATHERER -->|"browse:*-result,<br/>gather:complete"| BUS
|
|
124
|
+
BINDER -->|"bind:search-results,<br/>bind:referenced-by-result"| BUS
|
|
125
|
+
CTM -->|"yield:clone-token-generated,<br/>yield:clone-resource-result"| BUS
|
|
126
|
+
|
|
127
|
+
classDef bus fill:#e8a838,stroke:#b07818,stroke-width:3px,color:#000,font-weight:bold
|
|
128
|
+
classDef actor fill:#5a9a6a,stroke:#3d6644,stroke-width:2px,color:#fff
|
|
129
|
+
classDef kb fill:#8b6b9d,stroke:#6b4a7a,stroke-width:2px,color:#fff
|
|
130
|
+
classDef caller fill:#4a90a4,stroke:#2c5f7a,stroke-width:2px,color:#fff
|
|
131
|
+
|
|
132
|
+
class BUS bus
|
|
133
|
+
class STOWER,GATHERER,BINDER,CTM actor
|
|
134
|
+
class KB kb
|
|
135
|
+
class Routes,Workers,EBC caller
|
|
183
136
|
```
|
|
184
137
|
|
|
185
|
-
|
|
138
|
+
### Knowledge Base
|
|
186
139
|
|
|
187
|
-
|
|
188
|
-
2. **GraphDatabase** - Graph database connection for relationships and traversal
|
|
189
|
-
3. **RepresentationStore** - Content-addressed document storage
|
|
190
|
-
4. **InferenceClient** - LLM client for AI operations
|
|
191
|
-
5. **JobQueue** - Background job processing queue
|
|
192
|
-
6. **Workers** - All 6 detection/generation workers
|
|
193
|
-
7. **GraphDBConsumer** - Event-to-graph synchronization
|
|
140
|
+
The Knowledge Base is an inert store — it has no intelligence, no goals, no decisions. It groups four subsystems:
|
|
194
141
|
|
|
195
|
-
|
|
142
|
+
| Store | Implementation | Purpose |
|
|
143
|
+
|-------|---------------|---------|
|
|
144
|
+
| **Event Log** | `EventStore` | Immutable append-only log of all domain events |
|
|
145
|
+
| **Materialized Views** | `ViewStorage` | Denormalized projections for fast reads |
|
|
146
|
+
| **Content Store** | `RepresentationStore` | Content-addressed binary storage (SHA-256) |
|
|
147
|
+
| **Graph** | `GraphDatabase` | Eventually consistent relationship projection |
|
|
196
148
|
|
|
197
149
|
```typescript
|
|
198
|
-
|
|
199
|
-
const { graphDb } = makeMeaning;
|
|
150
|
+
import { createKnowledgeBase } from '@semiont/make-meaning';
|
|
200
151
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const repStore = new FilesystemRepresentationStore(...); // NEVER DO THIS
|
|
204
|
-
const eventStore = createEventStore(...); // NEVER DO THIS
|
|
152
|
+
const kb = createKnowledgeBase(eventStore, basePath, projectRoot, graphDb, logger);
|
|
153
|
+
// kb.eventStore, kb.views, kb.content, kb.graph
|
|
205
154
|
```
|
|
206
155
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
- **Single initialization** - All infrastructure created once, shared everywhere
|
|
210
|
-
- **No resource leaks** - Single connection per resource type (database, storage, etc.)
|
|
211
|
-
- **Consistent configuration** - Same config across all components
|
|
212
|
-
- **Testability** - Single injection point for mocking
|
|
213
|
-
- **Lifecycle management** - Centralized shutdown via `makeMeaning.stop()`
|
|
214
|
-
|
|
215
|
-
**Implementation Pattern:**
|
|
216
|
-
|
|
217
|
-
- Backend creates MakeMeaningService in [apps/backend/src/index.ts:56](../../apps/backend/src/index.ts#L56)
|
|
218
|
-
- Routes access via Hono context: `c.get('makeMeaning')`
|
|
219
|
-
- Services receive infrastructure as parameters (dependency injection)
|
|
220
|
-
- Workers receive EventStore and InferenceClient via constructor
|
|
221
|
-
|
|
222
|
-
This architectural pattern prevents duplicate connections, ensures consistent state, and provides clear ownership boundaries across the entire system.
|
|
223
|
-
|
|
224
|
-
## Architecture
|
|
225
|
-
|
|
226
|
-
Three-layer design separating concerns:
|
|
156
|
+
### EventBus Ownership
|
|
227
157
|
|
|
228
|
-
|
|
229
|
-
graph TB
|
|
230
|
-
Backend["<b>apps/backend</b><br/>Job orchestration, HTTP APIs, streaming"]
|
|
231
|
-
MakeMeaning["<b>@semiont/make-meaning</b><br/>Context assembly, detection/generation,<br/>prompt engineering, response parsing,<br/>job workers"]
|
|
232
|
-
Inference["<b>@semiont/inference</b><br/>AI primitives only:<br/>generateText, client management"]
|
|
158
|
+
The EventBus is created by the backend (or script) and passed into `startMakeMeaning()` as a dependency. Make-meaning does not own or encapsulate the EventBus — it is shared across the entire system.
|
|
233
159
|
|
|
234
|
-
|
|
235
|
-
MakeMeaning --> Inference
|
|
236
|
-
|
|
237
|
-
style Backend fill:#e1f5ff
|
|
238
|
-
style MakeMeaning fill:#fff4e6
|
|
239
|
-
style Inference fill:#f3e5f5
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
**Key principles:**
|
|
243
|
-
|
|
244
|
-
- **Centralized infrastructure**: All infrastructure owned by MakeMeaningService (single initialization point)
|
|
245
|
-
- **Event-sourced context**: Resources and annotations assembled from event streams
|
|
246
|
-
- **Content-addressed storage**: Content retrieved using checksums (deduplication, caching)
|
|
247
|
-
- **Graph-backed relationships**: @semiont/graph provides traversal for backlinks, paths, connections
|
|
248
|
-
- **Explicit dependencies**: Workers receive infrastructure via constructor (dependency injection, no singletons)
|
|
249
|
-
- **No ad-hoc creation**: Routes and services NEVER create their own infrastructure instances
|
|
160
|
+
## Documentation
|
|
250
161
|
|
|
251
|
-
|
|
162
|
+
- **[Architecture](./docs/architecture.md)** — Actor model, data flow, storage architecture
|
|
163
|
+
- **[API Reference](./docs/api-reference.md)** — Context modules and operations
|
|
164
|
+
- **[Examples](./docs/examples.md)** — Common use cases and patterns
|
|
165
|
+
- **[Job Workers](./docs/job-workers.md)** — Async annotation workers (in @semiont/jobs)
|
|
166
|
+
- **[Scripting](./docs/SCRIPTING.md)** — Direct scripting without HTTP backend
|
|
252
167
|
|
|
253
168
|
## Exports
|
|
254
169
|
|
|
255
|
-
### Service
|
|
256
|
-
|
|
257
|
-
- `startMakeMeaning(config)` - Initialize all make-meaning infrastructure
|
|
258
|
-
- `MakeMeaningService` - Type for service return value
|
|
259
|
-
- `GraphDBConsumer` - Graph consumer class (for advanced use)
|
|
170
|
+
### Service (Primary)
|
|
260
171
|
|
|
261
|
-
|
|
172
|
+
- `startMakeMeaning(config, eventBus, logger)` — Initialize all infrastructure
|
|
173
|
+
- `MakeMeaningService` — Type for service return value
|
|
262
174
|
|
|
263
|
-
|
|
264
|
-
- `AnnotationContext` - Annotation queries and context building
|
|
265
|
-
- `GraphContext` - Graph traversal and search
|
|
175
|
+
### Knowledge Base
|
|
266
176
|
|
|
267
|
-
|
|
177
|
+
- `createKnowledgeBase(...)` — Factory function
|
|
178
|
+
- `KnowledgeBase` — Interface grouping the four KB stores
|
|
268
179
|
|
|
269
|
-
|
|
270
|
-
- `MotivationPrompts` - Prompt builders for comment/highlight/assessment/tag detection
|
|
271
|
-
- `MotivationParsers` - Response parsers with offset validation
|
|
272
|
-
- `extractEntities` - Entity extraction with context-based disambiguation
|
|
273
|
-
- `generateResourceFromTopic` - Markdown resource generation with language support
|
|
274
|
-
- `generateResourceSummary` - Resource summarization
|
|
275
|
-
- `generateReferenceSuggestions` - Smart suggestion generation
|
|
180
|
+
### Actors
|
|
276
181
|
|
|
277
|
-
|
|
182
|
+
- `Stower` — Write gateway actor
|
|
183
|
+
- `Gatherer` — Read actor (browse reads, context assembly, entity type listing)
|
|
184
|
+
- `Binder` — Search/link actor (context-driven search, entity resolution, referenced-by queries)
|
|
185
|
+
- `CloneTokenManager` — Clone token lifecycle actor (yield domain)
|
|
278
186
|
|
|
279
|
-
|
|
280
|
-
- `GenerationWorker` - AI content generation
|
|
281
|
-
- `HighlightDetectionWorker` - Highlight detection
|
|
282
|
-
- `CommentDetectionWorker` - Comment detection
|
|
283
|
-
- `AssessmentDetectionWorker` - Assessment detection
|
|
284
|
-
- `TagDetectionWorker` - Structured tag detection
|
|
187
|
+
### Operations
|
|
285
188
|
|
|
286
|
-
|
|
189
|
+
- `ResourceOperations` — Resource CRUD (emits commands to EventBus)
|
|
190
|
+
- `AnnotationOperations` — Annotation CRUD (emits commands to EventBus)
|
|
287
191
|
|
|
288
|
-
|
|
192
|
+
### Context Assembly
|
|
289
193
|
|
|
290
|
-
|
|
194
|
+
- `ResourceContext` — Resource metadata queries from ViewStorage
|
|
195
|
+
- `AnnotationContext` — Annotation queries and LLM context building
|
|
196
|
+
- `GraphContext` — Graph traversal and search
|
|
197
|
+
- `LLMContext` — Resource-level LLM context assembly
|
|
291
198
|
|
|
292
|
-
|
|
293
|
-
export type {
|
|
294
|
-
CommentMatch,
|
|
295
|
-
HighlightMatch,
|
|
296
|
-
AssessmentMatch,
|
|
297
|
-
TagMatch,
|
|
298
|
-
} from './detection/motivation-parsers';
|
|
299
|
-
|
|
300
|
-
export type { ExtractedEntity } from './detection/entity-extractor';
|
|
301
|
-
```
|
|
199
|
+
### Generation
|
|
302
200
|
|
|
303
|
-
|
|
201
|
+
- `generateResourceSummary` — Resource summarization
|
|
202
|
+
- `generateReferenceSuggestions` — Smart suggestion generation
|
|
304
203
|
|
|
305
|
-
|
|
204
|
+
### Graph
|
|
306
205
|
|
|
307
|
-
|
|
308
|
-
import type { EnvironmentConfig } from '@semiont/core';
|
|
309
|
-
|
|
310
|
-
const config: EnvironmentConfig = {
|
|
311
|
-
services: {
|
|
312
|
-
backend: {
|
|
313
|
-
publicURL: 'http://localhost:3000',
|
|
314
|
-
},
|
|
315
|
-
openai: {
|
|
316
|
-
apiKey: process.env.OPENAI_API_KEY!,
|
|
317
|
-
model: 'gpt-4o-mini',
|
|
318
|
-
temperature: 0.7,
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
storage: {
|
|
322
|
-
base: '/path/to/storage',
|
|
323
|
-
},
|
|
324
|
-
};
|
|
325
|
-
```
|
|
206
|
+
- `GraphDBConsumer` — Event-to-graph synchronization
|
|
326
207
|
|
|
327
208
|
## Dependencies
|
|
328
209
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
- **[@semiont/
|
|
332
|
-
- **[@semiont/
|
|
333
|
-
- **[@semiont/
|
|
334
|
-
- **[@semiont/
|
|
335
|
-
- **[@semiont/
|
|
336
|
-
- **[@semiont/
|
|
337
|
-
- **[@semiont/inference](../inference/)**: AI primitives (prompts, parsers, generateText)
|
|
338
|
-
- **[@semiont/jobs](../jobs/)**: Job queue and worker base class
|
|
210
|
+
- **[@semiont/core](../core/)** — Core types, EventBus, utilities
|
|
211
|
+
- **[@semiont/api-client](../api-client/)** — OpenAPI-generated types
|
|
212
|
+
- **[@semiont/event-sourcing](../event-sourcing/)** — Event store and view storage
|
|
213
|
+
- **[@semiont/content](../content/)** — Content-addressed storage
|
|
214
|
+
- **[@semiont/graph](../graph/)** — Graph database abstraction
|
|
215
|
+
- **[@semiont/ontology](../ontology/)** — Schema definitions for tags
|
|
216
|
+
- **[@semiont/inference](../inference/)** — AI primitives (generateText)
|
|
217
|
+
- **[@semiont/jobs](../jobs/)** — Job queue and annotation workers
|
|
339
218
|
|
|
340
219
|
## Testing
|
|
341
220
|
|