A simple vector database indexer with Ollama written in Java.
- Index and search text documents using vector embeddings.
- Use
nomic-embed-textmodel from Ollama for generating embeddings. - Use only Java standard libraries and HTTP client.
- Java 21 or higher.
- Ollama server running locally.
- Internet connection to download the model.
-
Ensure you have Java 21 or higher installed.
-
Install Ollama by following the instructions at Ollama Installation Guide.
-
Basics stuff with Ollama:
# Can change the model to other ones if you want
# Currently the source code is hardcoded to use nomic-embed-text
ollama pull nomic-embed-text
# Make sure you have GPU acceleration enabled
ollama serveRead more about Ollama Embeddings Documentation.
- Build the project using Maven.
Put your text documents in the notes directory and run the Main class. The program will index the documents and allow you to search them using vector similarity.