mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 09:04:21 +01:00
- Moved media related logic into notedeck instead of the ui crate, since they pertain to Images/ImageCache based systems - Made RenderableMedia owned to make it less of a nightmware to work with and the perf should be negligible - Added a ImageMetadata cache to Images. This is referenced whenever we encounter an image so we don't have to redo the work all of the time - Relpaced our ad-hoc, hand(vibe?)-coded panning and zoom logic with the Scene widget, which is explicitly designed for this use case - Extracted and detangle fullscreen media rendering from inside of note rendering. We instead let the application decide what action they want to perform when note media is clicked on. - We add an on_view_media action to MediaAction for the application to handle. The Columns app uses this toggle a FullscreenMedia app option bits whenever we get a MediaAction::ViewMedis(urls). Signed-off-by: William Casarin <jb55@jb55.com>
Dave - The Nostr AI Assistant
Dave is an AI-powered assistant for the Nostr protocol, built as a Notedeck application. It provides a conversational interface that can search, analyze, and present Nostr notes to users.
Overview
Dave demonstrates how to build a feature-rich application on the Notedeck platform that interacts with Nostr content. It serves both as a useful tool for Nostr users and as a reference implementation for developers building Notedeck apps.
Features
- Interactive 3D avatar with WebGPU rendering
- Natural language conversations with AI
- Query and search the local Nostr database for notes
- Present and render notes to the user
- Tool-based architecture for AI actions
- Context-aware searching (home, profile, or global scope)
- Chat history persistence
- Anonymous lmzap backend
Technical Details
Dave uses:
- Egui for UI rendering
- WebGPU for 3D avatar visualization
- OpenAI API (or Ollama with compatible models)
- NostrDB for efficient note storage and querying
- Async Rust for non-blocking API interactions
Architecture
Dave is structured around several key components:
- UI Layer - Handles rendering and user interactions
- Avatar - 3D representation with WebGPU rendering
- AI Client - Connects to language models via OpenAI or Ollama
- Tools System - Provides structured ways for the AI to interact with Nostr data
- Message Handler - Manages conversation state and message processing
Usage as a Reference
Dave serves as an excellent reference for developers looking to:
- Build conversational interfaces in Notedeck
- Implement 3D rendering with WebGPU in Rust applications
- Create tool-based AI agents that can take actions in response to user requests
- Query and present Nostr content in custom applications
Getting Started
- Clone the repository
- Set up your API keys for OpenAI or configure Ollama
export OPENAI_API_KEY=your_api_key_here # or for Ollama export OLLAMA_HOST=http://localhost:11434 - Build and run the Notedeck application with Dave
Configuration
Dave can be configured to use different AI backends:
- OpenAI API (default) - Set the
OPENAI_API_KEYenvironment variable - Ollama - Use a compatible model like
hhao/qwen2.5-coder-toolsand set theOLLAMA_HOSTenvironment variable
Contributing
Contributions are welcome! See the issues list for planned features and improvements.
License
GPL
Related Projects
- nostrdb - Embedded database for Nostr notes