Skip to content

Leverage LLMs and vector embeddings to automatically assign labels to notes within a zettelkasten system.

Notifications You must be signed in to change notification settings

przadka/zettel-llm

Repository files navigation

Zettel LLM

Zettel LLM leverage LLMs and vector embeddings to automatically assign labels to notes within a zettelkasten system. For a more detailed guide, check out the Simple Manual.

🛠️ Setup

  1. Clone the Repository

    git clone https://github.com/przadka/zettel-llm
  2. Navigate to the Project Directory

    cd zettel-llm
  3. Activate the Virtual Environment (Make sure you have virtualenvwrapper installed)

    workon zettel-llm
  4. Install Dependencies

    pip install -r requirements.txt
  5. Prepare Your Documents:

    • Place your documents in the documents directory.
    • Currently, the system assumes documents are in CSV format.

💾 Data Setup

Ensure you have the following CSV files in the documents/ directory:

  1. notions.csv: Contains the notions that the system will embed.
  2. train_data.csv: Contains the quotes and associated metadata.

For details on the expected structure of these CSV files, please refer to the Simple Manual.

🚀 Usage

1. Initialize ChromaDB

Run the initialize_chroma_db.py script. This will ensure the presence of the 'zettelkasten' collection in the specified database and begin the querying process.

python initialize_chroma_db.py

⚠️ Note: If you need to re-initialize the Chroma database, you can delete the existing one by executing the following command:

$ rm -rf chroma.db

Initializing a new database incurs a small cost. Always ensure you're aware of any associated expenses before performing this action.

2. Query the Database

Execute the main.py script to search for specific texts within the 'zettelkasten' collection.

python main.py

🌍 Environment Variables

Before using the scripts, configure the necessary environment variables:

  • OPENAI_API_KEY: Your OpenAI API key, required for the embedding function.

You can either export this variable directly in your shell or use an .env file.

📜 License

This project is open-source and licensed under the MIT License.

About

Leverage LLMs and vector embeddings to automatically assign labels to notes within a zettelkasten system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages