Skip to content

Commit d7038f6

Browse files
authored
Merge pull request #67 from rryam/feature/extract-mlx-to-separate-repo
Extract VecturaMLXKit into separate repository
2 parents dbaaca2 + e1ec5a3 commit d7038f6

File tree

9 files changed

+22
-1034
lines changed

9 files changed

+22
-1034
lines changed

.vscode/launch.json

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,6 @@
2020
"configuration": "release",
2121
"preLaunchTask": "swift: Build Release vectura-cli"
2222
},
23-
{
24-
"type": "swift",
25-
"request": "launch",
26-
"args": [],
27-
"cwd": "${workspaceFolder:VecturaKit}",
28-
"name": "Debug vectura-mlx-cli",
29-
"target": "vectura-mlx-cli",
30-
"configuration": "debug",
31-
"preLaunchTask": "swift: Build Debug vectura-mlx-cli"
32-
},
33-
{
34-
"type": "swift",
35-
"request": "launch",
36-
"args": [],
37-
"cwd": "${workspaceFolder:VecturaKit}",
38-
"name": "Release vectura-mlx-cli",
39-
"target": "vectura-mlx-cli",
40-
"configuration": "release",
41-
"preLaunchTask": "swift: Build Release vectura-mlx-cli"
42-
},
4323
{
4424
"type": "swift",
4525
"request": "launch",
@@ -60,26 +40,6 @@
6040
"configuration": "release",
6141
"preLaunchTask": "swift: Build Release TestNLExamples"
6242
},
63-
{
64-
"type": "swift",
65-
"request": "launch",
66-
"args": [],
67-
"cwd": "${workspaceFolder:VecturaKit}",
68-
"name": "Debug TestMLXExamples",
69-
"target": "TestMLXExamples",
70-
"configuration": "debug",
71-
"preLaunchTask": "swift: Build Debug TestMLXExamples"
72-
},
73-
{
74-
"type": "swift",
75-
"request": "launch",
76-
"args": [],
77-
"cwd": "${workspaceFolder:VecturaKit}",
78-
"name": "Release TestMLXExamples",
79-
"target": "TestMLXExamples",
80-
"configuration": "release",
81-
"preLaunchTask": "swift: Build Release TestMLXExamples"
82-
},
8343
{
8444
"type": "swift",
8545
"request": "launch",
@@ -101,4 +61,4 @@
10161
"preLaunchTask": "swift: Build Release TestExamples"
10262
}
10363
]
104-
}
64+
}

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Repository Guidelines
22

