Skip to main content

Professional AI memory management with semantic search. Full-featured CLI for AIF-BIN files.

Project description

AIF-BIN Pro CLI

Professional command-line toolkit for semantic document memory.

CI Patent Pending License: MIT Python 3.9+


What is AIF-BIN Pro?

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.

Key Features:

  • Semantic Search — Query your documents by meaning
  • Real Embeddings — 384/768-dimension vectors with 5 model options
  • Batch Processing — Parallel conversion of entire directories
  • Watch Mode — Auto-sync on file changes
  • AI Extraction — Use Claude, GPT-4, Gemini, or Ollama for intelligent parsing
  • Multiple Exports — JSON, CSV, Markdown, HTML

Installation

Clone the Repository

git clone https://github.com/Terronex-dev/aifbin-pro.git
cd aifbin-pro

Using the Wrapper Script

For convenience, a wrapper script is provided. Make it executable first:

chmod +x aifbin-pro

Now you can run the CLI directly:

# Verify installation
./aifbin-pro --help

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.

Optional: Virtual Environment (Recommended)

# Create virtual environment
python3 -m venv .venv

# Activate it
source .venv/bin/activate      # Linux/macOS/WSL
.venv\Scripts\activate         # Windows PowerShell

# Install dependencies
pip install -r requirements.txt

# Run
python cli/aifbin_pro.py --help

Quick Start

A sample.md file is included for testing.

# Convert the sample file to AIF-BIN with embeddings
./aifbin-pro migrate sample.md -o output/

# Search your memories semantically
./aifbin-pro search "project decisions" -d output/

# View file info
./aifbin-pro info output/sample.aif-bin

# Extract original content
./aifbin-pro extract output/sample.aif-bin

Commands

Command Description
migrate Convert files to AIF-BIN (v2 binary format) with embeddings
search Semantic search across your memory files
info Show file metadata, chunks, and model info
extract Recover original content from AIF-BIN
export Export to JSON, CSV, Markdown, or HTML
watch Auto-sync directory on file changes
diff Compare two AIF-BIN files
models List available embedding models
providers List AI providers for intelligent extraction
ingest Convert any file with AI extraction
config Configure AI provider API keys

Command Examples

Migrate (Convert Files)

# Single file
./aifbin-pro migrate document.md -o output/

# Entire directory
./aifbin-pro migrate notes/ -o output/

# Recursive with parallel processing
./aifbin-pro migrate notes/ -o output/ -r -p

# Use a different embedding model
./aifbin-pro migrate notes/ -o output/ -m bge-small

Search (Semantic Query)

# Basic search
./aifbin-pro search "budget decisions" -d output/

# Get more results
./aifbin-pro search "project timeline" -d output/ -k 10

# Filter by date
./aifbin-pro search "meeting notes" -d output/ --after 2026-01-01

Watch (Auto-Sync)

# Watch a directory and auto-convert changes
./aifbin-pro watch notes/ -o output/

# Custom check interval (seconds)
./aifbin-pro watch notes/ -o output/ -i 10

Export (Convert to Other Formats)

./aifbin-pro export file.aif-bin -o output.json -f json
./aifbin-pro export file.aif-bin -o output.csv -f csv
./aifbin-pro export file.aif-bin -o output.md -f markdown
./aifbin-pro export file.aif-bin -o output.html -f html

Ingest (AI-Powered Extraction)

# Configure an AI provider first
./aifbin-pro config --provider anthropic --api-key sk-ant-...

# Ingest files with AI extraction
./aifbin-pro ingest documents/ -o output/ -p anthropic

# Use local Ollama (no API key needed)
./aifbin-pro ingest documents/ -o output/ -p ollama

Embedding Models

Model Dimensions Speed Description
minilm 384 Fast Good quality (default)
mpnet 768 Slow Higher quality
bge-small 384 Fast Optimized for retrieval
bge-base 768 Slow Best quality retrieval
e5-small 384 Fast Microsoft E5

List available models:

./aifbin-pro models

AI Providers (for ingest command)

Provider API Key Required Best For
anthropic Yes Documents, analysis
openai Yes General purpose
gemini Yes Images, PDFs (vision)
ollama No (local) Privacy, offline use
none No Basic text extraction

Configure providers:

# Set API key
./aifbin-pro config --provider anthropic --api-key sk-ant-...

# Set default provider
./aifbin-pro config --default anthropic

# View current config
./aifbin-pro config

List available providers:

./aifbin-pro providers

File Format

AIF-BIN v2 is a compact binary format with:

  • MessagePack encoding (~50% smaller than JSON)
  • Fixed-offset headers for fast parsing
  • Embedded CRC64 checksums
  • Vector embeddings for semantic search
  • Original content preservation
[Header: 64 bytes]
  Magic: "AIFBIN\x00\x01"
  Version, Offsets, Size

[Metadata Section]
  MessagePack blob

[Original Raw Section]
  Preserved source file

[Content Chunks]
  Typed chunks with embeddings

[Footer]
  Index + Checksum

Troubleshooting

error: externally-managed-environment (Debian/Ubuntu/WSL)

# Option 1: Use --break-system-packages
pip3 install -r requirements.txt --break-system-packages

# Option 2: Use a virtual environment (recommended)
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

ModuleNotFoundError: No module named 'sentence_transformers'

You may need to install the project's dependencies.

pip install -r requirements.txt

Ollama connection refused

Make sure Ollama is running:

# Start Ollama server
ollama serve

# Pull a model if needed
ollama pull llama3.1:8b

Related Projects

Project Description
AIF-BIN Lite Free CLI (format conversion only, no embeddings)

Privacy & Security

  • Local-first: All processing happens on your machine
  • No telemetry: We don't collect usage data
  • BYO API keys: Use your own AI provider credentials
  • Open format: AIF-BIN files are portable, no vendor lock-in

Legal

  • AIF-BIN™ is a trademark of Terronex.dev
  • Licensed under the MIT License (see LICENSE)
  • See NOTICE for patent and trademark information

Links


© 2026 Terronex.dev. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aifbin_pro-1.0.0.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aifbin_pro-1.0.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file aifbin_pro-1.0.0.tar.gz.

File metadata

  • Download URL: aifbin_pro-1.0.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aifbin_pro-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e63ad030793e1da39949ed37c07e689e9c17a1b8d22b4c46c7520bedda203f62
MD5 3ad7a971443939cae1ffa6a57ac72b6d
BLAKE2b-256 b39d8fc8dec2bf4cea02a2a74713e04b934f66a834f568ec1b029809a3855f1d

See more details on using hashes here.

File details

Details for the file aifbin_pro-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: aifbin_pro-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aifbin_pro-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17b9b93234ff1ec936579b16c521a736e0185549e2fba2c5ad6f1c3ff8089869
MD5 a9cafc2b3d3c6ac6b467b3e9905ee31b
BLAKE2b-256 d389425cb1fd2c899cf15a17211c5f11508c6ce1dfe314374c6684d150f2760d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page