aifbin-lite 1.0.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Terronex.dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,58 @@
1
+ AIF-BIN Lite
2
+ Copyright (c) 2026 Terronex.dev
3
+
4
+ This product includes software developed by Terronex.dev.
5
+
6
+ ================================================================================
7
+ PATENT NOTICE
8
+ ================================================================================
9
+
10
+ The AIF-BIN file format and associated methods for semantic document memory
11
+ are the subject of a pending patent application.
12
+
13
+ This open-source implementation (AIF-BIN Lite) is provided under the MIT
14
+ License, granting you full rights to use, modify, and distribute this
15
+ software for reading and writing AIF-BIN format files.
16
+
17
+ ================================================================================
18
+ TRADEMARK NOTICE
19
+ ================================================================================
20
+
21
+ "AIF-BIN" is a trademark of Terronex.dev.
22
+
23
+ You may use the AIF-BIN name to describe compatibility or interoperability
24
+ with the AIF-BIN format, but you may not use it in a way that suggests
25
+ endorsement by or affiliation with Terronex.dev without permission.
26
+
27
+ ================================================================================
28
+ FORMAT SPECIFICATION
29
+ ================================================================================
30
+
31
+ The AIF-BIN file format specification is provided under the MIT License.
32
+ You are free to implement compatible readers and writers.
33
+
34
+ ================================================================================
35
+ AIF-BIN LITE vs AIF-BIN PRO
36
+ ================================================================================
37
+
38
+ AIF-BIN Lite (this repository):
39
+ - Free and open source (MIT License)
40
+ - Format conversion tools (Markdown → AIMF/AIF-BIN)
41
+ - Chunking, metadata, and file management
42
+ - No AI or embedding functionality
43
+
44
+ AIF-BIN Pro (github.com/Terronex-dev/aifbin-pro):
45
+ - Commercial product
46
+ - Full semantic search with AI embeddings
47
+ - Integration plugins (LangChain, Obsidian, VS Code, etc.)
48
+ - Priority support
49
+
50
+ Lite handles the format. Pro adds the intelligence.
51
+
52
+ ================================================================================
53
+ CONTACT
54
+ ================================================================================
55
+
56
+ For licensing inquiries: legal@terronex.dev
57
+ For general support: support@terronex.dev
58
+ Website: https://terronex.dev
@@ -0,0 +1,362 @@
1
+ Metadata-Version: 2.4
2
+ Name: aifbin-lite
3
+ Version: 1.0.0
4
+ Summary: Free & open source CLI for AIF-BIN files. Convert documents to semantic memory format.
5
+ Author-email: Terronex <terronex.dev@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Terronex-dev/aifbin-lite
8
+ Project-URL: Documentation, https://github.com/Terronex-dev/aifbin-lite#readme
9
+ Project-URL: Repository, https://github.com/Terronex-dev/aifbin-lite.git
10
+ Project-URL: Issues, https://github.com/Terronex-dev/aifbin-lite/issues
11
+ Keywords: ai,memory,semantic-search,aif-bin,document-processing,cli
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: Text Processing
24
+ Requires-Python: >=3.9
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ License-File: NOTICE
28
+ Requires-Dist: msgpack>=1.0.0
29
+ Dynamic: license-file
30
+
31
+ # AIF-BIN Lite
32
+
33
+ **Free & Open Source** CLI for AI memory files.
34
+ [![CI](https://github.com/terronex-dev/aifbin-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/terronex-dev/aifbin-lite/actions/workflows/ci.yml)
35
+
36
+ [![Patent Pending](https://img.shields.io/badge/Patent-Pending-blue.svg)](https://www.terronex.dev)
37
+
38
+ | Version | Extension | Full Name | Format |
39
+ |---------|-----------|-----------|--------|
40
+ | v1 | `.aimf` | AI Memory Format | JSON |
41
+ | v2 | `.aif-bin` | AI Formatted - Binary | Binary (MessagePack) |
42
+
43
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
44
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
45
+
46
+ ---
47
+
48
+ ## Documentation
49
+
50
+ - [Technical Whitepaper](docs/whitepaper.html) - Full specification and theory
51
+
52
+ ## What is AIF-BIN?
53
+
54
+ A file format specification with two versions:
55
+ - **AIMF** (.aimf) - AI Memory Format, v1 JSON encoding for simplicity
56
+ - **AIF-BIN** (.aif-bin) - AI Formatted - Binary, v2 binary encoding for performance
57
+
58
+ A single `.aimf` or `.aif-bin` file contains:
59
+
60
+ - **Original document** — The source file preserved
61
+ - **Extracted content** — Text parsed into searchable chunks
62
+ - **Metadata** — Title, timestamps, checksums
63
+
64
+ This is the **free, open source** implementation. For semantic search, batch processing, see [AIF-BIN Pro](https://github.com/Terronex-dev/aifbin-pro).
65
+
66
+ ---
67
+
68
+ ## Format Versions
69
+
70
+ This repository contains both format versions:
71
+
72
+ | Version | Extension | File | Full Name | Format |
73
+ |---------|-----------|------|-----------|--------|
74
+ | **v1** | `.aimf` | `aifbin_v1.py` | AI Memory Format | JSON |
75
+ | **v2** | `.aif-bin` | `aifbin_v2.py` | AI Formatted - Binary | Binary (MessagePack) |
76
+
77
+ ### AIMF - AI Memory Format (v1)
78
+
79
+ Simple, human-readable JSON. Uses `.aimf` extension. Great for learning and debugging.
80
+
81
+ ```json
82
+ {
83
+ "version": "1.0.0-lite",
84
+ "format": "json",
85
+ "metadata": {
86
+ "source_file": "sample.md",
87
+ "created_at": "2026-01-30T10:00:00"
88
+ },
89
+ "chunks": [
90
+ {"id": 0, "content": "...", "type": "text"}
91
+ ],
92
+ "original_raw": "# Original content..."
93
+ }
94
+ ```
95
+
96
+ ### AIF-BIN - AI Formatted - Binary (v2)
97
+
98
+ Compact binary format with MessagePack encoding. Uses `.aif-bin` extension. Used by AIF-BIN Pro.
99
+
100
+ ```
101
+ [Header: 64 bytes]
102
+ Magic: "AIFBIN\x00\x01"
103
+ Version, Offsets, Size
104
+
105
+ [Metadata Section]
106
+ MessagePack blob
107
+
108
+ [Original Raw Section]
109
+ Preserved source file
110
+
111
+ [Content Chunks]
112
+ Typed chunks with optional embeddings
113
+
114
+ [Footer]
115
+ Index + CRC64 Checksum
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Installation
121
+
122
+ ```bash
123
+ # Clone the repo
124
+ git clone https://github.com/Terronex-dev/aifbin-lite.git
125
+ cd aifbin-lite
126
+ ```
127
+
128
+ ### Windows (PowerShell/CMD)
129
+
130
+ ```powershell
131
+ # Install dependencies
132
+ pip install -r requirements.txt
133
+
134
+ # v1 - No external dependencies needed, but included in requirements for simplicity
135
+ python aifbin_v1.py --help
136
+
137
+ # v2
138
+ python aifbin_v2.py --help
139
+ ```
140
+
141
+ ### Linux / macOS / WSL
142
+
143
+ ```bash
144
+ # Install dependencies
145
+ pip3 install -r requirements.txt
146
+
147
+ # v1 - No external dependencies needed, but included in requirements for simplicity
148
+ python3 aifbin_v1.py --help
149
+
150
+ # v2
151
+ python3 aifbin_v2.py --help
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Usage
157
+
158
+ ### AIMF Commands (aifbin_v1.py)
159
+
160
+ **Windows:**
161
+ ```powershell
162
+ python aifbin_v1.py migrate sample.md # Convert to AIMF (JSON)
163
+ python aifbin_v1.py info sample.aimf # View file info
164
+ python aifbin_v1.py chunks sample.aimf # List chunks
165
+ python aifbin_v1.py extract sample.aimf # Extract original content
166
+ ```
167
+
168
+ **Linux / macOS / WSL:**
169
+ ```bash
170
+ python3 aifbin_v1.py migrate sample.md # Convert to AIMF (JSON)
171
+ python3 aifbin_v1.py info sample.aimf # View file info
172
+ python3 aifbin_v1.py chunks sample.aimf # List chunks
173
+ python3 aifbin_v1.py extract sample.aimf # Extract original content
174
+ ```
175
+
176
+ ### AIF-BIN Commands (aifbin_v2.py)
177
+
178
+ **Windows:**
179
+ ```powershell
180
+ python aifbin_v2.py migrate sample.md # Convert to AIF-BIN (binary)
181
+ python aifbin_v2.py info sample.aif-bin # View file info
182
+ python aifbin_v2.py chunks sample.aif-bin # List chunks
183
+ python aifbin_v2.py extract sample.aif-bin # Extract original content
184
+ python aifbin_v2.py upgrade sample.aimf # Upgrade v1 to v2
185
+ ```
186
+
187
+ **Linux / macOS / WSL:**
188
+ ```bash
189
+ python3 aifbin_v2.py migrate sample.md # Convert to AIF-BIN (binary)
190
+ python3 aifbin_v2.py info sample.aif-bin # View file info
191
+ python3 aifbin_v2.py chunks sample.aif-bin # List chunks
192
+ python3 aifbin_v2.py extract sample.aif-bin # Extract original content
193
+ python3 aifbin_v2.py upgrade sample.aimf # Upgrade v1 to v2
194
+ ```
195
+
196
+ ---
197
+
198
+ ## Troubleshooting
199
+
200
+ ### `error: externally-managed-environment` (Debian/Ubuntu/WSL)
201
+
202
+ This error occurs when `pip` tries to install packages system-wide in environments where Python packages are managed by the OS.
203
+
204
+ **Solution 1:** Use the `--break-system-packages` flag:
205
+ ```bash
206
+ pip3 install -r requirements.txt --break-system-packages
207
+ ```
208
+
209
+ **Solution 2 (Recommended):** Use a Python virtual environment:
210
+ ```bash
211
+ python3 -m venv .venv
212
+ source .venv/bin/activate
213
+ pip install -r requirements.txt
214
+ python3 aifbin_v2.py --help
215
+ # Deactivate when done:
216
+ deactivate
217
+ ```
218
+
219
+ ### `python3` not found on Windows
220
+
221
+ On Windows, use `python` instead of `python3`:
222
+ ```powershell
223
+ python aifbin_v1.py --help
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Migrating from AIMF to AIF-BIN
229
+
230
+ ### Why Migrate?
231
+
232
+ - **50% smaller files** — Binary format is more compact
233
+ - **Faster parsing** — Fixed-offset headers enable direct seeks
234
+ - **Checksums** — CRC64 verification for data integrity
235
+ - **Embeddings** — AIF-BIN supports vector embeddings for semantic search
236
+ - **Typed chunks** — TEXT, TABLE, IMAGE, AUDIO, VIDEO, CODE
237
+
238
+ ### How to Migrate
239
+
240
+ **Option 1: Using the CLI (Recommended)**
241
+
242
+ ```bash
243
+ # Windows
244
+ python aifbin_v2.py upgrade sample.aimf -o sample.aif-bin
245
+
246
+ # Linux / macOS / WSL
247
+ python3 aifbin_v2.py upgrade sample.aimf -o sample.aif-bin
248
+ ```
249
+
250
+ **Option 2: Programmatically**
251
+
252
+ ```python
253
+ from aifbin_v2 import migrate_from_v1
254
+
255
+ migrate_from_v1('sample.aimf', 'sample.aif-bin')
256
+ ```
257
+
258
+ See `examples/migrate_v1_to_v2.py` for a complete migration script.
259
+
260
+ ---
261
+
262
+ ## Examples
263
+
264
+ | File | Description |
265
+ |------|-------------|
266
+ | `examples/quickstart_v1.py` | Basic v1 usage |
267
+ | `examples/quickstart_v2.py` | Basic v2 usage |
268
+ | `examples/migrate_v1_to_v2.py` | Migration script |
269
+
270
+ ---
271
+
272
+ ## Related Projects
273
+
274
+ | Project | Description |
275
+ |---------|-------------|
276
+ | [AIF-BIN Lite](https://github.com/Terronex-dev/aifbin-lite) | Free CLI (this repo) |
277
+ | [AIF-BIN Pro](https://github.com/Terronex-dev/aifbin-pro) | Pro CLI + Inspector |
278
+
279
+ ---
280
+
281
+ ## Lite vs Pro
282
+
283
+ **AIF-BIN Lite** (this repo) handles the **format** — converting your documents into portable, structured files.
284
+
285
+ **AIF-BIN Pro** adds the **intelligence** — AI-powered semantic search that lets you query your documents by meaning, not just keywords.
286
+
287
+ ```
288
+ ┌─────────────────────────────────────────────────────────────┐
289
+ │ Your Documents │
290
+ │ (Markdown, notes, docs) │
291
+ └─────────────────────────────────────────────────────────────┘
292
+
293
+
294
+ ┌─────────────────────────────────────────────────────────────┐
295
+ │ AIF-BIN Lite (Free) │
296
+ │ │
297
+ │ ✓ Convert to .aimf (JSON) or .aif-bin (binary) │
298
+ │ ✓ Chunking and metadata extraction │
299
+ │ ✓ Portable files you own │
300
+ │ ✗ No search — just format conversion │
301
+ └─────────────────────────────────────────────────────────────┘
302
+
303
+
304
+ ┌─────────────────────────────────────────────────────────────┐
305
+ │ AIF-BIN Pro (Paid) │
306
+ │ │
307
+ │ ✓ Everything in Lite, plus: │
308
+ │ ✓ AI embeddings (text → vectors) │
309
+ │ ✓ Semantic search ("What did I decide about X?") │
310
+ │ ✓ Plugins (LangChain, Obsidian, VS Code, etc.) │
311
+ └─────────────────────────────────────────────────────────────┘
312
+ ```
313
+
314
+ ### Why This Architecture?
315
+
316
+ - **Your data stays portable.** Lite files work anywhere, with or without Pro.
317
+ - **No vendor lock-in.** The format spec is open (MIT). Build your own tools if you want.
318
+ - **Pay for intelligence, not storage.** Lite is free forever. Pro adds the AI layer.
319
+
320
+ ### Ready to Upgrade?
321
+
322
+ [AIF-BIN Pro](https://github.com/Terronex-dev/aifbin-pro) includes:
323
+
324
+ - **Semantic search** — Find by meaning, not keywords
325
+ - **Batch processing** — Convert entire directories
326
+ - **Watch mode** — Auto-sync on file changes
327
+ - **Web Inspector** — Visual file analyzer
328
+ - **5 embedding models** — OpenAI, Cohere, local options
329
+
330
+ ---
331
+
332
+ ## Legal
333
+
334
+ | Document | Description |
335
+ |----------|-------------|
336
+ | [LICENSE](LICENSE) | MIT License — free to use, modify, distribute |
337
+ | [NOTICE](NOTICE) | Patent, trademark, and Lite vs Pro details |
338
+ | [TERMS](legal/TERMS.md) | Terms of use |
339
+ | [PRIVACY](legal/PRIVACY.md) | Privacy policy (TL;DR: no data collection) |
340
+ | [SECURITY](SECURITY.md) | Security policy and vulnerability reporting |
341
+
342
+ **Patent Pending:** The AIF-BIN format and methods are subject to a pending patent application. This open-source implementation is provided under the MIT License.
343
+
344
+ **Trademark:** "AIF-BIN" is a trademark of Terronex.dev. You may use it to describe format compatibility.
345
+
346
+ ---
347
+
348
+ ## Links
349
+
350
+ - Website: [terronex.dev/aifbin](https://terronex.dev/aifbin/)
351
+ - Pro: [github.com/Terronex-dev/aifbin-pro](https://github.com/Terronex-dev/aifbin-pro)
352
+ - Support: support@terronex.dev
353
+
354
+ ---
355
+
356
+ ## Contributing
357
+
358
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md).
359
+
360
+ ---
361
+
362
+ (c) 2026 Terronex.dev. All rights reserved.