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.5.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.5-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zk_rag-1.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 d8fdd6c201a98b5d63504a8d43a47534b5a580da53db5f63eea3da053c4bbb96
MD5 1bcdeb1537dd021465170cf44774cdb4
BLAKE2b-256 2a004d7735521bd0a916255847c169cd8320cee48942f49804ac36ef689cdfd0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: zk_rag-1.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3105decfe8a1a496fa749a13e4b4bac871c3387ca297d6c140d36ff6ec8b593f
MD5 50fa86e1f4d7855c85ccbf5cdad8bf13
BLAKE2b-256 05ebcbc6a389d9710e769c76d1b255df7d3b4d419256370137beb8cc635d595d

See more details on using hashes here.

Provenance

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