zk-rag is a command-line chat tool for your zettelkasten
Project description
Query your Zettelkasten
This is a simple implementation of Retrieval Augmented Generation (RAG) for your Zettelkasten. It breaks your markdown documents into chunks, and uses a cosine-distance query to place relevant text chunks from your Zettelkasten into an LLM chat context in order to answer your questions.
It uses chromadb for a vector database (indexing the chunks, and doing distance queries for chunk selection) and ollama in order to generate the responses.
This project has many limitations, it is simply a starting point upon which I am building a larger system. Treat it like an example project, and build your own work on top of it.
Limitations
- command-line only
That said, it includes all of the critical elements for doing RAG queries across a document base.
Requirements
You must have ollama installed and functional.
You must have a local knowledgebase / zettelkasten with content in markdown format. I use Obsidian, because I favour working locally, and I favour using the markdown format for notes - because everything's local, and in plain text, I can simply point this tool at a Vault folder.
Workstation setup
I recommend you setting up a local virtual Python environment, to keep it clean, but you can install it globally.
pip install zk-rag
Run zk_reindex to start the configuration. You will need to provide the path to your root Zettelkasten / Obsidian
vault folder, and the name of the LLM model you want to use in your Ollama installation.
Use ollama list to check which ones you have set up.
Run zk_reindex to re-index the contents of your zettelkasten.
Run zk_chat to query your Zettelkasten. Note that this is not a true chat, it will not take into account
the history of your queries, every query is answered as a stand-alone question. Press enter (blank line) to exit the
query loop.
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 zk_rag-1.0.4.tar.gz.
File metadata
- Download URL: zk_rag-1.0.4.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
598e4187bbc3d1ad0fa0ad737cfdede14a23b9d5ac0007b8b221fd039563b935
|
|
| MD5 |
fe4e0f44ad82e90b082d38bc4e43f8d1
|
|
| BLAKE2b-256 |
5b1c1eb69c6f91b0231d4cbe9f629293225ce61d29ea884a952c07a29c4e0a9a
|
Provenance
The following attestation bundles were made for zk_rag-1.0.4.tar.gz:
Publisher:
python-publish.yml on svetzal/zk-rag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zk_rag-1.0.4.tar.gz -
Subject digest:
598e4187bbc3d1ad0fa0ad737cfdede14a23b9d5ac0007b8b221fd039563b935 - Sigstore transparency entry: 171212890
- Sigstore integration time:
-
Permalink:
svetzal/zk-rag@823de994ea9edbc7c68c1e47cfc15b726ce65625 -
Branch / Tag:
refs/tags/RELEASE-1.0.4 - Owner: https://github.com/svetzal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@823de994ea9edbc7c68c1e47cfc15b726ce65625 -
Trigger Event:
release
-
Statement type:
File details
Details for the file zk_rag-1.0.4-py3-none-any.whl.
File metadata
- Download URL: zk_rag-1.0.4-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26fbad64d0b4f3b038bf84bfd01052a4b66e4424ea4234ccf797ffccd9b53b53
|
|
| MD5 |
f48b5d9cfb6c1d2d090ec5041f586bbf
|
|
| BLAKE2b-256 |
6c1db1f6720f66b0976b85372627466aee3de8d7d315507d0b9d16cdaf0b2ecf
|
Provenance
The following attestation bundles were made for zk_rag-1.0.4-py3-none-any.whl:
Publisher:
python-publish.yml on svetzal/zk-rag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zk_rag-1.0.4-py3-none-any.whl -
Subject digest:
26fbad64d0b4f3b038bf84bfd01052a4b66e4424ea4234ccf797ffccd9b53b53 - Sigstore transparency entry: 171212891
- Sigstore integration time:
-
Permalink:
svetzal/zk-rag@823de994ea9edbc7c68c1e47cfc15b726ce65625 -
Branch / Tag:
refs/tags/RELEASE-1.0.4 - Owner: https://github.com/svetzal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@823de994ea9edbc7c68c1e47cfc15b726ce65625 -
Trigger Event:
release
-
Statement type: