使用说明
NINA AI Assistant
🤖 AI-powered astrophotography assistant for N.I.N.A. with MCP equipment control.
Features
- Multi-Provider AI: Ollama (local, free), Google Gemini, Mistral AI, OpenAI, Anthropic Claude — (GitHub Models was retired by GitHub on July 30, 2026)
- MCP Equipment Control: Natural language control of cameras, mounts, focusers, filter wheels, guiders, dome. Now supports Anthropic, Google, AND Ollama providers
- Dynamic Model Discovery: Automatic detection of latest AI models from each provider
- Image Analysis: FITS header reading, HFR/FWHM monitoring, star detection, quality assessment
- Dockable Chat Panel: Integrated AI chat within NINA's imaging tab
- Knowledge Wiki (second brain): A local markdown knowledge base the assistant consults before answering — your equipment quirks, solved problems and site notes take precedence over the model's general knowledge
- Activity trace: See what the assistant is doing while it answers — one line for the tool in progress, expandable afterwards into the full sequence with each call's arguments and outcome
- Context and cost readout: How full the model's context window is, how many tokens are left, and what the conversation has cost so far
- Extensible: Connect external MCP servers for astronomy calculations, weather, catalogs
Installation
From NINA Plugin Manager (Recommended)
- Open NINA → Options → Plugins
- Search for "AI Assistant"
- Click Install
- Restart NINA
Manual Installation
- Download the latest release from Releases
- Extract to
%localappdata%\NINA\Plugins\3.0.0\AI Assistant\ - Restart NINA
Configuration
- Go to Options → Plugins → AI Assistant
- Select your AI provider
- Enter your API key (not required for Ollama; Google Gemini and Mistral offer free API tiers). For Ollama, the model's "thinking" phase is disabled by default ("Disable model thinking" toggle in the Ollama section) so thinking-capable models (Gemma 4, Qwen 3.x, DeepSeek) answer promptly instead of reasoning at length first.
- Start chatting in the dockable AI panel
Knowledge Wiki
With MCP enabled, the assistant has a personal knowledge wiki at
%LOCALAPPDATA%\NINA\llmwiki — plain markdown pages you can read and edit with
any editor. On first use it is seeded with a starter pack (troubleshooting
checklists, page templates and a schema).
- The assistant reads it first: questions about your specific equipment,
site, or a problem you hit before are answered from the wiki (
wiki_search/wiki_readtools), citing the page used. - It can remember things: when the conversation surfaces a durable fact
("my camera shows amp glow above gain 350"), the assistant offers to save it.
A confirmation dialog always shows the exact text before anything is written;
notes land append-only in
raw/, never in consolidated pages. - Shared second brain: the AI Weather plugin appends daily sky digests to
the same wiki, and the nina.autopilot
agent (
--wiki-ingest) consolidates all raw notes into proper wiki pages. - Add your own pages any time: copy the templates in
wiki/entities/and the assistant will find them.
Building from Source
Prerequisites
- Visual Studio 2022 or later
- .NET 8.0 SDK
- NINA 3.x installed (for local testing only)
Build
git clone https://github.com/michelebergo/nina.plugin.aiassistant.git
cd nina.plugin.aiassistant
dotnet restore
dotnet build -c Release
The post-build event copies the plugin to your local NINA plugins folder.
Project Structure
nina.plugin.aiassistant/
├── AI/
│ ├── AIService.cs # Main AI service orchestrator
│ ├── IAIProvider.cs # Provider interface
│ ├── Models.cs # Request/Response models
│ ├── MCP/
│ │ ├── MCPModels.cs # MCP data structures
│ │ └── NINAAdvancedAPIClient.cs # NINA API integration
│ └── Providers/
│ ├── AnthropicProvider.cs # Claude with MCP tools
│ ├── GitHubModelsProvider.cs
│ ├── GoogleProvider.cs
│ ├── MistralProvider.cs # Mistral AI
│ ├── OllamaProvider.cs # Ollama with MCP tools
│ └── OpenAIProvider.cs
├── MCP/
│ └── ExternalMCPClient.cs # External MCP server support
├── Properties/
│ ├── AssemblyInfo.cs # Plugin metadata
│ └── Settings.Designer.cs # User settings
├── Resources/
│ └── Icons.xaml # UI icons
├── AIAssistantPlugin.cs # Plugin entry point
├── AIChatVM.cs # Chat panel view model
├── AIChatTemplate.xaml # Chat UI template
├── AIChatView.xaml # Chat view (dockable panel)
├── Options.xaml # Settings UI
├── NINA.Plugin.AIAssistant.csproj
├── NINA.Plugin.AIAssistant.sln
├── manifest.json # Plugin manifest
├── icon.png
├── LICENSE.txt
├── CHANGELOG.md
└── README.md
Releasing
This repository uses the official NINA plugin GitHub Action. To release a new version:
- Update version in
Properties/AssemblyInfo.cs - Update
CHANGELOG.md - Commit and push
- Tag the commit:
git tag 2.1.0.0 && git push origin 2.1.0.0 - The GitHub Action will build, create a release, and submit a manifest PR
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Support the project
This plugin is developed and maintained independently in my free time.
If it is useful for your astrophotography or automation workflow, you can support its continued development:
☕ Support development on Buy Me a Coffee
Your support helps cover development tools, testing hardware, hosting and future features.
License and names
AI Assistant is released under the Mozilla Public License 2.0 — see LICENSE.txt.
Author: Michele Bergo. Every copy and every derivative work must keep the copyright notice and credit Michele Bergo as the original author, as the license requires. The MPL grants no rights to names (section 2.3): "AI Weather", "AI Assistant" and "OpenCode" (for N.I.N.A.) are the names of Michele Bergo's plugins, and a fork or derivative work must be published under a different name — not one of these nor a confusable variant such as "AI Weather Advanced" — with its own plugin identifier (GUID), and must not present Michele Bergo as the author of the modified version. See NOTICE.
Acknowledgments
- N.I.N.A. - The amazing astrophotography software
- NINA Advanced API - API integration for NINA
- The astrophotography community