feat: integrate SMRITI local-first memory layer - #124
Open
shivamtyagi18 wants to merge 1 commit into
Open
Conversation
Author
|
Hi @farzaa added integration with Smriti-Memcore local memory for Clicky. May be test it out and share your feedback. I can enhance Smriti for Clicky requirements. This is a great product. Thank you for sharing. Would love to contribute and bring pleasure to end users :) |
…odel support - Integrates SMRITI local-first long-term memory layer with hot-reloading sync, turn encoding, and console logging of recalled memories. - Exposes local SMRITI HTTP API daemon on port 7798 with global storage at ~/.smriti/global. - Implements hot-reloading in local REST daemon to dynamically sync concurrent database changes made by other tools (Claude Code, Cursor, Gemini). - Adds native support for alternative models: Google Gemini 3.5 Flash, xAI Grok 2 Vision, and Local Ollama. - Implements generic OpenAICompatibleAPI client in Swift to handle OpenAI-style vision payloads and SSE streaming. - Updates Cloudflare Worker with a secure /openai-proxy endpoint to append GEMINI_API_KEY and XAI_API_KEY env secrets. - Integrates a macOS Speech Synthesizer fallback to read responses aloud if ElevenLabs runs out of credits or has an invalid key. - Redesigns model picker in settings UI to support Sonnet, Gemini, Grok, and Ollama, adding a text input to customize local Ollama model names. - Fixes transcription token URL configuration to use the deployed Cloudflare Worker domain. - Self-updated AGENTS.md to match the new architecture.
shivamtyagi18
force-pushed
the
feature/smriti-memory-integration
branch
from
July 19, 2026 07:10
6a0ce1a to
8611688
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR integrates a local-first long-term memory layer (SMRITI) into Clicky and adds support for alternative vision models (Google Gemini, xAI Grok, and local Ollama) to allow testing with free-tier and offline backends. It also introduces a macOS Speech Synthesizer fallback to prevent voice errors when ElevenLabs credits run out.
Key Features
1. SMRITI Memory Layer Integration
/recallREST API on push-to-talk release, matching and appending the top 5 relevant long-term memories to the system prompt of the active LLM.mtime) ofpalace.jsonon incoming queries, immediately syncing new memories written on disk by other concurrent agents (Claude Code, Cursor, Gemini CLI) while maintaining zero-latency by reusing the pre-warmed HuggingFace embeddings model.User: <prompt>\nClicky: <response>to the shared database.🧠 SMRITI Recalledmarkers for developer transparency.2. Multi-Model Support (Gemini, Grok, Ollama)
OpenAICompatibleAPI.swiftto handle standard OpenAI-style vision payloads (base64 image URLs) and stream SSE tokens./openai-proxyroute to append xAI and Google AI Studio keys securely, routing Gemini keys via query parameters (?key=) to bypass Vertex AI'sv1mainenterprise routing.llama3.2-vision).3. Fail-safe TTS Fallback
401 Unauthorized(invalid/missing key) or429 Too Many Requests(out of credits), Clicky automatically falls back to the Mac's localNSSpeechSynthesizerto read the actual model response aloud.Changed Files
leanring-buddy/CompanionManager.swift: Orchestrates model routing, local TTS fallbacks, and SMRITI daemon lifecycle.leanring-buddy/CompanionPanelView.swift: Renders the new model picker UI and Ollama custom model entry field.leanring-buddy/OpenAICompatibleAPI.swift[NEW]: Unified OpenAI spec request-builder and SSE stream parser.scripts/smriti_local_api.py[NEW]: SMRITI REST API server with palace database hot-reloading.worker/src/index.ts: Secure proxy routing for Claude, ElevenLabs, Gemini, and Grok.AGENTS.md: Updated architecture design documentation.