Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zk_rag-1.0.4.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zk_rag-1.0.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

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

Hashes for zk_rag-1.0.4.tar.gz
Algorithm Hash digest
SHA256 598e4187bbc3d1ad0fa0ad737cfdede14a23b9d5ac0007b8b221fd039563b935
MD5 fe4e0f44ad82e90b082d38bc4e43f8d1
BLAKE2b-256 5b1c1eb69c6f91b0231d4cbe9f629293225ce61d29ea884a952c07a29c4e0a9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for zk_rag-1.0.4.tar.gz:

Publisher: python-publish.yml on svetzal/zk-rag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for zk_rag-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 26fbad64d0b4f3b038bf84bfd01052a4b66e4424ea4234ccf797ffccd9b53b53
MD5 f48b5d9cfb6c1d2d090ec5041f586bbf
BLAKE2b-256 6c1db1f6720f66b0976b85372627466aee3de8d7d315507d0b9d16cdaf0b2ecf

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page