@heripo/research-radar 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/LICENSE ADDED
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright (c) 2025-present kimhongyeon
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,60 @@
1
+ Heripo Research Radar
2
+ Copyright (c) 2025-present kimhongyeon
3
+
4
+ This project is licensed under the Apache License 2.0.
5
+ See LICENSE file for full license text.
6
+
7
+ This project is built on top of @llm-newsletter-kit/core and serves as both
8
+ a production service and a reference implementation for the LLM Newsletter Kit.
9
+
10
+ ===============================================================================
11
+
12
+ ATTRIBUTION REQUIREMENT
13
+
14
+ If you fork this project to build your own newsletter service or create
15
+ derivative works based on this code, you must include the following
16
+ attribution notice:
17
+
18
+ "Powered by LLM Newsletter Kit"
19
+
20
+ This notice should be included in at least one of the following locations:
21
+ - In your newsletter's HTML template footer
22
+ - In your service's documentation or website
23
+ - In your application's user interface (e.g., footer, about page)
24
+
25
+ For compliance with Section 4(d) of the Apache License 2.0, this attribution
26
+ notice must be retained in derivative works.
27
+
28
+ ===============================================================================
29
+
30
+ TRADEMARK NOTICE
31
+
32
+ The following names, marks, and logos are trademarks of kimhongyeon:
33
+ - "heripo" and "헤리포"
34
+ - "Research Radar" and "리서치 레이더"
35
+ - The heripo logo and associated visual designs
36
+ - Domain name: heripo.com
37
+
38
+ While the source code is freely available under the Apache 2.0 license,
39
+ use of these trademarks requires explicit permission from the trademark owner.
40
+
41
+ If you fork or modify this project for your own use, please:
42
+ 1. Replace all instances of "heripo" with your own brand name
43
+ 2. Replace the logo images with your own
44
+ 3. Update the domain references to your own
45
+ 4. Update branding in templates and configuration files
46
+
47
+ Example implementations are welcome to use this code, but should establish
48
+ their own brand identity.
49
+
50
+ For permission to use the "heripo" trademark, contact the project maintainer
51
+ via GitHub: https://github.com/kimhongyeon/heripo-research-radar/issues
52
+
53
+ ===============================================================================
54
+
55
+ DEPENDENCIES
56
+
57
+ This software depends on @llm-newsletter-kit/core, which is also licensed
58
+ under the Apache License 2.0.
59
+
60
+ For third-party dependencies, see package.json.
package/README.md ADDED
@@ -0,0 +1,216 @@
1
+ # Heripo Research Radar
2
+
3
+ English | [한국어](./README-ko.md)
4
+
5
+ [![CI](https://github.com/kimhongyeon/heripo-research-radar/actions/workflows/ci.yml/badge.svg)](https://github.com/kimhongyeon/heripo-research-radar/actions/workflows/ci.yml)
6
+ [
7
+ ![npm version](https://img.shields.io/npm/v/%40heripo%2Fresearch-radar?logo=npm&color=cb0000)
8
+ ](https://www.npmjs.com/package/@heripo/research-radar)
9
+ ![license](https://img.shields.io/github/license/kimhongyeon/heripo-research-radar)
10
+ ![node](https://img.shields.io/badge/node-%3E%3D22-brightgreen)
11
+
12
+ [Code of Conduct](./CODE_OF_CONDUCT.md) • [Security Policy](./SECURITY.md) • [Contributing](./CONTRIBUTING.md)
13
+
14
+ ## What is this?
15
+
16
+ An AI-powered newsletter service for Korean cultural heritage. Built on [`@llm-newsletter-kit/core`](https://github.com/kimhongyeon/llm-newsletter-kit-core), it's both a production service ([live at heripo.com](https://heripo.com/research-radar/subscribe)) and a reference implementation showing how to build automated newsletters with LLMs.
17
+
18
+ **Production metrics**:
19
+ - **Cost**: $0.2-1 USD per issue
20
+ - **Operation**: Fully autonomous 24/7 (no human intervention)
21
+ - **Engagement**: 15% CTR
22
+
23
+ **Technical highlights**:
24
+ - Type-safe TypeScript with strict interfaces
25
+ - Provider pattern for swapping components (Crawling/Analysis/Content/Email)
26
+ - 62 crawling targets across heritage agencies, museums, academic societies
27
+ - LLM-driven analysis (GPT-5 models)
28
+ - Built-in retries, chain options, preview emails
29
+
30
+ **Links**: [Live service](https://heripo.com/research-radar/subscribe) • [Newsletter example](https://heripo.com/research-radar-newsletter-example.html) • [Core engine](https://github.com/kimhongyeon/llm-newsletter-kit-core)
31
+
32
+ ## Background
33
+
34
+ Created by archaeologist-turned-engineer Hongyeon Kim to answer: "Why must research rely on labor-intensive manual work?"
35
+
36
+ A personal script evolved into a production service after completing research on [Archaeological Informatization Using LLMs](https://poc.heripo.com). This repository open-sources the running service so developers can build domain-specific newsletters without starting from scratch.
37
+
38
+ ## License
39
+
40
+ Apache License 2.0 — see [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for details.
41
+
42
+ ## Citation & Attribution
43
+
44
+ If you fork this project to build your own newsletter service or use this code in your research, please include the following attribution:
45
+
46
+ ```
47
+ Powered by LLM Newsletter Kit
48
+ ```
49
+
50
+ We recommend adding this notice to your newsletter template footer or service documentation. This attribution helps support the project and its continued development.
51
+
52
+ ### BibTeX Citation
53
+
54
+ For academic publications:
55
+
56
+ ```bibtex
57
+ @software{llm_newsletter_kit,
58
+ author = {Kim, Hongyeon},
59
+ title = {LLM Newsletter Kit: AI-Powered Newsletter Automation Framework},
60
+ year = {2025},
61
+ url = {https://github.com/kimhongyeon/heripo-research-radar},
62
+ note = {Apache License 2.0}
63
+ }
64
+ ```
65
+
66
+ ## Installation
67
+
68
+ ```bash
69
+ npm install @heripo/research-radar @llm-newsletter-kit/core
70
+ ```
71
+
72
+ **Requirements**: Node.js >= 22, OpenAI API key
73
+
74
+ **Note**: `@llm-newsletter-kit/core` is a peer dependency and must be installed separately.
75
+
76
+ ## Quick Start
77
+
78
+ ```typescript
79
+ import { generateNewsletter } from '@heripo/research-radar';
80
+
81
+ const newsletterId = await generateNewsletter({
82
+ openAIApiKey: process.env.OPENAI_API_KEY,
83
+
84
+ // Implement these repository interfaces (see src/types/dependencies.ts)
85
+ taskRepository: {
86
+ createTask: async () => db.tasks.create({ status: 'running' }),
87
+ completeTask: async (id) => db.tasks.update(id, { status: 'completed' }),
88
+ },
89
+
90
+ articleRepository: {
91
+ findByUrls: async (urls) => db.articles.findByUrls(urls),
92
+ saveCrawledArticles: async (articles, ctx) => db.articles.save(articles, ctx),
93
+ findUnscoredArticles: async () => db.articles.findUnscored(),
94
+ updateAnalysis: async (article) => db.articles.updateAnalysis(article),
95
+ findCandidatesForNewsletter: async () => db.articles.findCandidates(),
96
+ },
97
+
98
+ tagRepository: {
99
+ findAllTags: async () => db.tags.findAll(),
100
+ },
101
+
102
+ newsletterRepository: {
103
+ getNextIssueOrder: async () => db.newsletters.getNextOrder(),
104
+ saveNewsletter: async (data) => db.newsletters.save(data),
105
+ },
106
+
107
+ // Optional: Custom logger and preview
108
+ logger: console,
109
+ previewNewsletter: {
110
+ fetchNewsletterForPreview: async () => db.newsletters.latest(),
111
+ emailService: resendEmailService,
112
+ emailMessage: { from: 'news@example.com', to: 'preview@example.com' },
113
+ },
114
+ });
115
+ ```
116
+
117
+ **Repository interfaces** are defined in `src/types/dependencies.ts`. Each method signature includes JSDoc with expected input/output types.
118
+
119
+ ## Architecture
120
+
121
+ **Pipeline**: Crawling → Analysis → Content Generation → Save
122
+
123
+ 1. **Crawling**: Fetch articles from target websites
124
+ 2. **Analysis**: LLM tags and scores articles
125
+ 3. **Generation**: Create newsletter from top-scoring articles
126
+ 4. **Save**: Store and optionally send preview email
127
+
128
+ Uses the **Provider-Service pattern** from `@llm-newsletter-kit/core`. See [core docs](https://github.com/kimhongyeon/llm-newsletter-kit-core#architecture--flow) for flow diagrams.
129
+
130
+ ## Components
131
+
132
+ **Config** (`src/config/`): Brand, language, LLM settings
133
+
134
+ **Targets** (`src/config/crawling-targets.ts`): 62 sources (News 49, Business 4, Employment 9)
135
+
136
+ **Parsers** (`src/parsers/`): Custom extractors per organization
137
+
138
+ **Template** (`src/templates/newsletter-html.ts`): Responsive email with light/dark mode
139
+
140
+ ## Development commands
141
+
142
+ ```bash
143
+ # build
144
+ npm run build # clean dist/ and build with Rollup (CJS + ESM + types)
145
+
146
+ # type-check & lint
147
+ npm run lint # lint source files
148
+ npm run lint:fix # lint with autofix
149
+ npm run typecheck # TypeScript type-check
150
+
151
+ # formatting
152
+ npm run format # Prettier formatting
153
+ ```
154
+
155
+ ## 🤝 Contributing
156
+
157
+ You can use this project in two ways:
158
+
159
+ 1. Contribute directly to Heripo Research Radar: bug fixes, improvements, new crawl targets
160
+ 2. Build your own newsletter: fork this repo and adapt it to your domain
161
+
162
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for contribution workflow, dev setup, and PR guidelines.
163
+
164
+ ## Forking for Your Domain
165
+
166
+ To build your own newsletter, update these files:
167
+
168
+ **1. Template** (`src/templates/newsletter-html.ts`):
169
+ - Logo URLs, brand colors (#D2691E, #E59866), contact info
170
+ - Platform intro and footer text
171
+ - Unsubscribe link format (currently Resend's `{{{RESEND_UNSUBSCRIBE_URL}}}`)
172
+
173
+ **2. Config** (`src/config/index.ts`):
174
+ ```typescript
175
+ brandName: 'Your Newsletter Name'
176
+ subscribeUrl: 'https://yourdomain.com/subscribe'
177
+ ```
178
+
179
+ **3. Crawling targets** (`src/config/crawling-targets.ts`):
180
+ - Replace Korean heritage sites with your domain sources
181
+ - Implement parsers in `src/parsers/`
182
+
183
+ **4. Switch LLM provider** (optional):
184
+
185
+ To use Anthropic/Gemini/Ollama instead of OpenAI:
186
+ - `src/newsletter-generator.ts`: Change `createOpenAI()` to your provider
187
+ - `src/providers/analysis.provider.ts`: Update model names (currently `gpt-5-mini`, `gpt-5.1`)
188
+ - `src/providers/content-generate.provider.ts`: Update model name
189
+
190
+ Any [Vercel AI SDK provider](https://sdk.vercel.ai/providers) works.
191
+
192
+ **Search keywords**: `heripo`, `kimhongyeon`, `#D2691E`, `openai`, `gpt-5`
193
+
194
+ ## Why Code-Based?
195
+
196
+ Code-based automation delivers **superior output quality** through advanced AI techniques:
197
+
198
+ **No-code platforms**: Generic content, limited to built-in features
199
+ **This kit**: Self-reflection, chain-of-thought, multi-step verification workflows
200
+
201
+ **Key advantages**:
202
+ - **Quality**: Sophisticated prompting strategies, custom validation pipelines
203
+ - **Cost control**: Different models per step, token limits, retry logic
204
+ - **Flexibility**: Swap any component (Crawling/Analysis/Content/Email) via Provider interfaces
205
+ - **Operations**: Built-in retries, preview emails, integrates with CI/CD
206
+ - **No lock-in**: OSS, self-hostable, any LLM provider
207
+
208
+ **Design philosophy**:
209
+ - Logic in code (orchestration, deduplication)
210
+ - Reasoning in AI (analysis, scoring, content generation)
211
+ - Connections in architecture (swappable Providers)
212
+
213
+ ## Related Projects
214
+
215
+ - [`@llm-newsletter-kit/core`](https://github.com/kimhongyeon/llm-newsletter-kit-core) — Domain-agnostic newsletter engine
216
+ - [Archaeological Informatization Using LLMs](https://poc.heripo.com) — Academic research (Korean)