Bookworm - A LLM-powered bookmark search engine
Project description
bookworm 📖
LLM-powered bookmark search engine
bookworm allows you to search from your local browser bookmarks using natural language. For times when you have a large collection of bookmarks and you can't quite remember where you put that one website you need at the moment.
Install
python -m pip install bookworm_genai
[!TIP] If you are using
uvxthen you can also just run this:uvx --from bookworm_genai bookworm --help
Usage
export OPENAI_API_KEY=
# Run once and then anytime bookmarks across supported browsers changes
bookworm sync
# Sync bookmarks only from a specific browser
bookworm sync --browser-filter chrome
# Ask questions against the bookmark database
bookworm ask
# Ask questions against the bookmark database
# Specify the query when invoking the command
# If you omit this then you will be asked for a query when the tool is running
bookworm ask -q pandas
# Ask questions against the bookmark database and specify the number of results that should come back
bookworm ask -n 1
The sync process currently supports the following configurations:
| Operating System | Google Chrome | Mozilla Firefox | Brave | Microsoft Edge |
|---|---|---|---|---|
| Linux | ✅ | ✅ | ✅ | ❌ |
| macOS | ✅ | ✅ | ✅ | ❌ |
| Windows | ❌ | ❌ | ❌ | ❌ |
[!TIP] ✨ Want to contribute? See the adding an integration section.
Processes
bookworm sync
Vectorize your bookmarks across all supported browsers.
graph LR
subgraph Bookmarks
Chrome(Chrome Bookmarks)
Brave(Brave Bookmarks)
Firefox(Firefox Bookmarks)
end
Bookworm(bookworm sync)
EmbeddingsService(Embeddings Service e.g OpenAIEmbeddings)
VectorStore(Vector Store e.g DuckDB)
Chrome -->|load bookmarks|Bookworm
Brave -->|load bookmarks|Bookworm
Firefox -->|load bookmarks|Bookworm
Bookworm -->|vectorize bookmarks|EmbeddingsService-->|store embeddings|VectorStore
Details
The vector database depicted above is stored locally on your machine. You can check it's location by running the following after installing this project:
from platformdirs import PlatformDirs
print(PlatformDirs('bookworm').user_data_dir)
bookworm ask
Search from your bookmarks
graph LR
query
Bookworm(bookworm ask)
subgraph _
LLM(LLM e.g OpenAI)
VectorStore(Vector Store e.g DuckDB)
end
query -->|user queries for information|Bookworm
Bookworm -->|similarity search|VectorStore -->|send similar docs + user query|LLM
LLM -->|send back response|Bookworm
bookworm export
Export your bookmarks across all supported browsers into an output (e.g CSV)
graph LR
VectorStore
Bookworm(bookworm export)
CSV(bookmarks.csv)
VectorStore -->|extract all bookmarks|Bookworm
Bookworm -->|export into file|CSV
Developer Setup
# LLMs
export OPENAI_API_KEY=
# Langchain (optional, but useful for debugging)
export LANGCHAIN_API_KEY=
export LANGCHAIN_TRACING_V2=true
export LANGCHAIN_PROJECT=bookworm
# Misc (optional)
export LOGGING_LEVEL=INFO
Recommendations:
- Install
pyenvand ensure build dependencies are installed for your OS. - Install Poetry we will be using environment management below.
- VS Code Extensions recommendations can be found here and will be suggested upon first opening the project.
poetry env use 3.9 # or path to your 3.9 installation
poetry shell
poetry install
bookworm --help
Running Linux tests on MacOS/Windows
If you are running on a non-linux machine, it may be helpful to run the provided Dockerfile to verify it's working on that environment.
You can build this via:
make docker_linux
You will need to have Docker installed to run this.
Adding an Integration
As you can see from usage, bookworm supports various integrations but not all. If you find one that you want to support one, then a change is needed inside integrations.py.
You can see in that file there is a variable called browsers that follows this structure:
browsers = {
"BROWSER": {
"PLATFORM": {
...
}
}
}
So say you wanted to add Chrome support in Windows then you would go under the Chrome key and then add a win32 key which has all the details. You can refer to existing examples but generally the contents of those details are where to find the bookmarks on the user's system along with how to interpret them.
You can also find a full list of the document loaders supported here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bookworm_genai-0.13.1b94.tar.gz.
File metadata
- Download URL: bookworm_genai-0.13.1b94.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33377a9055b9e1c59196dd02807951e5ec33055007c968792118704d328f8b37
|
|
| MD5 |
f1b21902455fea8ffbd32a320d2a73b2
|
|
| BLAKE2b-256 |
29295c703c4380805b1bec1c2cc3dc6053bf2310b84c87c7bb787ddfad9f0176
|
File details
Details for the file bookworm_genai-0.13.1b94-py3-none-any.whl.
File metadata
- Download URL: bookworm_genai-0.13.1b94-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.8.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dfb1821eccdb368ae59ebcdaeea21987213f84573ec5a4612b9368b7fd249dd
|
|
| MD5 |
d53d09518f0db3b0cabfbf62c781fca5
|
|
| BLAKE2b-256 |
73c83e428147a281fc9dbf1f107129edfa746cd5c72b4c8e82fd13f8f587be38
|