Metadata-Version: 2.4
Name: augmem.cortext
Version: 1.1.6
Summary: Python bindings for the Cortext memory engine
Author: augmem
License: Apache-2.0
Project-URL: Homepage, https://github.com/augmem/cortext
Project-URL: Repository, https://github.com/augmem/cortext
Project-URL: Issues, https://github.com/augmem/cortext/issues
Keywords: memory,retrieval,embeddings,llm,agents
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# augmem.cortext Python Binding

This package loads the native Cortext shared library with `ctypes`. Release
wheels are built with bundled Zig-produced native libraries for:

- `linux-x86_64`
- `linux-aarch64`
- `macos-x86_64`
- `macos-aarch64`
- `windows-x86_64`
- `windows-aarch64`

## Build

For a local source build without bundled native libraries, build the shared
library from the repository root:

```bash
cmake --preset ffi-release
cmake --build --preset ffi-release --target cortext
```

Set `CORTEXT_LIBRARY_PATH=/path/to/libcortext.so` when loading a non-default
library.

To build the release wheel with bundled native libraries:

```bash
python scripts/build_python_package.py
```

Set `ZIG=/path/to/zig` or pass `--zig /path/to/zig` when Zig is not on `PATH`.

## Use

```bash
PYTHONPATH=bindings/python python3 - <<'PY'
import augmem.cortext as cortext

with cortext.Cortext(db_path=":memory:", models_dir="models") as engine:
    print(cortext.version())
    print(engine.process_text("Bailey likes tennis balls.", "chat/main"))
    print(len(engine.embed_text("embed without storing")))
    engine.consolidate()
    engine.flush()
PY
```

## API

- `Config`: `focus`, `sensitivity`, `stability`,
  `affect_interrupt`, `affect_retrieval`, `reinforcement_enabled`,
  `procedural_enabled`, `sequential_edges_enabled`,
  `signal_filter_audio_enabled`, `signal_filter_image_enabled`,
  `signal_filter_text_enabled`.
- `Cortext.process_text`, `process_audio`, `process_image`: return decoded JSON
  context dictionaries.
- `Cortext.process_*_json`: return raw JSON strings.
- `Cortext.embed_text`, `embed_audio`, `embed_image`: return embedding lists and
  do not mutate memory state.
- `Cortext.consolidate`, `flush`, `reset`, `close`.
- `DBProvider` and `ObjectStoreProvider`: callback interfaces for caller-owned
  storage.

Audio input is 16 kHz mono float32 PCM. Image input is row-major RGB/RGBA bytes
with explicit dimensions.
