Skip to content

web search done right

added alice and explore features to readme

Mikkel Denkerc4484fbe60be
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 9d92adfc..cb2de05a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -29,6 +29,7 @@ The process is simple and fast. Upon your first pull request, you will be prompt
* Update ulimit. RocksDB tends to exceed the max number of allowed open files, so you will have to run `ulimit -n 10240` to increase the allowed max number of open files.
* Install just by running `cargo install just`. This allows you to run the scripts in the `justfile` file. A justfile is basically a simple Makefile. Since libtorch requires some specific environment variables to be set, you need to preface all `cargo run` and `cargo test` commands with `just` (so they becom `just cargo run` and `just cargo test`) .
* Run the command `just configure` which should automatically configures the rest of your dev environment. The script creates a python virtual environment, installs relevant dependencies, traces and exports the ML models and creates a small local index which you can use for development.
+* (Optional) run `just configure --alice` to download the weights for Alice (the AI assistant that can search on the web).
* (Optional) Install cargo-watch by running `cargo install cargo-watch`. This makes frontend development easier.
-After the non optional steps you can now run `just cargo test` and should see all tests passing. If you have followed the optional steps, you should be able to run `just frontend` to start the search server and launch the frontend at `0.0.0.0:3000`.
+After the non optional steps you can now run `just cargo test` and should see all tests passing. If you have installced `cargo-watch`, you should be able to run `just frontend` to start the search server and launch the frontend at `0.0.0.0:3000`. You can add the `--alice` flag to enable Alice.
\ No newline at end of file
diff --git a/README.md b/README.md
index 3bb66841..b3c5fece 100644
--- a/README.md
+++ b/README.md
@@ -15,15 +15,16 @@ Stract is an open source web search engine hosted at [trystract.com](https://try
# πŸ’‘ Features
* Keyword search that respects your search query.
* Advanced query syntax (`site:`, `intitle:` etc.).
-* Rank webpages based on their [harmonic centrality](https://en.wikipedia.org/wiki/Centrality#Harmonic_centrality)
* DDG-style [!bang syntax](https://duckduckgo.com/bang)
-* Entity sidebar
+* Wikipedia and stackoverflow sidebar
* De-rank websites with third-party trackers
-* Prioritize fresh content
-* Regional search
* Use [optics](https://github.com/StractOrg/sample-optics/blob/main/quickstart.optic) to almost endlessly customize your search results.
* Customize how signals are combined during search for the final search result
* Prioritize links (centrality) from the sites you trust.
+* Explore the web and find sites similar to the ones you like.
+* Chat with an AI assistant that searches the web for you and cites its sources.
+ * (This is currently not available on the hosted version due to resource limitations, but you can run it locally by following the steps outlined in [CONTRIBUTING.md](CONTRIBUTING.md))
+* And much more!
# πŸ‘©β€πŸ’» Setup
We recommend everyone to use the hosted version at [trystract.com](https://trystract.com/), but you can also follow the steps outlined in [CONTRIBUTING.md](CONTRIBUTING.md) to setup the engine locally.
diff --git a/core/src/alice/raw_model.rs b/core/src/alice/raw_model.rs
index d9725565..d62d5c1d 100644
--- a/core/src/alice/raw_model.rs
+++ b/core/src/alice/raw_model.rs
@@ -74,7 +74,12 @@ impl Linear {
scale,
zero_point,
} => {
- let ws = dequantize(ws, scale, zero_point);
+ let mut ws = dequantize(ws, scale, zero_point);
+
+ if x.kind() != ws.kind() {
+ ws = ws.to_kind(x.kind());
+ }
+
let mut output = x.matmul(&ws.transpose(-2, -1));
if let Some(bias) = bs {
output += bias;
@@ -620,10 +625,6 @@ impl RawModel {
tokens = tokens.to(self.emb.ws.device());
}
- if self.emb.ws.kind() != tokens.kind() {
- tokens = tokens.to_kind(self.emb.ws.kind());
- }
-
let mut x = self.emb.forward_t(&tokens, false);
let mut state = match state {