An Obsidian plugin that integrates with Glean's enterprise AI platform, allowing you to query your company's knowledge base directly from your notes using natural language.
- π Natural Language Queries: Ask questions in plain English using the
/glean
slash command - π’ Enterprise Integration: Connects to your company's Glean instance with proper authentication
- π Inline Responses: Get AI-powered answers directly in your notes as formatted callouts
- π Secure: Uses your Glean API credentials with proper permission handling
- β‘ Real-time: Immediate responses with loading indicators
- Download the latest release from the releases page
- Extract the files to your Obsidian plugins folder:
- Windows:
%APPDATA%\Obsidian\plugins\obsidian-glean\
- macOS:
~/Library/Application Support/obsidian/plugins/obsidian-glean/
- Linux:
~/.config/obsidian/plugins/obsidian-glean/
- Windows:
- Enable the plugin in Obsidian Settings β Community Plugins
- Clone this repository
- Run
npm install
to install dependencies - Run
npm run build
to build the plugin - Copy the
dist
folder contents to your Obsidian plugins directory - Enable the plugin in Obsidian
You'll need:
- Glean Instance Name: Your company's Glean domain (e.g., "yourcompany" for yourcompany.glean.com)
- API Key: A Glean API token with
CHAT
scope permissions
To get an API key:
- Go to your Glean admin console
- Navigate to API settings
- Generate a new token with
CHAT
scope - Copy the token for use in the plugin
- Open Obsidian Settings
- Go to Community Plugins β Glean
- Enter your Glean Instance Name and API Key
- Click "Test Connection" to verify your setup
- Save the settings
Type /glean
followed by your question in any note:
/glean What happened in our team meeting yesterday?
Press Enter or select the suggestion to execute the query.
/glean Give me a summary of what happened last week
/glean Summarize what I did this week
/glean What's the status of project xyz?
/glean What issues did my team encounter this week?
/glean What team owns service ABC?
/glean Show me the latest updates on our product roadmap
Responses appear as formatted callouts in your notes:
> [!info] Glean Response
> Based on your team meeting yesterday, here are the key points discussed:
>
> - Project timeline updates for Q1 deliverables
> - Budget allocation discussions for the new initiative
> - New team member onboarding process improvements
>
> **Query:** "What happened in our team meeting yesterday?"
> **Generated:** 1/15/2024, 2:30:15 PM
Setting | Description | Default |
---|---|---|
Glean Instance Name | Your company's Glean domain name | (empty) |
API Key | Your Glean API token with CHAT scope | (empty) |
Request Timeout | Timeout for API requests in milliseconds | 30000 |
Use CORS-Free Methods | Use Obsidian's built-in request method to bypass CORS restrictions | true (recommended) |
If you encounter CORS (Cross-Origin Resource Sharing) errors:
-
Enable CORS-Free Methods (recommended):
- Go to plugin settings
- Toggle ON "Use CORS-Free Methods"
- This uses Obsidian's built-in
requestUrl
which bypasses browser CORS restrictions
-
Alternative solutions:
- If CORS-free methods don't work, toggle OFF "Use CORS-Free Methods" to use the standard Glean client
- Check your network setup - some corporate firewalls may interfere with requests
If you see "Connection failed" errors:
- Verify your instance name is correct (just the domain part, not the full URL)
- Check that your API key has the correct
CHAT
scope permissions - Ensure your network allows connections to your Glean instance
- Try toggling the "Use CORS-Free Methods" setting
- Try the "Test Connection" button in settings
If queries return empty responses:
- Check that your Glean instance has content indexed
- Verify you have permission to access the relevant data sources
- Try simpler, more general queries first
- Check the browser console for detailed error messages
- Ensure you've enabled the plugin in Community Plugins settings
- Check that all files are in the correct plugin directory
- Restart Obsidian after installation
- Check the console for any error messages
# Install dependencies
npm install
# Build for development (with file watching)
npm run dev
# Build for production
npm run build
# Install to your Obsidian vault (set OBSIDIAN_VAULT env var)
npm run install-plugin
src/
βββ main.ts # Main plugin class (minimal, uses modules)
βββ glean-client.ts # Glean API operations (pure functions)
βββ slash-command.ts # Slash command implementation (modular)
βββ settings.ts # Settings management (functional approach)
styles.css # Plugin styling
manifest.json # Plugin manifest
package.json # Dependencies and build scripts
The plugin uses a modern modular architecture with:
- Pure Functions: Most functionality is implemented as pure functions for better testability
- Separation of Concerns: Each module has a single responsibility
- Minimal Classes: Only using classes where required by Obsidian's API
- Functional Composition: Modules work together through function composition
- Your API credentials are stored locally in Obsidian's settings
- All queries are sent directly to your company's Glean instance
- No data is sent to third parties
- Responses respect your Glean permissions and data access rights
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE for details.
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π Documentation: Glean Developer Portal
- Initial release
- Basic
/glean
slash command functionality - Glean Chat API integration
- Settings interface with connection testing
- Formatted callout responses