Ingest documents for Vector Search
devUse the ingest command to process a folder of .txt or .md files. The tool embeds the text using Google Gemini embeddings and persists the metadata and vectors into a LiteDB database.
You must provide Gemini credentials using one of these methods:
- An API key via the
--api-keyflag, or theGOOGLE_VERTEX_API_KEYorGOOGLE_API_KEYenvironment variables. - Service account credentials via
GOOGLE_APPLICATION_CREDENTIALS(using defaultGoogleCredentialproviders).
If using Vertex AI with a service account, you can optionally specify GOOGLE_PROJECT_ID and GOOGLE_VERTEX_LOCATION (defaults to us-central1).
Model selection is controlled via --model or the GOOGLE_VERTEX_EMBEDDING_MODEL environment variable (defaults to gemini-embedding-001).
dotnet run --project LiteDB.Demo.Tools.VectorSearch.csproj -- ingest --source ./docs --database vector.db --api-key "$env:GOOGLE_VERTEX_API_KEY"