How To Do Offline Recommendations With Sqlite And Gemini
Build offline recommendation systems using SQLite for data storage and Gemini for model inference – a practical guide.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add how-to-do-offline-recommendations-with-sqlite-and-gemini npx -- -y @trustedskills/how-to-do-offline-recommendations-with-sqlite-and-gemini
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"how-to-do-offline-recommendations-with-sqlite-and-gemini": {
"command": "npx",
"args": [
"-y",
"@trustedskills/how-to-do-offline-recommendations-with-sqlite-and-gemini"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill enables AI agents to perform personalized recommendations entirely offline by combining a local SQLite database with the Gemini API. It allows agents to query user-specific data without needing an active internet connection or cloud-based vector search infrastructure.
When to use it
- Building privacy-focused applications where user data must remain on-device.
- Creating mobile apps that need to function seamlessly in areas with poor or no connectivity.
- Implementing recommendation engines for small datasets that don't require heavy cloud compute resources.
- Prototyping offline-first AI features before scaling to complex distributed systems.
Key capabilities
- Stores user interaction history and preferences in a local SQLite file.
- Embeds data locally using the Gemini API to generate vector representations.
- Performs similarity searches against the local vector store to find relevant items.
- Returns ranked recommendations based on calculated cosine similarity scores.
Example prompts
- "Find me movies similar to 'Inception' based on my viewing history stored in this SQLite database."
- "Suggest books I might enjoy given that I recently read 'Dune', using only my local data."
- "What products are recommended for users with a purchase pattern matching mine, without sending my data online?"
Tips & gotchas
Ensure the Gemini API key is configured correctly to generate embeddings locally; this step requires internet access but subsequent queries do not. This approach is best suited for smaller datasets, as embedding large volumes of data locally can be resource-intensive on mobile devices.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.