memex-ai 0.1.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.
- memex_ai-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +37 -0
- memex_ai-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +24 -0
- memex_ai-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +7 -0
- memex_ai-0.1.0/.github/workflows/benchmarks.yml +21 -0
- memex_ai-0.1.0/.github/workflows/ci.yml +37 -0
- memex_ai-0.1.0/.github/workflows/release.yml +41 -0
- memex_ai-0.1.0/.gitignore +22 -0
- memex_ai-0.1.0/CHANGELOG.md +15 -0
- memex_ai-0.1.0/CONTRIBUTING.md +49 -0
- memex_ai-0.1.0/LICENSE +17 -0
- memex_ai-0.1.0/PKG-INFO +545 -0
- memex_ai-0.1.0/README.md +488 -0
- memex_ai-0.1.0/SECURITY.md +15 -0
- memex_ai-0.1.0/benchmarks/bench_memex.py +104 -0
- memex_ai-0.1.0/docs/api.md +30 -0
- memex_ai-0.1.0/docs/architecture.md +22 -0
- memex_ai-0.1.0/examples/anthropic_chatbot.py +33 -0
- memex_ai-0.1.0/examples/basic.py +11 -0
- memex_ai-0.1.0/examples/nodejs_express.js +17 -0
- memex_ai-0.1.0/examples/ollama_local.py +45 -0
- memex_ai-0.1.0/examples/openai_chatbot.py +32 -0
- memex_ai-0.1.0/js/README.md +17 -0
- memex_ai-0.1.0/js/package-lock.json +51 -0
- memex_ai-0.1.0/js/package.json +36 -0
- memex_ai-0.1.0/js/src/browser.ts +2 -0
- memex_ai-0.1.0/js/src/hash.ts +54 -0
- memex_ai-0.1.0/js/src/http.ts +93 -0
- memex_ai-0.1.0/js/src/index.test.ts +29 -0
- memex_ai-0.1.0/js/src/index.ts +236 -0
- memex_ai-0.1.0/js/src/store.ts +68 -0
- memex_ai-0.1.0/js/src/types.ts +46 -0
- memex_ai-0.1.0/js/src/validation.ts +35 -0
- memex_ai-0.1.0/js/tsconfig.json +15 -0
- memex_ai-0.1.0/memex/__init__.py +34 -0
- memex_ai-0.1.0/memex/__main__.py +3 -0
- memex_ai-0.1.0/memex/cli.py +219 -0
- memex_ai-0.1.0/memex/core.py +429 -0
- memex_ai-0.1.0/memex/embedders/__init__.py +57 -0
- memex_ai-0.1.0/memex/embedders/base.py +28 -0
- memex_ai-0.1.0/memex/embedders/hash.py +53 -0
- memex_ai-0.1.0/memex/embedders/openai.py +61 -0
- memex_ai-0.1.0/memex/embedders/sentence.py +110 -0
- memex_ai-0.1.0/memex/errors.py +27 -0
- memex_ai-0.1.0/memex/events.py +39 -0
- memex_ai-0.1.0/memex/extractor.py +119 -0
- memex_ai-0.1.0/memex/integrations/__init__.py +3 -0
- memex_ai-0.1.0/memex/integrations/langchain.py +54 -0
- memex_ai-0.1.0/memex/integrations/llamaindex.py +38 -0
- memex_ai-0.1.0/memex/models.py +99 -0
- memex_ai-0.1.0/memex/server.py +171 -0
- memex_ai-0.1.0/memex/storage.py +663 -0
- memex_ai-0.1.0/memex/utils.py +221 -0
- memex_ai-0.1.0/pyproject.toml +102 -0
- memex_ai-0.1.0/scripts/release.py +22 -0
- memex_ai-0.1.0/test.mjs +7 -0
- memex_ai-0.1.0/tests/benchmarks/test_latency.py +20 -0
- memex_ai-0.1.0/tests/integration/test_cli.py +21 -0
- memex_ai-0.1.0/tests/integration/test_server.py +22 -0
- memex_ai-0.1.0/tests/unit/test_core.py +68 -0
- memex_ai-0.1.0/tests/unit/test_embedders.py +18 -0
- memex_ai-0.1.0/tests/unit/test_extractor.py +16 -0
- memex_ai-0.1.0/tests/unit/test_storage.py +79 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a reproducible memex bug
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: summary
|
|
8
|
+
attributes:
|
|
9
|
+
label: Summary
|
|
10
|
+
description: What happened?
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: reproduce
|
|
15
|
+
attributes:
|
|
16
|
+
label: Reproduction
|
|
17
|
+
description: Minimal code or commands that reproduce the issue.
|
|
18
|
+
render: python
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
21
|
+
- type: input
|
|
22
|
+
id: version
|
|
23
|
+
attributes:
|
|
24
|
+
label: memex version
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
- type: dropdown
|
|
28
|
+
id: platform
|
|
29
|
+
attributes:
|
|
30
|
+
label: Platform
|
|
31
|
+
options:
|
|
32
|
+
- Linux
|
|
33
|
+
- macOS
|
|
34
|
+
- Windows
|
|
35
|
+
- Other
|
|
36
|
+
validations:
|
|
37
|
+
required: true
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest an improvement
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: problem
|
|
8
|
+
attributes:
|
|
9
|
+
label: Problem
|
|
10
|
+
description: What user problem should memex solve?
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: proposal
|
|
15
|
+
attributes:
|
|
16
|
+
label: Proposal
|
|
17
|
+
description: What would you like to change?
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: alternatives
|
|
22
|
+
attributes:
|
|
23
|
+
label: Alternatives
|
|
24
|
+
description: What alternatives did you consider?
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Benchmarks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
paths:
|
|
6
|
+
- "memex/**"
|
|
7
|
+
- "benchmarks/**"
|
|
8
|
+
- "tests/benchmarks/**"
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
benchmark:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- run: python -m pip install --upgrade pip
|
|
20
|
+
- run: pip install -e ".[benchmark]"
|
|
21
|
+
- run: python benchmarks/bench_memex.py --count 1000 --queries 25
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
python:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ matrix.python-version }}
|
|
19
|
+
- run: python -m pip install --upgrade pip
|
|
20
|
+
- run: pip install -e ".[test]" ruff mypy
|
|
21
|
+
- run: ruff check .
|
|
22
|
+
- run: mypy memex
|
|
23
|
+
- run: pytest --cov=memex
|
|
24
|
+
|
|
25
|
+
javascript:
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
- uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: "20"
|
|
32
|
+
- working-directory: js
|
|
33
|
+
run: npm install
|
|
34
|
+
- working-directory: js
|
|
35
|
+
run: npm run typecheck
|
|
36
|
+
- working-directory: js
|
|
37
|
+
run: npm run build
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
python:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
contents: read
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- run: python -m pip install --upgrade pip build
|
|
20
|
+
- run: python -m build
|
|
21
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
22
|
+
|
|
23
|
+
npm:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
permissions:
|
|
26
|
+
id-token: write
|
|
27
|
+
contents: read
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
- uses: actions/setup-node@v4
|
|
31
|
+
with:
|
|
32
|
+
node-version: "20"
|
|
33
|
+
registry-url: "https://registry.npmjs.org"
|
|
34
|
+
- working-directory: js
|
|
35
|
+
run: npm install
|
|
36
|
+
- working-directory: js
|
|
37
|
+
run: npm run build
|
|
38
|
+
- working-directory: js
|
|
39
|
+
run: npm publish --provenance --access public
|
|
40
|
+
env:
|
|
41
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
.mypy_cache/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
.coverage
|
|
8
|
+
htmlcov/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
*.egg-info/
|
|
12
|
+
|
|
13
|
+
node_modules/
|
|
14
|
+
js/node_modules/
|
|
15
|
+
js/dist/
|
|
16
|
+
js/coverage/
|
|
17
|
+
|
|
18
|
+
.DS_Store
|
|
19
|
+
Thumbs.db
|
|
20
|
+
*.db
|
|
21
|
+
*.db-shm
|
|
22
|
+
*.db-wal
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on Keep a Changelog, and this project uses semantic versioning after 0.1.0.
|
|
6
|
+
|
|
7
|
+
## [0.1.0] - Unreleased
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Local-first Python `Memory` API.
|
|
12
|
+
- SQLite storage with optional sqlite-vec acceleration and Python fallback.
|
|
13
|
+
- Deterministic hash embedder plus optional sentence-transformers and OpenAI embedders.
|
|
14
|
+
- CLI, REST server, import/export, pruning, deduplication, and local fact extraction.
|
|
15
|
+
- TypeScript package with local and REST-backed memory clients.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping build memex.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
python -m venv .venv
|
|
9
|
+
. .venv/bin/activate
|
|
10
|
+
pip install -e ".[dev]"
|
|
11
|
+
pytest
|
|
12
|
+
ruff check .
|
|
13
|
+
mypy memex
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
On Windows PowerShell:
|
|
17
|
+
|
|
18
|
+
```powershell
|
|
19
|
+
python -m venv .venv
|
|
20
|
+
.venv\Scripts\Activate.ps1
|
|
21
|
+
pip install -e ".[dev]"
|
|
22
|
+
pytest
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Design principles
|
|
26
|
+
|
|
27
|
+
- Keep the core local-first.
|
|
28
|
+
- Avoid network calls unless users explicitly opt in.
|
|
29
|
+
- Prefer SQLite and small local adapters over external infrastructure.
|
|
30
|
+
- Keep the public API small.
|
|
31
|
+
- Make heavy dependencies optional or lazy.
|
|
32
|
+
- Tests must not download models or require API keys.
|
|
33
|
+
|
|
34
|
+
## Pull requests
|
|
35
|
+
|
|
36
|
+
Please include:
|
|
37
|
+
|
|
38
|
+
- A clear problem statement.
|
|
39
|
+
- Tests for changed behavior.
|
|
40
|
+
- Documentation updates for public API changes.
|
|
41
|
+
- Benchmark notes for storage, embedding, or search changes.
|
|
42
|
+
|
|
43
|
+
## Release checklist
|
|
44
|
+
|
|
45
|
+
1. Update `CHANGELOG.md`.
|
|
46
|
+
2. Run `pytest`, `ruff`, `mypy`, and JS `npm test` when JS changed.
|
|
47
|
+
3. Build Python and npm packages.
|
|
48
|
+
4. Tag `vX.Y.Z`.
|
|
49
|
+
5. Publish from CI with trusted publishing.
|
memex_ai-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 memex contributors
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|