@yottagraph-app/elemental-api-skill 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 ADDED
@@ -0,0 +1,61 @@
1
+ # @lovelace-ai/elemental-api-skill
2
+
3
+ Elemental API skill documentation for AI agents. This package provides structured documentation that can be used by AI agents to understand and interact with the Elemental API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @lovelace-ai/elemental-api-skill
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```javascript
14
+ const { paths, files, getSkillFile } = require('@lovelace-ai/elemental-api-skill');
15
+
16
+ // Get path to main skill entry point
17
+ console.log(paths.skill); // Path to SKILL.md
18
+
19
+ // Get path to overview
20
+ console.log(paths.overview); // Path to overview.md
21
+
22
+ // List all skill files
23
+ console.log(files); // ['SKILL.md', 'overview.md', 'articles.md', ...]
24
+
25
+ // Get path to a specific skill file
26
+ console.log(getSkillFile('articles')); // Path to articles.md
27
+ ```
28
+
29
+ ## Skill Files
30
+
31
+ - `SKILL.md` - Main entry point describing when to use this skill
32
+ - `overview.md` - API concepts and file guide
33
+ - `articles.md` - News mentions and article content
34
+ - `entities.md` - Entity lookup, details, and properties
35
+ - `events.md` - Events involving entities
36
+ - `graph.md` - Visual network graphs
37
+ - `relationships.md` - Entity connections
38
+ - `sentiment.md` - Sentiment analysis
39
+ - `server.md` - Server status and capabilities
40
+
41
+ ## Development
42
+
43
+ The skill files are sourced from `moongoose/query/api/skill/` in the lovelace repo.
44
+
45
+ > **Important**: Use the Cursor command instead of running these commands manually.
46
+ >
47
+ > In Cursor, run the command defined in `.cursor/commands/elemental_api_update.md` which handles the full workflow:
48
+ > regenerating specs from Go annotations, updating skill docs, running tests, and optionally syncing/publishing packages.
49
+
50
+ <details>
51
+ <summary>Manual commands (for reference only)</summary>
52
+
53
+ ```bash
54
+ # Manually sync skill files (also runs automatically before publish)
55
+ npm run sync
56
+
57
+ # Publish (syncs skill files automatically via prepublishOnly hook)
58
+ npm publish
59
+ ```
60
+
61
+ </details>
package/index.js ADDED
@@ -0,0 +1,29 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+
4
+ // Get list of skill files
5
+ const skillDir = path.join(__dirname, 'skill');
6
+ const skillFiles = fs.existsSync(skillDir)
7
+ ? fs.readdirSync(skillDir).filter(f => f.endsWith('.md'))
8
+ : [];
9
+
10
+ module.exports = {
11
+ // Main skill entry point
12
+ skillPath: path.join(__dirname, 'skill', 'SKILL.md'),
13
+
14
+ // All skill file paths
15
+ paths: {
16
+ skill: path.join(__dirname, 'skill', 'SKILL.md'),
17
+ overview: path.join(__dirname, 'skill', 'overview.md'),
18
+ dir: skillDir
19
+ },
20
+
21
+ // List of available skill files
22
+ files: skillFiles,
23
+
24
+ // Helper to get path to a specific skill file
25
+ getSkillFile: (name) => path.join(__dirname, 'skill', `${name}.md`),
26
+
27
+ // Package metadata
28
+ version: require('./package.json').version
29
+ };
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@yottagraph-app/elemental-api-skill",
3
+ "version": "1.0.0",
4
+ "description": "Elemental API skill documentation for AI agents",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Lovelace-AI/lovelace.git"
8
+ },
9
+ "publishConfig": {
10
+ "registry": "https://registry.npmjs.org",
11
+ "access": "public"
12
+ },
13
+ "scripts": {
14
+ "sync": "node scripts/sync-skill.js",
15
+ "test": "echo 'No tests configured for this package' && exit 1",
16
+ "validate": "node -e \"const pkg = require('./index.js'); console.log('Loaded:', Object.keys(pkg));\"",
17
+ "prepublishOnly": "npm run sync"
18
+ },
19
+ "files": [
20
+ "skill/",
21
+ "index.js"
22
+ ],
23
+ "main": "index.js",
24
+ "license": "MIT"
25
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: elemental-api
3
+ description: Query the Elemental API for entity discovery, search, and metadata. Use with the Lovelace News Query Server.
4
+ ---
5
+
6
+ # Elemental API
7
+
8
+ This skill provides documentation for the Lovelace Elemental API, the primary interface for querying the Lovelace Knowledge Graph.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Use this skill when you need to:
13
+ - Look up entities (companies, people, organizations) by name or ID
14
+ - Get sentiment analysis for entities over time
15
+ - Find news mentions and articles about entities
16
+ - Explore relationships and connections between entities
17
+ - Retrieve events involving specific entities
18
+ - Build knowledge graphs of entity networks
19
+
20
+ ## Quick Start
21
+
22
+ 1. **Find an entity**: Use `entities.md` to look up a company or person by name and get their NEID (Named Entity ID)
23
+ 2. **Get information**: Use the NEID to query sentiment, mentions, relationships, or events
24
+ 3. **Dive deeper**: Retrieve full article details or explore connected entities
25
+
26
+ ## Files in This Skill
27
+
28
+ See [overview.md](overview.md) for descriptions of each endpoint category:
29
+ - `entities.md` - Entity search, details, and properties
30
+ - `find.md` - Expression language for searching entities by type, property values, and relationships
31
+ - `schema.md` - Data model: entity types (flavors), properties, and schema endpoints
32
+ - `sentiment.md` - Sentiment analysis
33
+ - `articles.md` - Articles mentioning entities and full article content
34
+ - `events.md` - Events involving entities
35
+ - `relationships.md` - Entity connections
36
+ - `graph.md` - Visual graph generation
37
+ - `server.md` - Server status and health
@@ -0,0 +1,386 @@
1
+ # Articles & Mentions
2
+
3
+ Articles are one significant source of data for the Knowledge Graph. A **mention** is a specific reference to an entity within an article, capturing the context and sentiment of that reference.
4
+
5
+ ## When to Use
6
+
7
+ - You need to find news coverage about an entity
8
+ - You want mention counts or volume over time
9
+ - You have a specific article ID (ARTID) or mention code (MCODE) and need full details
10
+ - You want to read the actual text or summary of an article
11
+ - You need article metadata: publication name, date, URL, trustworthiness scores
12
+
13
+ ## Key Concepts
14
+
15
+ - **ARTID**: Unique identifier for each article.
16
+ - Format: 20-character numeric string (same format as NEIDs)
17
+ - Example: `05433395856363393596`
18
+ - **MCODE**: A unique identifier for each mention, linking entity + article + context.
19
+ - Format: `{neid}:{artid}` with colon separator
20
+ - Example: `00416400910670863867:05433395856363393596`
21
+ - **Mention Detail**: Includes the snippet, publication, sentiment, and other metadata
22
+ - **Mention Counts**: Aggregated counts over time buckets, useful for tracking media attention
23
+ - **Article Detail**: Full metadata including title, summary, publication info, and scores
24
+ - **Article Text**: The actual content of the article (when available)
25
+
26
+ ## Important Limitations
27
+
28
+ ⚠️ **Volume Warning**: A single entity may have tens of thousands of associated articles. Avoid querying all articles for an entity over long time periods.
29
+
30
+ **Recommended approach:**
31
+ 1. Start with mention counts to understand volume
32
+ 2. Use mention endpoints to identify specific mentions of interest
33
+ 3. Then retrieve full article details only for those specific articles
34
+
35
+ ## Tips
36
+
37
+ - Start with mention counts to understand volume, then drill into specific mentions
38
+ - Filter by time range to avoid overwhelming results for high-profile entities
39
+ - Use neighborhood mentions to see what else was mentioned alongside your target entity
40
+ - Article text may not be available for all articles (depends on licensing)
41
+ - Use trustworthiness and page rank scores to assess source quality
42
+
43
+ <!-- BEGIN GENERATED CONTENT -->
44
+
45
+ ## Endpoints
46
+
47
+ ### Get article detail
48
+
49
+ `GET /articles/{artid}`
50
+
51
+ Get detailed information about an article by its ID. Response is cached for 1 hour (articles are immutable).
52
+
53
+ #### Guidance
54
+
55
+ Response is wrapped in a 'detail' container object. Access article data via response.detail.
56
+
57
+ #### Parameters
58
+
59
+ | Name | Type | Required | Description |
60
+ |------|------|----------|-------------|
61
+ | artid | string | yes | Article ID |
62
+
63
+ #### Responses
64
+
65
+ | Status | Description |
66
+ |--------|-------------|
67
+ | 200 | Article detail (`GetArticleResponse`) |
68
+ | 400 | Invalid ARTID (`Error`) |
69
+ | 404 | Article not found (`Error`) |
70
+ | 500 | Internal server error (`Error`) |
71
+
72
+ #### Example
73
+
74
+ **Request:**
75
+
76
+ ```
77
+ GET /articles/05433395856363393596
78
+ ```
79
+
80
+ **Response:**
81
+
82
+ ```json
83
+ {"detail": {"artid": "05433395856363393596", "publication_date": "2026-01-28T15:56:47Z", "title": "Apple's Cook says he's 'heartbroken' by Minneapolis events...", "summary": "The article details two fatal shootings by federal agents...", "batch": "7f302ee6808d7c45a09aed07c93ec785", "source": "7f302ee6808d7c45a09aed07c93ec785", "url": "https://www.cnbc.com/2026/01/28/...", "mentions": [{"neid": "00315863961550087877", "artid": "05433395856363393596"}], "topics": [], "events": ["00526686651102446795", "01090525413205193094"], "publication_name": "cnbc.com", "publication_home_url": "http://www.cnbc.com", "trustworthiness": 0.664, "original_publication_name": "CNBC", "tone": "neutral", "title_factuality": "accurate", "tone_objectivity_score": 0.533, "title_factuality_score": 7.133, "syndication_score": 1}}
84
+ ```
85
+
86
+ ---
87
+
88
+ ### Get article text
89
+
90
+ `GET /articles/{artid}/text`
91
+
92
+ Get the full text content of an article by its ID. Response is cached for 10 minutes.
93
+
94
+ #### Guidance
95
+
96
+ This endpoint returns plain text, NOT JSON. Parse the response as text, not as a JSON object.
97
+
98
+ #### Parameters
99
+
100
+ | Name | Type | Required | Description |
101
+ |------|------|----------|-------------|
102
+ | artid | string | yes | Article ID |
103
+
104
+ #### Responses
105
+
106
+ | Status | Description |
107
+ |--------|-------------|
108
+ | 200 | Article text |
109
+ | 400 | Invalid ARTID (`Error`) |
110
+ | 500 | Internal server error (`Error`) |
111
+
112
+ #### Example
113
+
114
+ **Request:**
115
+
116
+ ```
117
+ GET /articles/05433395856363393596/text
118
+ ```
119
+
120
+ **Response:**
121
+
122
+ ```
123
+ Apple CEO Tim Cook said he was "heartbroken" by the situation in Minneapolis...
124
+ ```
125
+
126
+ ---
127
+
128
+ ### Get mentions for entities
129
+
130
+ `GET /mentions/lookup`
131
+
132
+ Get list of mention codes (MCODEs) for named entities in a neighborhood within a time interval. Response is cached for 5 minutes.
133
+
134
+ #### Parameters
135
+
136
+ | Name | Type | Required | Description |
137
+ |------|------|----------|-------------|
138
+ | interval_start | string | yes | Start time of interval (RFC3339) |
139
+ | interval_end | string | yes | End time of interval (RFC3339) |
140
+ | neid | string[] | yes | Named Entity ID(s) in the neighborhood |
141
+
142
+ #### Responses
143
+
144
+ | Status | Description |
145
+ |--------|-------------|
146
+ | 200 | List of mention codes (`GetMentionsResponse`) |
147
+ | 400 | Invalid parameters (`Error`) |
148
+ | 500 | Internal server error (`Error`) |
149
+
150
+ #### Example
151
+
152
+ **Request:**
153
+
154
+ ```
155
+ GET /mentions/lookup?interval_start=2026-01-01T00:00:00Z&interval_end=2026-02-01T00:00:00Z&neid=00416400910670863867
156
+ ```
157
+
158
+ **Response:**
159
+
160
+ ```json
161
+ {"mcodes": [{"neid": "00416400910670863867", "artid": "05433395856363393596"}, {"neid": "00416400910670863867", "artid": "02706389331155211812"}]}
162
+ ```
163
+
164
+ ---
165
+
166
+ ### Get mention counts over time
167
+
168
+ `GET /mentions/lookup/counts`
169
+
170
+ Get bucketed counts of mentions for entities in a neighborhood within a time interval
171
+
172
+ #### Parameters
173
+
174
+ | Name | Type | Required | Description |
175
+ |------|------|----------|-------------|
176
+ | interval_start | string | yes | Start time of interval (RFC3339) |
177
+ | interval_end | string | yes | End time of interval (RFC3339) |
178
+ | neid | string[] | yes | Named Entity ID(s) in the neighborhood |
179
+ | numBuckets | integer | no | Number of time buckets |
180
+
181
+ #### Responses
182
+
183
+ | Status | Description |
184
+ |--------|-------------|
185
+ | 200 | Bucketed mention counts (`GetMentionCountsResponse`) |
186
+ | 400 | Invalid parameters (`Error`) |
187
+ | 500 | Internal server error (`Error`) |
188
+
189
+ #### Example
190
+
191
+ **Request:**
192
+
193
+ ```
194
+ GET /mentions/lookup/counts?interval_start=2026-01-15T00:00:00Z&interval_end=2026-01-20T00:00:00Z&neid=00416400910670863867&numBuckets=5
195
+ ```
196
+
197
+ **Response:**
198
+
199
+ ```json
200
+ {"buckets": [{"start": "2026-01-15T00:00:00Z", "width_hours": 24, "count": 51}, {"start": "2026-01-16T00:00:00Z", "width_hours": 24, "count": 28}]}
201
+ ```
202
+
203
+ ---
204
+
205
+ ### Get mention details for a neighborhood
206
+
207
+ `GET /mentions/lookup/detail`
208
+
209
+ Get detailed information about all mentions for entities in a neighborhood within a time interval. Response is cached for 15 minutes.
210
+
211
+ #### Parameters
212
+
213
+ | Name | Type | Required | Description |
214
+ |------|------|----------|-------------|
215
+ | interval_start | string | yes | Start time of interval (RFC3339) |
216
+ | interval_end | string | yes | End time of interval (RFC3339) |
217
+ | neid | string[] | yes | Named Entity ID(s) in the neighborhood |
218
+
219
+ #### Responses
220
+
221
+ | Status | Description |
222
+ |--------|-------------|
223
+ | 200 | List of mention details (`GetMentionLookupDetailResponse`) |
224
+ | 400 | Invalid parameters (`Error`) |
225
+ | 500 | Internal server error (`Error`) |
226
+
227
+ #### Example
228
+
229
+ **Request:**
230
+
231
+ ```
232
+ GET /mentions/lookup/detail?interval_start=2026-01-28T00:00:00Z&interval_end=2026-01-29T00:00:00Z&neid=00416400910670863867
233
+ ```
234
+
235
+ **Response:**
236
+
237
+ ```json
238
+ {"details": [{"neid": "00416400910670863867", "artid": "06794762728091918955", "publication_date": "2026-01-28T14:01:17Z", "snippet": "...stiff competition from other major players such as YouTube and Apple...", "sentiment": 0, "explanation": "Apple is mentioned as a competitor in the music-streaming market...", "topics": [], "trustworthiness": 0.508, "original_publication_name": "Spotify", "tone": "Neutral", "title_factuality": "True", "tone_objectivity_score": 0.563, "title_factuality_score": 3.889, "events": ["06942391178010057368"]}]}
239
+ ```
240
+
241
+ ---
242
+
243
+ ### Get mention detail
244
+
245
+ `GET /mentions/{mcode}/detail`
246
+
247
+ Get detailed information about a specific mention by its MCODE. Response is cached for 15 minutes.
248
+
249
+ #### Guidance
250
+
251
+ Response is wrapped in a 'detail' container object. Access mention data via response.detail.
252
+
253
+ #### Parameters
254
+
255
+ | Name | Type | Required | Description |
256
+ |------|------|----------|-------------|
257
+ | mcode | string | yes | Mention code in format NEID:ARTID |
258
+
259
+ #### Responses
260
+
261
+ | Status | Description |
262
+ |--------|-------------|
263
+ | 200 | Mention detail (`GetMentionDetailResponse`) |
264
+ | 400 | Invalid MCODE format (`Error`) |
265
+ | 404 | Mention not found (`Error`) |
266
+ | 500 | Internal server error (`Error`) |
267
+
268
+ #### Example
269
+
270
+ **Request:**
271
+
272
+ ```
273
+ GET /mentions/00416400910670863867:05433395856363393596/detail
274
+ ```
275
+
276
+ **Response:**
277
+
278
+ ```json
279
+ {"detail": {"neid": "00416400910670863867", "artid": "05433395856363393596", "publication_date": "2026-01-28T15:56:47Z", "snippet": "Apple CEO Tim Cook said he was 'heartbroken'...", "sentiment": -0.75, "explanation": "CEO Tim Cook expressed heartbreak...", "topics": [], "trustworthiness": 0.664, "original_publication_name": "CNBC", "tone": "neutral", "title_factuality": "accurate", "tone_objectivity_score": 0.533, "title_factuality_score": 7.133, "events": ["07189853443333370710", "07880710486873721498"]}}
280
+ ```
281
+
282
+ ## Types
283
+
284
+ ### ArticleDetail
285
+
286
+ The article detail
287
+
288
+ | Field | Type | Description |
289
+ |-------|------|-------------|
290
+ | artid | string | Article ID |
291
+ | batch | string | Processing batch identifier |
292
+ | events | string[] | Event IDs mentioned in this article |
293
+ | mentions | `Mcode`[] | List of entity mentions in article |
294
+ | moz_rank_score | number | Publisher's Moz rank value (0 to 1) @Minimum 0 @Maximum 1 |
295
+ | original_publication_name | string | Original publication name when known (e.g., when article is syndicated) |
296
+ | page_rank_score | number | Publisher's page rank value (0 to 1) @Minimum 0 @Maximum 1 |
297
+ | publication_date | string | Publication date of the article @Format date-time |
298
+ | publication_home_url | string | Home URL of the publication in which the article was published @Format uri |
299
+ | publication_name | string | Name of the publication in which the article was published |
300
+ | source | string | Article source identifier |
301
+ | summary | string | Article summary |
302
+ | syndication_score | integer | Syndication score indicating article distribution |
303
+ | title | string | Article title |
304
+ | title_factuality | string | Article title factuality classification |
305
+ | title_factuality_score | number | Publisher's title factuality score (0 to 1) @Minimum 0 @Maximum 1 |
306
+ | tone | string | Article tone classification |
307
+ | tone_objectivity_score | number | Publisher's tone objectivity score (0 to 1) @Minimum 0 @Maximum 1 |
308
+ | topics | `ArticleTopic`[] | Topics associated with this article |
309
+ | trustworthiness | number | Trustworthiness score (0 to 1) @Minimum 0 @Maximum 1 |
310
+ | url | string | Original article URL @Format uri |
311
+
312
+ ### GetArticleResponse
313
+
314
+ Response containing detailed information about an article
315
+
316
+ | Field | Type | Description |
317
+ |-------|------|-------------|
318
+ | detail | `ArticleDetail` | |
319
+
320
+ ### GetMentionCountsResponse
321
+
322
+ Response containing bucketed mention counts over time
323
+
324
+ | Field | Type | Description |
325
+ |-------|------|-------------|
326
+ | buckets | `Bucket`[] | Time buckets with mention counts |
327
+
328
+ ### GetMentionDetailResponse
329
+
330
+ Response containing detailed information about a mention
331
+
332
+ | Field | Type | Description |
333
+ |-------|------|-------------|
334
+ | detail | `MentionDetail` | |
335
+
336
+ ### GetMentionLookupDetailResponse
337
+
338
+ Response containing detailed information about multiple mentions
339
+
340
+ | Field | Type | Description |
341
+ |-------|------|-------------|
342
+ | details | `MentionDetail`[] | List of mention details |
343
+
344
+ ### GetMentionsResponse
345
+
346
+ Response containing mention codes for a lookup query
347
+
348
+ | Field | Type | Description |
349
+ |-------|------|-------------|
350
+ | mcodes | `Mcode`[] | List of mention codes (NEID, ARTID pairs) |
351
+
352
+ ### Mcode
353
+
354
+ A tuple of (NEID, ARTID) representing one or more mentions of a Named Entity in an Article
355
+
356
+ | Field | Type | Description |
357
+ |-------|------|-------------|
358
+ | artid | string | Article ID |
359
+ | neid | string | Named Entity ID |
360
+
361
+ ### MentionDetail
362
+
363
+ The mention detail
364
+
365
+ | Field | Type | Description |
366
+ |-------|------|-------------|
367
+ | artid | string | Article ID |
368
+ | events | string[] | Event IDs that this mention is associated with |
369
+ | explanation | string | Explanation of sentiment analysis |
370
+ | moz_rank_score | number | Publisher's Moz rank value (0 to 1) @Minimum 0 @Maximum 1 |
371
+ | neid | string | Named Entity ID |
372
+ | original_publication_name | string | Original publication name when known (e.g., when article is syndicated) |
373
+ | other_neid | string | NEID of the other entity in a relationship mention |
374
+ | other_relation_type | string | Type of relationship with the other entity |
375
+ | page_rank_score | number | Publisher's page rank value (0 to 1) @Minimum 0 @Maximum 1 |
376
+ | publication_date | string | Publication date of the article @Format date-time |
377
+ | sentiment | number | Sentiment score for the mention (-1 to 1) @Minimum -1 @Maximum 1 |
378
+ | snippet | string | Text snippet containing the mention |
379
+ | title_factuality | string | Article title factuality classification |
380
+ | title_factuality_score | number | Publisher's title factuality score (0 to 1) @Minimum 0 @Maximum 1 |
381
+ | tone | string | Article tone classification |
382
+ | tone_objectivity_score | number | Publisher's tone objectivity score (0 to 1) @Minimum 0 @Maximum 1 |
383
+ | topics | `ArticleTopic`[] | Topics associated with the article |
384
+ | trustworthiness | number | Trustworthiness score (0 to 1) @Minimum 0 @Maximum 1 |
385
+
386
+ <!-- END GENERATED CONTENT -->