This application is a local server for managing and searching lifelogs retrieved from Limitless.ai. It supports:
- Automated lifelog retrieval and polling
- Local storage in SQLite with full-text search (FTS5)
- Semantic search using OpenAI embeddings
- Hybrid search (combining FTS and semantic search)
- AI-powered query enhancement and summarization
- Web UI (React) for browsing and searching lifelogs
- Automated Lifelog Retrieval: Periodically fetches lifelogs from Limitless.ai using their API.
- Full-Text Search: Fast keyword/phrase search using SQLite FTS5.
- Semantic Search: Finds conceptually similar lifelogs using OpenAI embeddings and cosine similarity.
- Hybrid Search: Combines FTS and semantic results for best relevance.
- AI Query Enhancement: Optionally expands/rephrases queries using OpenAI GPT.
- AI Summarization: Optionally summarizes search results using OpenAI GPT.
- Node.js (v16 or higher)
- npm (v7 or higher)
-
Install dependencies:
npm install # (or yarn install)
-
Environment variables:
- Create a
.env
file in the root with:
LIMITLESS_API_KEY=your_limitless_api_key OPENAI_API_KEY=your_openai_api_key POLLING_INTERVAL_MINUTES=5
- Create a
-
Run the server:
npm run build # (if using TypeScript frontend) node server.js
The server will start, fetch lifelogs, and serve the web UI at http://localhost:3000.
-
Backfill Embeddings (for semantic search): If you have existing lifelogs, run the embedding backfill to enable semantic/hybrid search:
node -e 'import("./server/openaiClient.js").then(m => m.backfillEmbeddings().then(c => console.log(`Embedded ${c} lifelogs`)))'
This will generate and store embeddings for all lifelogs that do not yet have one.
GET /api/search?query=...&search_type=keyword|semantic|hybrid&top_n=10&enhance=true|false&summarize=true|false
search_type
:keyword
(default),semantic
, orhybrid
enhance
: Iftrue
, uses OpenAI to improve the querysummarize
: Iftrue
, returns an AI-generated summary of the results
GET /api/lifelogs?page=1&page_size=20
GET /api/lifelogs/:id
- The web UI allows you to browse, search, and view lifelogs.
- You can select the search type (keyword, semantic, hybrid) and enable AI features.
- To update deprecated Node packages and fix vulnerabilities:
npm audit fix npm update
- OpenAI API usage may incur costs for embeddings and LLM calls.
- For large datasets, embedding backfill may take time and use API quota.
MIT