Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
package-lock.json
yarn.lock
pnpm-lock.yaml

Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,26 @@ Hybrid semantic reranking is optional and **never replaces lexical grounding**.
| `create-knolo-app` | Next.js scaffolding with playground |
| `@knolo/langchain` | LangChain-style retriever interface |
| `@knolo/llamaindex` | LlamaIndex-style retriever interface |
| `knolo-core-rust` | Native Rust pack mount + lexical query runtime |

---

# 🦀 Rust Runtime Support (New)

Knolo now includes an initial Rust runtime in `packages/core-rust`.

Current Rust support includes:

* Mounting `.knolo` packs from bytes
* Parsing v1/v3-compatible core sections (`meta`, `lexicon`, `postings`, `blocks`)
* Deterministic lexical querying with `top_k`, `min_score`, `namespace`, and `source` filters

Run Rust tests:

```bash
cd packages/core-rust
cargo test
```

---

Expand Down
120 changes: 120 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"test": "npm run test --workspaces --if-present",
"format": "npm run format --workspace @knolo/core",
"format:check": "npm run format:check --workspace @knolo/core",
"knolo": "node ./packages/cli/bin/knolo.mjs"
"knolo": "node ./packages/cli/bin/knolo.mjs",
"test:rust": "cargo test --manifest-path packages/core-rust/Cargo.toml"
}
}
1 change: 1 addition & 0 deletions packages/core-rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
7 changes: 7 additions & 0 deletions packages/core-rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions packages/core-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "knolo-core-rust"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
description = "Rust runtime support for reading and querying .knolo packs"

[lib]
name = "knolo_core_rust"
path = "src/lib.rs"
36 changes: 36 additions & 0 deletions packages/core-rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# knolo-core-rust

Native Rust runtime support for Knolo `.knolo` packs.

## Included in this initial release

- `mount_pack_from_bytes(&[u8]) -> Pack`
- `query(&Pack, &str, QueryOptions) -> Vec<Hit>`
- Pack parsing support for:
- `meta`
- `lexicon`
- `postings`
- `blocks` (legacy string array and v3 object array)

## Example

```rust
use knolo_core_rust::{mount_pack_from_bytes, query, QueryOptions};

let bytes: Vec<u8> = std::fs::read("knowledge.knolo")?;
let pack = mount_pack_from_bytes(&bytes)?;

let hits = query(
&pack,
"react native bridge throttling",
QueryOptions {
top_k: 5,
..Default::default()
},
);

for hit in hits {
println!("{} => {}", hit.source.unwrap_or_default(), hit.score);
}
# Ok::<(), Box<dyn std::error::Error>>(())
```
Loading
Loading