A collection of low-to-no dependency modules for building smart apps with JavaScript
115
stars
1,678
commits
JavaScript
primary language
Sep 10, 2026
updated
JS Brains is a collection of lightweight modules for building intelligent applications with JavaScript. It's designed to empower developers to easily integrate AI capabilities into their projects, with a focus on minimal dependencies, extendability, and security.
smart-environment/
Manages global runtime configuration, settings loading/saving, and provides a context to integrate collections, file systems, and model adapters.
smart-collections/
Generalized collection framework for persisting items (sources, blocks, messages) using JSON, AJSON, or SQLite, offering CRUD, filtering, and batch processing utilities.
smart-model/
Base classes for model abstractions and adapter management, setting a pattern for uniform access to various AI model types.
smart-fs/ Abstracts file system operations through multiple adapters (Node.js FS, Obsidian Vault, Web File System Access), adding support for ignore patterns, AJSON, and other features.
smart-actions/ Registers and executes reusable actions, enabling automation workflows and command dispatching across modules.
smart-contexts/ Builds and merges context templates for prompts or configuration generation, supporting variable interpolation and adapters.
smart-settings/ Persists user-facing configuration with schema-driven forms and hot-reload support.
smart-view/ Handles UI and rendering tasks for settings interfaces, markdown previewing, and icon sets, with adapters tailored to Node.js, Obsidian, or browser environments.
smart-events/ Event bus coordinating module communication.
smart-settings/ Centralized configuration accessible across modules.
smart-groups/ Organizes items into labeled groups with vector-based summaries.
smart-directories/ Generates directory structures from collections and sources.
smart-notices/ Delivers predefined notices through adapters to the DOM.
Our mission is to democratize AI development for JavaScript developers, providing a robust toolkit that simplifies the creation of smart, AI-powered applications while maintaining high standards of performance and security. We aim to:
Below is a condensed but comprehensive reference to these libraries, detailing directory structures, classes, and usage patterns.
The "smart-*" set of libraries in JS Brains comprise a modular ecosystem for:
Collection and CollectionItem form the base for higher-level collections.SmartGroups manages multiple SmartGroup instances and supports batch updates and labeling.SmartGroups primitives.SmartModel.embed() and embed_batch() to produce vectors via local or remote adapters.SmartModel with rank(query, documents) and adapters for Cohere or Transformers.fetch, Obsidian's requestUrl, and more.SmartGroups for grouping semantics.SmartView with environment-specific adapters like SmartViewNodeAdapter or SmartViewObsidianAdapter.Common structure:
smart-xyz
├── adapters
│ └── ...
├── index.js
├── package.json
├── [library_name].js
└── test
└── ...
smart-* library.init(), build_groups(), embed(), complete(), rank(), etc.).npx ava).smart-sources/test/ajson_multi_file.test.js verifies multi-file storage.test_content.js).env.smart_sources, env.smart_clusters, etc.var_prompts).JS Brains adopts the adapter pattern as a core architectural principle, granting flexibility and extensibility across various AI models and platforms. This approach provides several key advantages:
Unified Interface Developers can operate with a single, consistent API—regardless of the underlying AI model or service—drastically reducing complexity and mental overhead.
Straightforward Integration New AI models or services can be added simply by authoring new adapters. This means no need to modify core modules, enabling fast growth of features and capabilities.
Configurable & Agile Switching between AI providers or models is as easy as pointing to a different adapter. This makes testing, optimization, and experimentation effortless.
Future-Proofing As new AI models emerge, JS Brains can adopt them quickly through dedicated adapters—staying current with cutting-edge AI developments.
Abstracted Complexity The adapter layer hides the intricate differences in AI services, allowing developers to concentrate on crafting product features rather than juggling integrations.
By isolating provider quirks behind adapters, JS Brains stays extensible and developer-friendly.
Collections expose a unified CRUD interface backed by data adapters. Items derive from CollectionItem, gaining lifecycle hooks and validation. Higher-level modules like SmartEntities, SmartSources, and SmartBlocks build on this foundation, layering domain-specific behavior without changing persistence logic.
A prime example of JS Brains in action is the Smart Connections plugin for Obsidian, showcasing how various modules work together to create an AI-driven knowledge management environment:
Semantic Search
Leveraging the Smart Embed Model and Smart Rank Model, Smart Connections allows users to discover semantically similar notes and content within their knowledge base.
AI-Powered Chat
The Smart Chat Model integrates with personal notes to offer natural language interactions, letting users query and receive AI-generated responses from their own knowledge pool.
Dynamic Knowledge Graphs
Combining Smart Entities with Smart Collections yields live knowledge graphs, helping users navigate and understand relationships between different ideas.
Automated Tagging & Categorization Using Smart Blocks and Smart Entities, Smart Connections automatically analyzes and classifies content, streamlining the user’s organizational efforts.
Personalized Recommendations
By fusing ranking, embedding, and knowledge of user data, Smart Connections can suggest relevant, personalized notes and materials.
These capabilities illustrate how JS Brains modules can be orchestrated to form a robust, AI-based workflow that significantly enhances both productivity and knowledge exploration.
JS Brains centers on empowering users with AI tools that protect privacy and increase productivity. Our guiding principles include:
User-Focused AI
Our solutions are designed to align with user interests and goals, not corporate agendas.
Privacy First
We prioritize secure data handling and transparency in every AI integration we create.
Open-Source Innovation
By open-sourcing core modules, we foster collective advancement in AI tech—any developer can contribute or benefit.
Accessibility
We strive to make advanced AI techniques accessible to all developers, lowering barriers to entry and increasing adoption.
Adhering to these ideals, JS Brains aims to provide AI tools that users can trust and leverage to enhance their personal and professional projects.
1,672 commits
6 commits
JavaScript
99.6%
A collection of low-to-no dependency modules for building smart apps with JavaScript
115
stars
1,678
commits
JavaScript
primary language
Sep 10, 2026
updated
JS Brains is a collection of lightweight modules for building intelligent applications with JavaScript. It's designed to empower developers to easily integrate AI capabilities into their projects, with a focus on minimal dependencies, extendability, and security.
smart-environment/
Manages global runtime configuration, settings loading/saving, and provides a context to integrate collections, file systems, and model adapters.
smart-collections/
Generalized collection framework for persisting items (sources, blocks, messages) using JSON, AJSON, or SQLite, offering CRUD, filtering, and batch processing utilities.
smart-model/
Base classes for model abstractions and adapter management, setting a pattern for uniform access to various AI model types.
smart-fs/ Abstracts file system operations through multiple adapters (Node.js FS, Obsidian Vault, Web File System Access), adding support for ignore patterns, AJSON, and other features.
smart-actions/ Registers and executes reusable actions, enabling automation workflows and command dispatching across modules.
smart-contexts/ Builds and merges context templates for prompts or configuration generation, supporting variable interpolation and adapters.
smart-settings/ Persists user-facing configuration with schema-driven forms and hot-reload support.
smart-view/ Handles UI and rendering tasks for settings interfaces, markdown previewing, and icon sets, with adapters tailored to Node.js, Obsidian, or browser environments.
smart-events/ Event bus coordinating module communication.
smart-settings/ Centralized configuration accessible across modules.
smart-groups/ Organizes items into labeled groups with vector-based summaries.
smart-directories/ Generates directory structures from collections and sources.
smart-notices/ Delivers predefined notices through adapters to the DOM.
Our mission is to democratize AI development for JavaScript developers, providing a robust toolkit that simplifies the creation of smart, AI-powered applications while maintaining high standards of performance and security. We aim to:
Below is a condensed but comprehensive reference to these libraries, detailing directory structures, classes, and usage patterns.
The "smart-*" set of libraries in JS Brains comprise a modular ecosystem for:
Collection and CollectionItem form the base for higher-level collections.SmartGroups manages multiple SmartGroup instances and supports batch updates and labeling.SmartGroups primitives.SmartModel.embed() and embed_batch() to produce vectors via local or remote adapters.SmartModel with rank(query, documents) and adapters for Cohere or Transformers.fetch, Obsidian's requestUrl, and more.SmartGroups for grouping semantics.SmartView with environment-specific adapters like SmartViewNodeAdapter or SmartViewObsidianAdapter.Common structure:
smart-xyz
├── adapters
│ └── ...
├── index.js
├── package.json
├── [library_name].js
└── test
└── ...
smart-* library.init(), build_groups(), embed(), complete(), rank(), etc.).npx ava).smart-sources/test/ajson_multi_file.test.js verifies multi-file storage.test_content.js).env.smart_sources, env.smart_clusters, etc.var_prompts).JS Brains adopts the adapter pattern as a core architectural principle, granting flexibility and extensibility across various AI models and platforms. This approach provides several key advantages:
Unified Interface Developers can operate with a single, consistent API—regardless of the underlying AI model or service—drastically reducing complexity and mental overhead.
Straightforward Integration New AI models or services can be added simply by authoring new adapters. This means no need to modify core modules, enabling fast growth of features and capabilities.
Configurable & Agile Switching between AI providers or models is as easy as pointing to a different adapter. This makes testing, optimization, and experimentation effortless.
Future-Proofing As new AI models emerge, JS Brains can adopt them quickly through dedicated adapters—staying current with cutting-edge AI developments.
Abstracted Complexity The adapter layer hides the intricate differences in AI services, allowing developers to concentrate on crafting product features rather than juggling integrations.
By isolating provider quirks behind adapters, JS Brains stays extensible and developer-friendly.
Collections expose a unified CRUD interface backed by data adapters. Items derive from CollectionItem, gaining lifecycle hooks and validation. Higher-level modules like SmartEntities, SmartSources, and SmartBlocks build on this foundation, layering domain-specific behavior without changing persistence logic.
A prime example of JS Brains in action is the Smart Connections plugin for Obsidian, showcasing how various modules work together to create an AI-driven knowledge management environment:
Semantic Search
Leveraging the Smart Embed Model and Smart Rank Model, Smart Connections allows users to discover semantically similar notes and content within their knowledge base.
AI-Powered Chat
The Smart Chat Model integrates with personal notes to offer natural language interactions, letting users query and receive AI-generated responses from their own knowledge pool.
Dynamic Knowledge Graphs
Combining Smart Entities with Smart Collections yields live knowledge graphs, helping users navigate and understand relationships between different ideas.
Automated Tagging & Categorization Using Smart Blocks and Smart Entities, Smart Connections automatically analyzes and classifies content, streamlining the user’s organizational efforts.
Personalized Recommendations
By fusing ranking, embedding, and knowledge of user data, Smart Connections can suggest relevant, personalized notes and materials.
These capabilities illustrate how JS Brains modules can be orchestrated to form a robust, AI-based workflow that significantly enhances both productivity and knowledge exploration.
JS Brains centers on empowering users with AI tools that protect privacy and increase productivity. Our guiding principles include:
User-Focused AI
Our solutions are designed to align with user interests and goals, not corporate agendas.
Privacy First
We prioritize secure data handling and transparency in every AI integration we create.
Open-Source Innovation
By open-sourcing core modules, we foster collective advancement in AI tech—any developer can contribute or benefit.
Accessibility
We strive to make advanced AI techniques accessible to all developers, lowering barriers to entry and increasing adoption.
Adhering to these ideals, JS Brains aims to provide AI tools that users can trust and leverage to enhance their personal and professional projects.
1,672 commits
6 commits
JavaScript
99.6%