Aemory is a high-performance Data Compiler for RAG (Retrieval-Augmented Generation), written in Rust with Python bindings. It efficiently compiles Markdown knowledge bases into vector-searchable Lance datasets.
pip install aemory
Pre-built wheels are available for:
Note: x86/ARMv7 (Linux) and ARM64 (Windows) are temporarily disabled due to:
- x86: Upstream compilation issue in lance-core 2.0.1 on i686
- ARMv7: Upstream compilation issue in lance-core 2.0.1
- Windows ARM64: GitHub Actions Python installation instability
# Install maturin for building the python extension
pip install maturin
# Build and install in current environment
maturin develop --release
Note: Building from source requires the Rust toolchain. The protoc (Protocol Buffers compiler) is automatically downloaded by the build script.
This project uses a balanced Cargo release profile optimized for CI environments while maintaining good runtime performance:
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 4
strip = true
debug = false
incremental = false
Why this configuration:
opt-level = 3: Maximum optimizations for speedlto = "thin": Cost-effective link-time optimization (vs. destructive fat LTO)codegen-units = 4: Allows parallel code generation to fit CI memory constraintsstrip = true: Remove debug symbols to reduce binary sizeincremental = false: Disable incremental compilation in release buildsCompile your markdown files into a vector index.
import aemory
# Build the dataset
aemory.build(
input="./knowledge_base",
output="./data.lance",
model="sentence-transformers/all-MiniLM-L6-v2"
)
Retrieve relevant context for your LLM.
results = aemory.search(
uri="./data.lance",
query="How does the compiler work?",
limit=3,
model="sentence-transformers/all-MiniLM-L6-v2"
)
for r in results:
print(f"[{r['score']:.4f}] {r['content']}")
See example/test_search.py for a complete working example.
Aemory uses BERT-based models compatible with Candle. Recommended models:
sentence-transformers/all-MiniLM-L6-v2 (lightweight, 80MB)BAAI/bge-small-en-v1.5 (English, 130MB)BAAI/bge-base-en-v1.5 (English, better quality, 440MB)Models are automatically downloaded from Hugging Face Hub on first use.
Aemory operates as a compiler pipeline:
This project is licensed under the MIT License - see the LICENSE file for details.
22 commits
Rust
64.9%
Python
35.1%
Aemory is a high-performance Data Compiler for RAG (Retrieval-Augmented Generation), written in Rust with Python bindings. It efficiently compiles Markdown knowledge bases into vector-searchable Lance datasets.
pip install aemory
Pre-built wheels are available for:
Note: x86/ARMv7 (Linux) and ARM64 (Windows) are temporarily disabled due to:
- x86: Upstream compilation issue in lance-core 2.0.1 on i686
- ARMv7: Upstream compilation issue in lance-core 2.0.1
- Windows ARM64: GitHub Actions Python installation instability
# Install maturin for building the python extension
pip install maturin
# Build and install in current environment
maturin develop --release
Note: Building from source requires the Rust toolchain. The protoc (Protocol Buffers compiler) is automatically downloaded by the build script.
This project uses a balanced Cargo release profile optimized for CI environments while maintaining good runtime performance:
[profile.release]
opt-level = 3
lto = "thin"
codegen-units = 4
strip = true
debug = false
incremental = false
Why this configuration:
opt-level = 3: Maximum optimizations for speedlto = "thin": Cost-effective link-time optimization (vs. destructive fat LTO)codegen-units = 4: Allows parallel code generation to fit CI memory constraintsstrip = true: Remove debug symbols to reduce binary sizeincremental = false: Disable incremental compilation in release buildsCompile your markdown files into a vector index.
import aemory
# Build the dataset
aemory.build(
input="./knowledge_base",
output="./data.lance",
model="sentence-transformers/all-MiniLM-L6-v2"
)
Retrieve relevant context for your LLM.
results = aemory.search(
uri="./data.lance",
query="How does the compiler work?",
limit=3,
model="sentence-transformers/all-MiniLM-L6-v2"
)
for r in results:
print(f"[{r['score']:.4f}] {r['content']}")
See example/test_search.py for a complete working example.
Aemory uses BERT-based models compatible with Candle. Recommended models:
sentence-transformers/all-MiniLM-L6-v2 (lightweight, 80MB)BAAI/bge-small-en-v1.5 (English, 130MB)BAAI/bge-base-en-v1.5 (English, better quality, 440MB)Models are automatically downloaded from Hugging Face Hub on first use.
Aemory operates as a compiler pipeline:
This project is licensed under the MIT License - see the LICENSE file for details.
22 commits
Rust
64.9%
Python
35.1%