Skip to content

Jose-M12/Personal-Knowledge-Base-Enhancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Personal Knowledge Base Enhancer

This project transforms your command line into an intelligent assistant for managing a personal knowledge base. Using Google's Gemini CLI, it allows you to conversationally query, update, summarize, and organize your local notes and documents (e.g., Markdown, PDFs).

It works directly with your files in a local directory, requiring no complex setup or database migration. Just point it to your notes, and start asking questions.

How It Works

The system leverages the power of Gemini AI models through the Gemini CLI. Here's the core mechanism:

  1. System Instructions (GEMINI.md): When you launch the tool in your knowledge base directory, it reads GEMINI.md. This file acts as a system prompt, telling the AI its role, capabilities, and how to behave.
  2. Local Context: The AI treats all the files in the directory as its knowledge source. It can read and analyze text files, and thanks to its multimodal capabilities, it can also process content within PDFs, including text, tables, and images.
  3. Custom Commands (commands.toml): The commands.toml file defines simple, reusable slash commands (like /query or /research) that act as shortcuts for common tasks.
  4. Conversational Interface: The tool runs in a chat-like REPL (Read-Eval-Print Loop), allowing for natural, back-and-forth conversations about your knowledge base.

Features

  • Conversational Interface: Chat with your documents as if you were talking to a helpful assistant.
  • Multi-File Querying: Ask questions that require synthesizing information from multiple files.
  • On-the-Fly Summarization: Get quick summaries of long notes or documents.
  • File Management: Create new notes or get suggestions on how to organize your existing ones.
  • Multimodal Support: Natively analyzes text and images within PDF files.
  • External Research: Integrates Google Search to answer questions that require up-to-date, external information.
  • Cross-Platform: Works on macOS, Windows (with a small adjustment), and Linux.
  • Customizable: Easily modify the AI's instructions or add your own custom commands.

Getting Started

Follow these steps to set up the Personal Knowledge Base Enhancer on your system.

Prerequisites

  • Node.js: You'll need Node.js version 20 or higher. You can download it from nodejs.org.
  • Git: You'll need Git to clone the repository.

1. Clone the Repository

First, clone this repository to your local machine and navigate into the directory.

git clone https://github.com/your-username/personal-knowledge-base-enhancer.git
cd personal-knowledge-base-enhancer

2. Install Gemini CLI

The core of this project is the Gemini CLI. Install it globally using npm (which comes with Node.js):

npm install -g gemini-cli

To verify the installation, run gemini --version.

3. Authenticate with Google

The first time you run the tool, you'll need to authenticate with your Google account.

  1. Run the gemini command in your terminal.
  2. It will prompt you to sign in with your Google account. The free tier is generous, offering up to 60 requests per minute.

Alternatively (for advanced users):

You can set your API key as an environment variable.

  • macOS/Linux:

    export GEMINI_API_KEY="your-api-key-here"

    (Add this to your ~/.zshrc or ~/.bash_profile to make it permanent).

  • Windows (Command Prompt):

    set GEMINI_API_KEY="your-api-key-here"
  • Windows (PowerShell):

    $env:GEMINI_API_KEY="your-api-key-here"

4. Add Your Knowledge Files

Place your notes and documents (e.g., .md, .pdf, .txt files) into the directory you just cloned. This will be your knowledge base.

How to Use

Launching the Enhancer

  • On macOS and Linux: The project includes a simple shell script to launch the tool. First, make it executable:

    chmod +x kb-enhancer.sh

    Then, run it:

    ./kb-enhancer.sh
  • On Windows: The kb-enhancer.sh script is for Unix-based systems. For Windows, you can run Gemini CLI directly in the project directory:

    gemini

    For a similar launcher experience, you can create a batch file named kb-enhancer.bat with the following content:

    @echo off
    echo Starting Knowledge Base Enhancer...
    gemini

    Save this file in the project directory, and you can run it by simply typing kb-enhancer.bat.

Interacting with Your Knowledge Base

Once launched, you will be greeted with a welcome message. You can now interact with the assistant.

1. Ask Natural Language Questions Simply type your question and press Enter.

What do my notes say about sustainable farming?

2. Use Custom Slash Commands These commands are shortcuts defined in commands.toml.

  • /query [topic]: Search and summarize notes on a topic.

    /query AI ethics

  • /update [file] [changes]: Propose edits to a file.

    /update meeting-notes.md Add a summary point about the Q4 budget

  • /organize [category]: Get suggestions for organizing files.

    /organize recipes

  • /research [query]: Perform a Google search and summarize the results.

    /research latest advancements in battery technology

  • /faq [question]: Ask a question in a conversational, wiki-like manner.

    /faq How do I set up a Zettelkasten system?

3. Exiting the Tool Press Ctrl+C or type /quit to exit the session.

Customization

You can easily tailor this project to your needs.

  • AI Behavior: Edit the GEMINI.md file to change the AI's instructions, role, or personality.
  • Custom Commands: Open commands.toml to add new slash commands or modify existing ones.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages