aifbin-pro 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.
- aifbin_pro-1.0.0/LICENSE +21 -0
- aifbin_pro-1.0.0/NOTICE +13 -0
- aifbin_pro-1.0.0/PKG-INFO +358 -0
- aifbin_pro-1.0.0/README.md +320 -0
- aifbin_pro-1.0.0/aifbin_pro.egg-info/PKG-INFO +358 -0
- aifbin_pro-1.0.0/aifbin_pro.egg-info/SOURCES.txt +13 -0
- aifbin_pro-1.0.0/aifbin_pro.egg-info/dependency_links.txt +1 -0
- aifbin_pro-1.0.0/aifbin_pro.egg-info/entry_points.txt +2 -0
- aifbin_pro-1.0.0/aifbin_pro.egg-info/requires.txt +9 -0
- aifbin_pro-1.0.0/aifbin_pro.egg-info/top_level.txt +1 -0
- aifbin_pro-1.0.0/cli/__init__.py +5 -0
- aifbin_pro-1.0.0/cli/aifbin_pro.py +1220 -0
- aifbin_pro-1.0.0/cli/aifbin_spec_v2.py +482 -0
- aifbin_pro-1.0.0/pyproject.toml +53 -0
- aifbin_pro-1.0.0/setup.cfg +4 -0
aifbin_pro-1.0.0/LICENSE
ADDED
|
@@ -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.
|
aifbin_pro-1.0.0/NOTICE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
AIF-BIN™ and AIF-BIN Pro™ are trademarks of Terronex.dev.
|
|
2
|
+
|
|
3
|
+
Copyright © 2026 Terronex.dev. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This repository contains open-source code licensed under the MIT License
|
|
6
|
+
(see LICENSE file).
|
|
7
|
+
|
|
8
|
+
The AIF-BIN file format specification and related trademarks remain the
|
|
9
|
+
property of Terronex.dev. Commercial use of the AIF-BIN name or format
|
|
10
|
+
in competing products requires written permission.
|
|
11
|
+
|
|
12
|
+
For licensing inquiries: legal@terronex.dev
|
|
13
|
+
Website: https://terronex.dev
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aifbin-pro
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Professional AI memory management with semantic search. Full-featured CLI for AIF-BIN files.
|
|
5
|
+
Author-email: Terronex <terronex.dev@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Terronex-dev/aifbin-pro
|
|
8
|
+
Project-URL: Documentation, https://github.com/Terronex-dev/aifbin-pro#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/Terronex-dev/aifbin-pro.git
|
|
10
|
+
Project-URL: Issues, https://github.com/Terronex-dev/aifbin-pro/issues
|
|
11
|
+
Keywords: ai,memory,semantic-search,embeddings,aif-bin,rag,vector-database
|
|
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 :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
License-File: NOTICE
|
|
28
|
+
Requires-Dist: sentence-transformers>=2.2.0
|
|
29
|
+
Requires-Dist: numpy>=1.21.0
|
|
30
|
+
Requires-Dist: msgpack>=1.0.0
|
|
31
|
+
Requires-Dist: huggingface_hub>=0.20.0
|
|
32
|
+
Requires-Dist: anthropic>=0.18.0
|
|
33
|
+
Requires-Dist: openai>=1.0.0
|
|
34
|
+
Requires-Dist: google-generativeai>=0.3.0
|
|
35
|
+
Requires-Dist: requests>=2.28.0
|
|
36
|
+
Requires-Dist: Pillow>=9.0.0
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# AIF-BIN Pro CLI
|
|
40
|
+
|
|
41
|
+
**Professional command-line toolkit for semantic document memory.**
|
|
42
|
+
|
|
43
|
+
[](https://github.com/terronex-dev/aifbin-pro/actions/workflows/ci.yml)
|
|
44
|
+
[](https://www.terronex.dev)
|
|
45
|
+
[](LICENSE)
|
|
46
|
+
[](https://www.python.org/downloads/)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## What is AIF-BIN Pro?
|
|
51
|
+
|
|
52
|
+
AIF-BIN Pro is a command-line tool for converting documents into searchable AI memory files. It generates real vector embeddings for semantic search — find content by meaning, not just keywords.
|
|
53
|
+
|
|
54
|
+
**Key Features:**
|
|
55
|
+
- **Semantic Search** — Query your documents by meaning
|
|
56
|
+
- **Real Embeddings** — 384/768-dimension vectors with 5 model options
|
|
57
|
+
- **Batch Processing** — Parallel conversion of entire directories
|
|
58
|
+
- **Watch Mode** — Auto-sync on file changes
|
|
59
|
+
- **AI Extraction** — Use Claude, GPT-4, Gemini, or Ollama for intelligent parsing
|
|
60
|
+
- **Multiple Exports** — JSON, CSV, Markdown, HTML
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
### Clone the Repository
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
git clone https://github.com/Terronex-dev/aifbin-pro.git
|
|
70
|
+
cd aifbin-pro
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Using the Wrapper Script
|
|
74
|
+
|
|
75
|
+
For convenience, a wrapper script is provided. Make it executable first:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
chmod +x aifbin-pro
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Now you can run the CLI directly:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Verify installation
|
|
85
|
+
./aifbin-pro --help
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The examples below will use this wrapper. If you prefer, you can still run `python3 cli/aifbin_pro.py` or `python cli/aifbin_pro.py`.
|
|
89
|
+
|
|
90
|
+
### Optional: Virtual Environment (Recommended)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Create virtual environment
|
|
94
|
+
python3 -m venv .venv
|
|
95
|
+
|
|
96
|
+
# Activate it
|
|
97
|
+
source .venv/bin/activate # Linux/macOS/WSL
|
|
98
|
+
.venv\Scripts\activate # Windows PowerShell
|
|
99
|
+
|
|
100
|
+
# Install dependencies
|
|
101
|
+
pip install -r requirements.txt
|
|
102
|
+
|
|
103
|
+
# Run
|
|
104
|
+
python cli/aifbin_pro.py --help
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Quick Start
|
|
110
|
+
|
|
111
|
+
A `sample.md` file is included for testing.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Convert the sample file to AIF-BIN with embeddings
|
|
115
|
+
./aifbin-pro migrate sample.md -o output/
|
|
116
|
+
|
|
117
|
+
# Search your memories semantically
|
|
118
|
+
./aifbin-pro search "project decisions" -d output/
|
|
119
|
+
|
|
120
|
+
# View file info
|
|
121
|
+
./aifbin-pro info output/sample.aif-bin
|
|
122
|
+
|
|
123
|
+
# Extract original content
|
|
124
|
+
./aifbin-pro extract output/sample.aif-bin
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Commands
|
|
130
|
+
|
|
131
|
+
| Command | Description |
|
|
132
|
+
|---------|-------------|
|
|
133
|
+
| `migrate` | Convert files to AIF-BIN (v2 binary format) with embeddings |
|
|
134
|
+
| `search` | Semantic search across your memory files |
|
|
135
|
+
| `info` | Show file metadata, chunks, and model info |
|
|
136
|
+
| `extract` | Recover original content from AIF-BIN |
|
|
137
|
+
| `export` | Export to JSON, CSV, Markdown, or HTML |
|
|
138
|
+
| `watch` | Auto-sync directory on file changes |
|
|
139
|
+
| `diff` | Compare two AIF-BIN files |
|
|
140
|
+
| `models` | List available embedding models |
|
|
141
|
+
| `providers` | List AI providers for intelligent extraction |
|
|
142
|
+
| `ingest` | Convert any file with AI extraction |
|
|
143
|
+
| `config` | Configure AI provider API keys |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Command Examples
|
|
148
|
+
|
|
149
|
+
### Migrate (Convert Files)
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Single file
|
|
153
|
+
./aifbin-pro migrate document.md -o output/
|
|
154
|
+
|
|
155
|
+
# Entire directory
|
|
156
|
+
./aifbin-pro migrate notes/ -o output/
|
|
157
|
+
|
|
158
|
+
# Recursive with parallel processing
|
|
159
|
+
./aifbin-pro migrate notes/ -o output/ -r -p
|
|
160
|
+
|
|
161
|
+
# Use a different embedding model
|
|
162
|
+
./aifbin-pro migrate notes/ -o output/ -m bge-small
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Search (Semantic Query)
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Basic search
|
|
169
|
+
./aifbin-pro search "budget decisions" -d output/
|
|
170
|
+
|
|
171
|
+
# Get more results
|
|
172
|
+
./aifbin-pro search "project timeline" -d output/ -k 10
|
|
173
|
+
|
|
174
|
+
# Filter by date
|
|
175
|
+
./aifbin-pro search "meeting notes" -d output/ --after 2026-01-01
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Watch (Auto-Sync)
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Watch a directory and auto-convert changes
|
|
182
|
+
./aifbin-pro watch notes/ -o output/
|
|
183
|
+
|
|
184
|
+
# Custom check interval (seconds)
|
|
185
|
+
./aifbin-pro watch notes/ -o output/ -i 10
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Export (Convert to Other Formats)
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
./aifbin-pro export file.aif-bin -o output.json -f json
|
|
192
|
+
./aifbin-pro export file.aif-bin -o output.csv -f csv
|
|
193
|
+
./aifbin-pro export file.aif-bin -o output.md -f markdown
|
|
194
|
+
./aifbin-pro export file.aif-bin -o output.html -f html
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Ingest (AI-Powered Extraction)
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Configure an AI provider first
|
|
201
|
+
./aifbin-pro config --provider anthropic --api-key sk-ant-...
|
|
202
|
+
|
|
203
|
+
# Ingest files with AI extraction
|
|
204
|
+
./aifbin-pro ingest documents/ -o output/ -p anthropic
|
|
205
|
+
|
|
206
|
+
# Use local Ollama (no API key needed)
|
|
207
|
+
./aifbin-pro ingest documents/ -o output/ -p ollama
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Embedding Models
|
|
213
|
+
|
|
214
|
+
| Model | Dimensions | Speed | Description |
|
|
215
|
+
|-------|------------|-------|-------------|
|
|
216
|
+
| `minilm` | 384 | Fast | Good quality (default) |
|
|
217
|
+
| `mpnet` | 768 | Slow | Higher quality |
|
|
218
|
+
| `bge-small` | 384 | Fast | Optimized for retrieval |
|
|
219
|
+
| `bge-base` | 768 | Slow | Best quality retrieval |
|
|
220
|
+
| `e5-small` | 384 | Fast | Microsoft E5 |
|
|
221
|
+
|
|
222
|
+
List available models:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
./aifbin-pro models
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## AI Providers (for `ingest` command)
|
|
231
|
+
|
|
232
|
+
| Provider | API Key Required | Best For |
|
|
233
|
+
|----------|------------------|----------|
|
|
234
|
+
| `anthropic` | Yes | Documents, analysis |
|
|
235
|
+
| `openai` | Yes | General purpose |
|
|
236
|
+
| `gemini` | Yes | Images, PDFs (vision) |
|
|
237
|
+
| `ollama` | No (local) | Privacy, offline use |
|
|
238
|
+
| `none` | No | Basic text extraction |
|
|
239
|
+
|
|
240
|
+
Configure providers:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Set API key
|
|
244
|
+
./aifbin-pro config --provider anthropic --api-key sk-ant-...
|
|
245
|
+
|
|
246
|
+
# Set default provider
|
|
247
|
+
./aifbin-pro config --default anthropic
|
|
248
|
+
|
|
249
|
+
# View current config
|
|
250
|
+
./aifbin-pro config
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
List available providers:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
./aifbin-pro providers
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## File Format
|
|
262
|
+
|
|
263
|
+
AIF-BIN v2 is a compact binary format with:
|
|
264
|
+
- MessagePack encoding (~50% smaller than JSON)
|
|
265
|
+
- Fixed-offset headers for fast parsing
|
|
266
|
+
- Embedded CRC64 checksums
|
|
267
|
+
- Vector embeddings for semantic search
|
|
268
|
+
- Original content preservation
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
[Header: 64 bytes]
|
|
272
|
+
Magic: "AIFBIN\x00\x01"
|
|
273
|
+
Version, Offsets, Size
|
|
274
|
+
|
|
275
|
+
[Metadata Section]
|
|
276
|
+
MessagePack blob
|
|
277
|
+
|
|
278
|
+
[Original Raw Section]
|
|
279
|
+
Preserved source file
|
|
280
|
+
|
|
281
|
+
[Content Chunks]
|
|
282
|
+
Typed chunks with embeddings
|
|
283
|
+
|
|
284
|
+
[Footer]
|
|
285
|
+
Index + Checksum
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Troubleshooting
|
|
291
|
+
|
|
292
|
+
### `error: externally-managed-environment` (Debian/Ubuntu/WSL)
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Option 1: Use --break-system-packages
|
|
296
|
+
pip3 install -r requirements.txt --break-system-packages
|
|
297
|
+
|
|
298
|
+
# Option 2: Use a virtual environment (recommended)
|
|
299
|
+
python3 -m venv .venv
|
|
300
|
+
source .venv/bin/activate
|
|
301
|
+
pip install -r requirements.txt
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### `ModuleNotFoundError: No module named 'sentence_transformers'`
|
|
305
|
+
|
|
306
|
+
You may need to install the project's dependencies.
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
pip install -r requirements.txt
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Ollama connection refused
|
|
313
|
+
|
|
314
|
+
Make sure Ollama is running:
|
|
315
|
+
```bash
|
|
316
|
+
# Start Ollama server
|
|
317
|
+
ollama serve
|
|
318
|
+
|
|
319
|
+
# Pull a model if needed
|
|
320
|
+
ollama pull llama3.1:8b
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Related Projects
|
|
326
|
+
|
|
327
|
+
| Project | Description |
|
|
328
|
+
|---------|-------------|
|
|
329
|
+
| [AIF-BIN Lite](https://github.com/Terronex-dev/aifbin-lite) | Free CLI (format conversion only, no embeddings) |
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Privacy & Security
|
|
334
|
+
|
|
335
|
+
- **Local-first:** All processing happens on your machine
|
|
336
|
+
- **No telemetry:** We don't collect usage data
|
|
337
|
+
- **BYO API keys:** Use your own AI provider credentials
|
|
338
|
+
- **Open format:** AIF-BIN files are portable, no vendor lock-in
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Legal
|
|
343
|
+
|
|
344
|
+
- **AIF-BIN™** is a trademark of Terronex.dev
|
|
345
|
+
- Licensed under the **MIT License** (see [LICENSE](LICENSE))
|
|
346
|
+
- See [NOTICE](NOTICE) for patent and trademark information
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Links
|
|
351
|
+
|
|
352
|
+
- **Website:** [terronex.dev/aifbin](https://terronex.dev/aifbin/)
|
|
353
|
+
- **Support:** support@terronex.dev
|
|
354
|
+
- **Twitter:** [@terronexdev](https://x.com/terronexdev)
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
© 2026 Terronex.dev. All rights reserved.
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# AIF-BIN Pro CLI
|
|
2
|
+
|
|
3
|
+
**Professional command-line toolkit for semantic document memory.**
|
|
4
|
+
|
|
5
|
+
[](https://github.com/terronex-dev/aifbin-pro/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.terronex.dev)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://www.python.org/downloads/)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## What is AIF-BIN Pro?
|
|
13
|
+
|
|
14
|
+
AIF-BIN Pro is a command-line tool for converting documents into searchable AI memory files. It generates real vector embeddings for semantic search — find content by meaning, not just keywords.
|
|
15
|
+
|
|
16
|
+
**Key Features:**
|
|
17
|
+
- **Semantic Search** — Query your documents by meaning
|
|
18
|
+
- **Real Embeddings** — 384/768-dimension vectors with 5 model options
|
|
19
|
+
- **Batch Processing** — Parallel conversion of entire directories
|
|
20
|
+
- **Watch Mode** — Auto-sync on file changes
|
|
21
|
+
- **AI Extraction** — Use Claude, GPT-4, Gemini, or Ollama for intelligent parsing
|
|
22
|
+
- **Multiple Exports** — JSON, CSV, Markdown, HTML
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### Clone the Repository
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
git clone https://github.com/Terronex-dev/aifbin-pro.git
|
|
32
|
+
cd aifbin-pro
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Using the Wrapper Script
|
|
36
|
+
|
|
37
|
+
For convenience, a wrapper script is provided. Make it executable first:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
chmod +x aifbin-pro
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Now you can run the CLI directly:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Verify installation
|
|
47
|
+
./aifbin-pro --help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The examples below will use this wrapper. If you prefer, you can still run `python3 cli/aifbin_pro.py` or `python cli/aifbin_pro.py`.
|
|
51
|
+
|
|
52
|
+
### Optional: Virtual Environment (Recommended)
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Create virtual environment
|
|
56
|
+
python3 -m venv .venv
|
|
57
|
+
|
|
58
|
+
# Activate it
|
|
59
|
+
source .venv/bin/activate # Linux/macOS/WSL
|
|
60
|
+
.venv\Scripts\activate # Windows PowerShell
|
|
61
|
+
|
|
62
|
+
# Install dependencies
|
|
63
|
+
pip install -r requirements.txt
|
|
64
|
+
|
|
65
|
+
# Run
|
|
66
|
+
python cli/aifbin_pro.py --help
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
A `sample.md` file is included for testing.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Convert the sample file to AIF-BIN with embeddings
|
|
77
|
+
./aifbin-pro migrate sample.md -o output/
|
|
78
|
+
|
|
79
|
+
# Search your memories semantically
|
|
80
|
+
./aifbin-pro search "project decisions" -d output/
|
|
81
|
+
|
|
82
|
+
# View file info
|
|
83
|
+
./aifbin-pro info output/sample.aif-bin
|
|
84
|
+
|
|
85
|
+
# Extract original content
|
|
86
|
+
./aifbin-pro extract output/sample.aif-bin
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Commands
|
|
92
|
+
|
|
93
|
+
| Command | Description |
|
|
94
|
+
|---------|-------------|
|
|
95
|
+
| `migrate` | Convert files to AIF-BIN (v2 binary format) with embeddings |
|
|
96
|
+
| `search` | Semantic search across your memory files |
|
|
97
|
+
| `info` | Show file metadata, chunks, and model info |
|
|
98
|
+
| `extract` | Recover original content from AIF-BIN |
|
|
99
|
+
| `export` | Export to JSON, CSV, Markdown, or HTML |
|
|
100
|
+
| `watch` | Auto-sync directory on file changes |
|
|
101
|
+
| `diff` | Compare two AIF-BIN files |
|
|
102
|
+
| `models` | List available embedding models |
|
|
103
|
+
| `providers` | List AI providers for intelligent extraction |
|
|
104
|
+
| `ingest` | Convert any file with AI extraction |
|
|
105
|
+
| `config` | Configure AI provider API keys |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Command Examples
|
|
110
|
+
|
|
111
|
+
### Migrate (Convert Files)
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Single file
|
|
115
|
+
./aifbin-pro migrate document.md -o output/
|
|
116
|
+
|
|
117
|
+
# Entire directory
|
|
118
|
+
./aifbin-pro migrate notes/ -o output/
|
|
119
|
+
|
|
120
|
+
# Recursive with parallel processing
|
|
121
|
+
./aifbin-pro migrate notes/ -o output/ -r -p
|
|
122
|
+
|
|
123
|
+
# Use a different embedding model
|
|
124
|
+
./aifbin-pro migrate notes/ -o output/ -m bge-small
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Search (Semantic Query)
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Basic search
|
|
131
|
+
./aifbin-pro search "budget decisions" -d output/
|
|
132
|
+
|
|
133
|
+
# Get more results
|
|
134
|
+
./aifbin-pro search "project timeline" -d output/ -k 10
|
|
135
|
+
|
|
136
|
+
# Filter by date
|
|
137
|
+
./aifbin-pro search "meeting notes" -d output/ --after 2026-01-01
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Watch (Auto-Sync)
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Watch a directory and auto-convert changes
|
|
144
|
+
./aifbin-pro watch notes/ -o output/
|
|
145
|
+
|
|
146
|
+
# Custom check interval (seconds)
|
|
147
|
+
./aifbin-pro watch notes/ -o output/ -i 10
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Export (Convert to Other Formats)
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
./aifbin-pro export file.aif-bin -o output.json -f json
|
|
154
|
+
./aifbin-pro export file.aif-bin -o output.csv -f csv
|
|
155
|
+
./aifbin-pro export file.aif-bin -o output.md -f markdown
|
|
156
|
+
./aifbin-pro export file.aif-bin -o output.html -f html
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Ingest (AI-Powered Extraction)
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Configure an AI provider first
|
|
163
|
+
./aifbin-pro config --provider anthropic --api-key sk-ant-...
|
|
164
|
+
|
|
165
|
+
# Ingest files with AI extraction
|
|
166
|
+
./aifbin-pro ingest documents/ -o output/ -p anthropic
|
|
167
|
+
|
|
168
|
+
# Use local Ollama (no API key needed)
|
|
169
|
+
./aifbin-pro ingest documents/ -o output/ -p ollama
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Embedding Models
|
|
175
|
+
|
|
176
|
+
| Model | Dimensions | Speed | Description |
|
|
177
|
+
|-------|------------|-------|-------------|
|
|
178
|
+
| `minilm` | 384 | Fast | Good quality (default) |
|
|
179
|
+
| `mpnet` | 768 | Slow | Higher quality |
|
|
180
|
+
| `bge-small` | 384 | Fast | Optimized for retrieval |
|
|
181
|
+
| `bge-base` | 768 | Slow | Best quality retrieval |
|
|
182
|
+
| `e5-small` | 384 | Fast | Microsoft E5 |
|
|
183
|
+
|
|
184
|
+
List available models:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
./aifbin-pro models
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## AI Providers (for `ingest` command)
|
|
193
|
+
|
|
194
|
+
| Provider | API Key Required | Best For |
|
|
195
|
+
|----------|------------------|----------|
|
|
196
|
+
| `anthropic` | Yes | Documents, analysis |
|
|
197
|
+
| `openai` | Yes | General purpose |
|
|
198
|
+
| `gemini` | Yes | Images, PDFs (vision) |
|
|
199
|
+
| `ollama` | No (local) | Privacy, offline use |
|
|
200
|
+
| `none` | No | Basic text extraction |
|
|
201
|
+
|
|
202
|
+
Configure providers:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Set API key
|
|
206
|
+
./aifbin-pro config --provider anthropic --api-key sk-ant-...
|
|
207
|
+
|
|
208
|
+
# Set default provider
|
|
209
|
+
./aifbin-pro config --default anthropic
|
|
210
|
+
|
|
211
|
+
# View current config
|
|
212
|
+
./aifbin-pro config
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
List available providers:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
./aifbin-pro providers
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## File Format
|
|
224
|
+
|
|
225
|
+
AIF-BIN v2 is a compact binary format with:
|
|
226
|
+
- MessagePack encoding (~50% smaller than JSON)
|
|
227
|
+
- Fixed-offset headers for fast parsing
|
|
228
|
+
- Embedded CRC64 checksums
|
|
229
|
+
- Vector embeddings for semantic search
|
|
230
|
+
- Original content preservation
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
[Header: 64 bytes]
|
|
234
|
+
Magic: "AIFBIN\x00\x01"
|
|
235
|
+
Version, Offsets, Size
|
|
236
|
+
|
|
237
|
+
[Metadata Section]
|
|
238
|
+
MessagePack blob
|
|
239
|
+
|
|
240
|
+
[Original Raw Section]
|
|
241
|
+
Preserved source file
|
|
242
|
+
|
|
243
|
+
[Content Chunks]
|
|
244
|
+
Typed chunks with embeddings
|
|
245
|
+
|
|
246
|
+
[Footer]
|
|
247
|
+
Index + Checksum
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Troubleshooting
|
|
253
|
+
|
|
254
|
+
### `error: externally-managed-environment` (Debian/Ubuntu/WSL)
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Option 1: Use --break-system-packages
|
|
258
|
+
pip3 install -r requirements.txt --break-system-packages
|
|
259
|
+
|
|
260
|
+
# Option 2: Use a virtual environment (recommended)
|
|
261
|
+
python3 -m venv .venv
|
|
262
|
+
source .venv/bin/activate
|
|
263
|
+
pip install -r requirements.txt
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### `ModuleNotFoundError: No module named 'sentence_transformers'`
|
|
267
|
+
|
|
268
|
+
You may need to install the project's dependencies.
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
pip install -r requirements.txt
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Ollama connection refused
|
|
275
|
+
|
|
276
|
+
Make sure Ollama is running:
|
|
277
|
+
```bash
|
|
278
|
+
# Start Ollama server
|
|
279
|
+
ollama serve
|
|
280
|
+
|
|
281
|
+
# Pull a model if needed
|
|
282
|
+
ollama pull llama3.1:8b
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Related Projects
|
|
288
|
+
|
|
289
|
+
| Project | Description |
|
|
290
|
+
|---------|-------------|
|
|
291
|
+
| [AIF-BIN Lite](https://github.com/Terronex-dev/aifbin-lite) | Free CLI (format conversion only, no embeddings) |
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Privacy & Security
|
|
296
|
+
|
|
297
|
+
- **Local-first:** All processing happens on your machine
|
|
298
|
+
- **No telemetry:** We don't collect usage data
|
|
299
|
+
- **BYO API keys:** Use your own AI provider credentials
|
|
300
|
+
- **Open format:** AIF-BIN files are portable, no vendor lock-in
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Legal
|
|
305
|
+
|
|
306
|
+
- **AIF-BIN™** is a trademark of Terronex.dev
|
|
307
|
+
- Licensed under the **MIT License** (see [LICENSE](LICENSE))
|
|
308
|
+
- See [NOTICE](NOTICE) for patent and trademark information
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Links
|
|
313
|
+
|
|
314
|
+
- **Website:** [terronex.dev/aifbin](https://terronex.dev/aifbin/)
|
|
315
|
+
- **Support:** support@terronex.dev
|
|
316
|
+
- **Twitter:** [@terronexdev](https://x.com/terronexdev)
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
© 2026 Terronex.dev. All rights reserved.
|