33
## Project Structure & Module Organization
4-
VecturaKit ships as a Swift package with libraries `VecturaKit` (core storage + hybrid search) and `VecturaMLXKit` (MLX embeddings), plus CLI targets `VecturaCLI` and `VecturaMLXCLI`. CLI entry points sit in `Sources/VecturaCLI` and `Sources/VecturaMLXCLI`; sample executables live in `Sources/TestExamples` and `Sources/TestMLXExamples`. Tests mirror the split under `Tests/VecturaKitTests` and `Tests/VecturaMLXKitTests`; keep features scoped to the relevant module so MLX stays opt-in.
4+
VecturaKit ships as a Swift package with libraries `VecturaKit` (core storage + hybrid search) and `VecturaNLKit` (NaturalLanguage embeddings), plus CLI target `VecturaCLI`. The CLI entry point sits in `Sources/VecturaCLI`; sample executables live in `Sources/TestExamples` and `Sources/TestNLExamples`. Tests live under `Tests/VecturaKitTests` and `Tests/VecturaNLKitTests`. MLX support has been extracted to a separate repository at [rryam/VecturaMLXKit](https://github.com/rryam/VecturaMLXKit).
55

66
## Build, Test, and Development Commands
77
- `swift build` compiles libraries and executables (add `-c release` for performance validation).
8-
- `swift run vectura-cli mock --db-name demo-db` seeds and exercises the default engine; swap `vectura-mlx-cli` to cover MLX.
8+
- `swift run vectura-cli mock --db-name demo-db` seeds and exercises the default engine.
99
- `swift test` runs the Swift Testing suites; add `--filter SuiteName/TestName` to narrow scope.
1010
- `swift package update` refreshes dependency pins before release branches or large upgrades.
1111

1212
## Coding Style & Naming Conventions
1313
Follow Swift 6 defaults: two-space indentation, trailing commas in multi-line literals, and a 120-character soft wrap. Keep types UpperCamelCase, members lowerCamelCase, and CLI command enums verb-based (`case add`, `case search`). Use the existing async/await APIs, isolate file IO in helpers, and document public entry points with concise `///` comments.
1414

1515
## Testing Guidelines
16-
Declare new Swift Testing suites with `@Suite` and `@Test` annotations, keeping test functions `async throws` and cleaning up resources explicitly within each test. Prefer per-test temporary directories over `~/Documents/VecturaKit`, and short-circuit MLX flows when Metal or device libraries are unavailable. Do not introduce new `XCTestCase` subclasses—Swift Testing is the required framework going forward. When touching MLX flows, cover them in `VecturaMLXKitTests` and include at least one CLI invocation; update `codemagic.yaml` whenever the CI matrix or steps change.
16+
Declare new Swift Testing suites with `@Suite` and `@Test` annotations, keeping test functions `async throws` and cleaning up resources explicitly within each test. Prefer per-test temporary directories over `~/Documents/VecturaKit`. Do not introduce new `XCTestCase` subclasses—Swift Testing is the required framework going forward. Update `codemagic.yaml` whenever the CI matrix or steps change.
1717

1818
## Commit & Pull Request Guidelines
1919
Commits stay imperative and scoped (`Add cosine similarity guard`, `Adjust CLI mock seed`). Keep dependency bumps isolated with matching `Package.resolved` updates. Pull requests should outline intent, summarize functional impact, and describe verification steps—attach CLI output when behavior changes. Link issues with `Fixes #<id>` and confirm CI before requesting review.
@@ -22,7 +22,7 @@ Commits stay imperative and scoped (`Add cosine similarity guard`, `Adjust CLI m
2222
Before opening a PR (or completing an automated change):
2323

2424
- [ ] `swift build` and `swift test` succeed locally without warnings.
25-
- [ ] Run `swift run vectura-cli mock --db-name qa-db` (and the `vectura-mlx-cli` variant when MLX code changes) to ensure smoke coverage.
25+
- [ ] Run `swift run vectura-cli mock --db-name qa-db` to ensure smoke coverage.
2626
- [ ] Persistent storage defaults and dimension negotiation stay intact—verify hybrid search thresholds and expected `VecturaError.dimensionMismatch` behavior.
2727
- [ ] Public API or CLI flag changes are reflected in `README.md`, `codemagic.yaml`, and this guide.
2828
- [ ] Remove temporary database artifacts from `~/Documents/VecturaKit` so tests stay deterministic.

Package.swift

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 6.1
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -17,10 +17,6 @@ let package = Package(
1717
name: "VecturaKit",
1818
targets: ["VecturaKit"]
1919
),
20-
.library(
21-
name: "VecturaMLXKit",
22-
targets: ["VecturaMLXKit"]
23-
),
2420
.library(
2521
name: "VecturaNLKit",
2622
targets: ["VecturaNLKit"]
@@ -29,24 +25,10 @@ let package = Package(
2925
name: "vectura-cli",
3026
targets: ["VecturaCLI"]
3127
),
32-
.executable(
33-
name: "vectura-mlx-cli",
34-
targets: ["VecturaMLXCLI"]
35-
),
36-
],
37-
traits: [
38-
.trait(
39-
name: "MLX",
40-
description: "Enable MLX-based embeddings for GPU-accelerated inference"
41-
),
4228
],
4329
dependencies: [
44-
// Always included - lightweight dependencies
4530
.package(url: "https://github.com/jkrukowski/swift-embeddings.git", from: "0.0.21"),
4631
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.4.0"),
47-
48-
// MLX dependency - only loaded when MLX trait is enabled via target conditions
49-
.package(url: "https://github.com/ml-explore/mlx-swift-lm/", from: "2.30.3"),
5032
],
5133
targets: [
5234
.target(
@@ -59,17 +41,6 @@ let package = Package(
5941
.define("ACCELERATE_LAPACK_ILP64"),
6042
]
6143
),
62-
.target(
63-
name: "VecturaMLXKit",
64-
dependencies: [
65-
"VecturaKit",
66-
.product(
67-
name: "MLXEmbedders",
68-
package: "mlx-swift-lm",
69-
condition: .when(traits: ["MLX"])
70-
),
71-
]
72-
),
7344
.target(
7445
name: "VecturaNLKit",
7546
dependencies: [
@@ -86,24 +57,10 @@ let package = Package(
8657
.copy("Resources/mock_documents.json")
8758
]
8859
),
89-
.executableTarget(
90-
name: "VecturaMLXCLI",
91-
dependencies: [
92-
"VecturaKit",
93-
.target(name: "VecturaMLXKit", condition: .when(traits: ["MLX"])),
94-
.product(name: "ArgumentParser", package: "swift-argument-parser"),
95-
]
96-
),
9760
.executableTarget(
9861
name: "TestExamples",
9962
dependencies: ["VecturaKit"]
10063
),
101-
.executableTarget(
102-
name: "TestMLXExamples",
103-
dependencies: [
104-
.target(name: "VecturaMLXKit", condition: .when(traits: ["MLX"]))
105-
]
106-
),
10764
.executableTarget(
10865
name: "TestNLExamples",
10966
dependencies: ["VecturaNLKit"]
@@ -112,12 +69,6 @@ let package = Package(
11269
name: "VecturaKitTests",
11370
dependencies: ["VecturaKit"]
11471
),
115-
.testTarget(
116-
name: "VecturaMLXKitTests",
117-
dependencies: [
118-
.target(name: "VecturaMLXKit", condition: .when(traits: ["MLX"]))
119-
]
120-
),
12172
.testTarget(
12273
name: "VecturaNLKitTests",
12374
dependencies: ["VecturaNLKit"]

0 commit comments

Comments
 (0)