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.3.tar.gz (5.6 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.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file zk_rag-1.0.3.tar.gz.

File metadata

  • Download URL: zk_rag-1.0.3.tar.gz
  • Upload date:
  • Size: 5.6 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.3.tar.gz
Algorithm Hash digest
SHA256 fc15666f80327ebc46b15a618e031a66cdab8d3a297db6b8b147d765c42fc97c
MD5 53dea632ad24491f48d84bb5cb434267
BLAKE2b-256 91a976395ce0eb2e0872a845f5357e2c8b47eb01f78d33692801963e59b951b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for zk_rag-1.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: zk_rag-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 72373a1ca9e1a869e2380231ba03e551f69e3c9d113d5b3e8557be60fb14aca1
MD5 fc8dd694ca79700c829fe52bbe58fc0e
BLAKE2b-256 3807fafe2edc85f9e051d51d82959c2709e8ce330cbcac1cea3797fb97dee39a

See more details on using hashes here.

Provenance

The following attestation bundles were made for zk_rag-1.0.3-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