Building a retrieval API to search my Obsidian vault from LibreChat (laurentcazanove.com)

🤖 AI Summary
A developer built an open-source retrieval API that makes an Obsidian vault directly queryable from LibreChat, enabling Retrieval-Augmented Generation (RAG) with function-calling. The system ingests markdown files, splits them with a markdown-aware llm-text-splitter, generates contextualized document embeddings via VoyageAI’s voyage-context-3 (document-mode, 1024-dim), and stores chunks and metadata in Meilisearch. LibreChat discovers and calls a single POST /search endpoint through an OpenAPI spec, letting LLMs reliably fetch source chunks and include references in responses. Technically notable choices: Bun runs the TypeScript stack for speed, Meilisearch provides fast hybrid search and metadata filtering, and VoyageAI’s nested-array "contextualized" embeddings treat chunks as part of the same document—improving relevance vs. independent chunk embeddings. The search combines vector similarity and text matching (semanticRatio ~0.5) and generates query embeddings locally. Query rewriting was deliberately disabled because modern models already produce good search queries and added latency wasn’t justified. The result is a minimal, low-latency RAG endpoint tailored for personal vaults (no auth by default) that balances semantic retrieval and exact-text matching while exposing a simple OpenAPI surface for LLM function-calling integration. Repository: https://github.com/Strift/obsidian-rag-api
Loading comments...
loading comments...