{"id":14959392,"url":"https://github.com/gurveervirk/tok","last_synced_at":"2025-05-02T13:30:26.799Z","repository":{"id":239304924,"uuid":"799114482","full_name":"gurveervirk/ToK","owner":"gurveervirk","description":"Simple, High Quality, Open Source RAG solution for chatting with your documents","archived":false,"fork":false,"pushed_at":"2024-12-12T08:08:34.000Z","size":2283,"stargazers_count":21,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T02:07:50.321Z","etag":null,"topics":["ai","docker","flask","llama-index","llamaindex","llm","neo4j","neo4j-database","ollama","python","rag","react","vector-database"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gurveervirk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-11T08:13:02.000Z","updated_at":"2025-02-23T19:56:25.000Z","dependencies_parsed_at":"2024-05-11T11:43:15.059Z","dependency_job_id":"9cd36320-83b4-4037-acbb-56bb8f66fb71","html_url":"https://github.com/gurveervirk/ToK","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.32258064516129037","last_synced_commit":"c86e85dc80ab73b833805341cf07b2b05e0ea752"},"previous_names":["gurveervirk/tok"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gurveervirk%2FToK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gurveervirk%2FToK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gurveervirk%2FToK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gurveervirk%2FToK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gurveervirk","download_url":"https://codeload.github.com/gurveervirk/ToK/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252045995,"owners_count":21685932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","docker","flask","llama-index","llamaindex","llm","neo4j","neo4j-database","ollama","python","rag","react","vector-database"],"created_at":"2024-09-24T13:19:36.276Z","updated_at":"2025-05-02T13:30:26.785Z","avatar_url":"https://github.com/gurveervirk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trove Of Knowledge (ToK)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg height=\"300\" width=\"300\" alt=\"Trove of Knowledge Logo\" src=\"https://github.com/gurveervirk/ToK/blob/main/ui/public/tok.jpg\"\u003e\n\u003c/div\u003e\n\n**Trove of Knowledge** (ToK) is a *fully local*, *high-quality*, and *extensible Retrieval-Augmented Generation (RAG) application* that leverages AI models and indices to query documents and generate contextually accurate responses. With ToK, you can upload documents and receive more informed answers tailored to your queries. Additionally, the app automatically stores your chats, allowing you to revisit and continue conversations at any time.\n\n## Table of Contents\n\n- 📋 [Features](#features)\n- 🛠️ [Prerequisites](#prerequisites)\n- 🚀 [Getting Started](#getting-started)\n- 📝 [Usage](#usage)\n- 🎥 [Video Demo](#video-demo)\n- 🌟 [Visual Tour](#visual-tour)\n- 📊 [Results](#results)\n\n## Features\n\n- 🛡️ **Fully Local, Secure, and Privacy-Focused:** ToK ensures that all operations are performed locally, keeping your data private and secure.\n- 📂 **Versatile Document Uploading:** Upload various types of text documents and folders to create an index for more informed AI responses.\n- 🏷️ **Optional Metadata Assignment:** Enhance document uploads with custom metadata, making your data more organized and accessible.\n- ⚙️ **Comprehensive UI Settings:** Easily access and modify important settings like chunking options, temperature, context window size, and chat mode through the user interface.\n- ✍️ **Custom Prompts:** Add and use personalized prompts for both the Large Language Model (LLM) and the chat engine, tailoring responses to your needs.\n- 🗂️ **Persistent Chats with Titles:** Chats are saved with customizable titles, allowing you to revisit and continue them later.\n- 📜 **Persistent Chat History:** Access and review past conversations at any time.\n- 🤖 **Model Selection from Ollama:** Choose and pull AI models directly from Ollama for specific tasks and preferences.\n- ⏳ **Streaming Responses with Smart Snippets:** Experience real-time responses with smart output formatting, especially for code snippets.\n- 🔧 **Extensible:** Easily extend ToK's functionality with additional features or integrations.\n\n## Prerequisites\n\nTo run ToK, you'll need to install two dependencies:\n\n- **[Ollama](https://ollama.com/download):** Facilitates easy model downloading, serving, and intelligent device loading. (*required*)\n- **[Neo4j Desktop](https://neo4j.com/download/):** Used for top-tier vector and graph stores. (*install if running without docker / with the exe in releases or for research purposes*)\n\n### Setting Up Neo4j (IF Neo4j Desktop IS INSTALLED)\n\n1. Download and install *Neo4j Desktop*.\n2. Add the **Neo4j bin path** to your system's **PATH** environment variable. This allows Neo4j to be accessed by ToK.\n   - Example bin path for Windows: `\\path\\to\\user\\.Neo4jDesktop\\relate-data\\dbmss\\your-current-dbms\\bin`\n\n- (For Windows) Activate the Neo4j CLI by running the following command in Command Prompt or PowerShell for Windows:\n\n   ```bash\n   neo4j windows-service install\n   ```\n\n\u003e Please go through [this link](https://neo4j.com/docs/operations-manual/current/installation/) to perform the above steps for other arch's (and for reference).\n\n## Getting Started\n\nYou have two main options to run ToK:\n\n### Option 1: Running ToK with Docker (RECOMMENDED)\n\n1. Ensure you have [Docker](https://www.docker.com/products/docker-desktop) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.\n2. Clone the repository:\n   ```bash\n   git clone https://github.com/gurveervirk/ToK.git\n   ```\n3. Navigate to the directory containing the `docker-compose.yml` file:\n   ```bash\n   cd ToK/docker\n   ```\n4. Serve Ollama on your local system. (*app may serve it automatically*)\n   ```bash\n   ollama serve\n   ```\n4. Start the application with Docker Compose:\n   ```bash\n   docker-compose up -d\n   ```\n\n### Option 2: Running ToK Executable (DEPRECATED) (NO LONGER MAINTAINED)\n\n1. Visit the [Releases](https://github.com/gurveervirk/ToK/releases) page and download the latest `ToK.exe` to a location/directory (the app creates necessary files and folders for correct working).\n2. Modify the settings by running the app once and clicking the settings icon at the top right hand corner:\n   - **username:** Replace with your Neo4j database username.\n   - **password:** Replace with the password you set in your Neo4j project.\n   - **uri:** Replace with your Neo4j project's URI.\n\n   \u003e **Note:** The default username and URI are the default values for a Neo4j DB.\n   \u003e You can also modify it in `settings.json`, created by the app.\n\n**Done!** You're now ready to start using ToK.\n\n## Usage\n\nAfter completing the setup:\n\n1. Launch *ToK*.\n2. Choose to either chat directly with the bot or upload documents using the top-right button for enhanced query responses.\n3. Enjoy the seamless experience of interacting with a locally-run, AI-powered knowledge assistant that keeps your data private and secure.\n\n\u003e **Note:** On creating a new chat immediately after prompting the LLM / Chat Engine, the latest chat may not be visible in the sidebar along with chatting being unavailable for a few seconds. This may be due to the new chat being stored with an LLM-generated title.\n\n## Video Demo\n\nWatch the video below to see ToK in action:\n\n[![ToK Video Demo](https://github.com/gurveervirk/ToK/blob/main/misc/pics/landing_page.png)](https://youtu.be/kCs0xizstNg)\n\n## Visual Tour\n\nExplore the key features and user interface of ToK through the images below:\n\n\u003ctable align=\"center\"\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ch4\u003eUpload Modal\u003c/h4\u003e\n      \u003cimg width=\"200\" alt=\"file_upload\" src=\"https://github.com/gurveervirk/ToK/blob/main/misc/pics/file_upload.png\"\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ch4\u003eSettings Modal\u003c/h4\u003e\n      \u003cimg width=\"200\" alt=\"settings\" src=\"https://github.com/gurveervirk/ToK/blob/main/misc/pics/settings.png\"\n    \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ch4\u003ePrompts Modal\u003c/h4\u003e\n      \u003cimg width=\"200\" alt=\"prompts\" src=\"https://github.com/gurveervirk/ToK/blob/main/misc/pics/prompts.png\"\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Results\n\nThis app has been successfully tested on a subset of the TriviaQA dataset, and the results are as follows:\n\n\u003cdiv\u003e\n  \u003cimg alt=\"results\" src=\"https://github.com/gurveervirk/ToK/blob/main/misc/pics/results.png\"\u003e\n\u003c/div\u003e\n\nPlease find the code for the above results in the [this link](https://www.kaggle.com/dalix56/tok-eval).\n\n## Star History\n\n\u003ca href=\"https://star-history.com/#gurveervirk/ToK\u0026Date\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=gurveervirk/ToK\u0026type=Date\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=gurveervirk/ToK\u0026type=Date\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=gurveervirk/ToK\u0026type=Date\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurveervirk%2Ftok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgurveervirk%2Ftok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurveervirk%2Ftok/lists"}