Commit graph

19 commits

Author SHA1 Message Date
2e8e947adc **feat: implement Model Control Protocol (MCP) for Brainy with WebSocket and REST interfaces**
### Changes:
- **Core MCP Components**:
  - Introduced `BrainyMCPAdapter`, `BrainyMCPService`, and `MCPAugmentationToolset` for handling data access, tool execution, system information, and authentication via MCP.
  - Added asynchronous handlers to process requests for Brainy data, augmentations, and relationships.
  - Built pipelines to expose Brainy augmentation capabilities as tools.

- **Server Implementations**:
  - Added WebSocket and REST interfaces in `initializeMCPService` for external MCP requests.
  - Included rate limiting, authentication, and CORS support for REST API.

- **Type Definitions**:
  - Defined MCP-related types such as `MCPRequestType`, `MCPResponse`, and `MCPToolExecutionRequest` in `src/types/mcpTypes.ts`.
  - Incorporated augmentation-type-specific methods from `augmentationPipeline`.

- **Exports**:
  - Exposed MCP modules (`BrainyMCPAdapter`, `BrainyMCPService`, `MCPAugmentationToolset`) via `src/mcp/index.ts`.

### Purpose:
Introduced a Model Control Protocol (MCP) framework to enable seamless integration of Brainy data and augmentation tools with external models. The implementation provides structured, scalable access to data and tools through both WebSocket and REST APIs.
2025-06-20 10:56:21 -07:00
6f6f787bf1 **feat: introduce Optimized HNSW Index with product quantization and disk-based storage support**
### Changes:
- Added `HNSWIndexOptimized` class in `src/hnsw/hnswIndexOptimized.ts`:
  - Supports large datasets with product quantization for dimensionality reduction.
  - Enables disk-based index storage via a configurable storage adapter.
  - Introduces `HNSWOptimizedConfig` interface for advanced configuration:
    - Includes memory thresholds, product quantization (subvectors, centroids), and disk-based indexing options.
  - Implements methods for adding, searching, and managing indexed vectors with enhanced scalability.
- Introduced `ProductQuantizer` utility:
  - Handles vector quantization with training and reconstruction capabilities.
  - Reduces vector dimensions, improving memory and performance efficiency.
- Added accessor methods in `src/hnsw/hnswIndex.ts` for configuration and index metadata (e.g., dimension, max level, entry point).

### Purpose:
Enhanced the HNSW implementation to support optimized indexing and search for large datasets, addressing scalability challenges via product quantization and optional disk-based storage. This update elevates the library's performance and applicability for memory-constrained environments.
2025-06-19 15:02:05 -07:00
755b1a6fc1 **feat: add browser-compatible exports and define BrainyData interface**
### Changes:
- Created `examples/browser_compatible_exports.ts`:
  - Introduced browser-friendly exports with polyfill for `Buffer` in browser environments.
  - Implemented shims for Node.js modules (`fs`, `util`, and `path`) to avoid compatibility issues.
  - Exported browser-compatible types and utilities: `BrainyData`, `NounType`, `VerbType`, graph types, core types, distance functions, embedding utilities, and storage adapters.
  - Explicitly excluded Node.js/CLI-specific parts to focus on browser compatibility.
- Added `src/types/brainyDataInterface.ts`:
  - Defined `BrainyDataInterface` to break the circular dependency between `brainyData.ts` and `serverSearchAugmentations.ts`.
  - Provided methods for managing nodes, relationships, initialization, search, and adding vector data with metadata.

### Purpose:
- Enhanced the codebase to support browser environments by introducing browser-specific exports and avoiding Node.js dependencies.
- Established clearer separation of concerns and modularity by introducing the `BrainyDataInterface` for dependency management, improving maintainability and flexibility.
2025-06-19 15:00:41 -07:00
1635cc229c feat: add WebSocket and WebRTC conduit augmentations with examples
Implemented WebSocketConduitAugmentation and WebRTCConduitAugmentation for syncing Brainy instances. Added comprehensive usage examples to showcase data synchronization via WebSocket and WebRTC.
2025-06-06 08:49:25 -07:00
32d5f45552 chore: update Node.js requirement to 23.11.0 and optimize pipelines and utilities
Upgraded minimum Node.js version from 18.0.0 to 23.11.0 across `README.md`, `package.json`, and `version.ts`. Optimized distance utilities and pipelines to leverage Node.js 23.11+ native performance improvements (e.g., `array.reduce`, WebStreams API). Incremented version to 0.7.4 for consistency.
2025-06-05 14:51:21 -07:00
a774bb0f82 feat: implement SequentialPipeline with threading and WebSocket support
Added the `SequentialPipeline` class for structured augmentation execution. Integrated threading capabilities via the `THREADED` execution mode in `augmentationPipeline`. Enhanced WebSocket support for real-time data processing through pipelines.
2025-06-04 10:01:46 -07:00
18bbe6d428 chore: remove Firestore-related implementations and example files
Deleted all Firestore augmentation, storage, sync implementations, and related type definitions. Removed the FirestoreSync example file as part of the cleanup for disabled Firestore functionality.
2025-06-02 17:03:53 -07:00
3659b0069b chore: temporarily disable Firestore functionality and remove Firebase dependencies
Commented out all Firestore-related code across the project, including sync, storage, and vector search features. Removed Firebase dependencies (`firebase`, `firebase-admin`) from `package.json`. Updated `README.md` to reflect the temporary unavailability of Firestore features.
2025-06-02 12:43:44 -07:00
725610fbe4 feat: add Firestore vector search integration and noun type-based search enhancements
Introduced Firestore vector search integration using `@firebase/firestore-vector-search`. Added support for restricting searches by specific noun types to optimize performance and relevance. Updated `README.md` to document the new functionality and usage examples.
2025-06-02 12:23:11 -07:00
b10a32e8de feat: convert AugmentationResponse methods to use Promises, add search API
Refactored memory augmentation methods to return `Promise<AugmentationResponse>` for async handling. Introduced a new `search` method for vector similarity searches within the memory system.
2025-06-02 09:25:26 -07:00
95a72f4181 chore: reformat code in README.md for improved readability
Applied consistent indentation and line-breaking rules to code and text sections in `README.md`, ensuring better formatting and alignment for readability. No functional changes made.
2025-05-29 10:29:52 -07:00
203b669203 chore: remove examples/externalPlugins.js and pluginLoader.ts, update imports to .js
Deleted `examples/externalPlugins.js` and `pluginLoader.ts` as they are no longer used. Updated all `.ts` imports to `.js` across the codebase. Added `MemberOf` to `VerbType` and filtered disabled augmentations in `executeAugmentationPipeline`. Updated documentation to reflect new augmentation registration process. Removed deprecated `allowImportingTsExtensions` from `tsconfig.json`.
2025-05-29 09:52:30 -07:00
aa4a76352f feat: refactor augmentation interface exports for improved structure
Replaced type aliases with interface extensions to enhance type compatibility and readability. Reorganized exports in `index.ts` to streamline imports.
2025-05-28 11:48:24 -07:00
0d5060aee2 feat: add direct exports for augmentation interfaces
Introduced direct exports for several augmentation interfaces (e.g., ISenseAugmentation, ICognitionAugmentation) to simplify imports and enhance type accessibility. Updated type imports and exports in relevant files.
2025-05-28 11:03:32 -07:00
ce9c5e2522 docs: add separate graph type import section to README and update type definitions
Introduced a new README section explaining how to import graph types individually to enable tree shaking. Updated `package.json` exports to support direct graph type imports. Enhanced `GraphNoun` structure by adding optional `label` and `embeddedVerbs` properties while simplifying the `CreatorMetadata` interface.
2025-05-28 09:56:24 -07:00
5566ddfb09 chore: remove example files and release configuration
Deleted augmentation pipeline examples and `.releaserc.json`, streamlining the repository by eliminating redundant example implementations and release automation files.
2025-05-27 13:58:49 -07:00
022680a2f5 feat: implement augmentation type system and release automation 2025-05-27 13:12:53 -07:00
d2ddbd2613 Add augmentation pipeline and memory augmentation documentation
Introduced an augmentation event pipeline supporting multiple execution modes (e.g., SEQUENTIAL, PARALLEL). Added new Memory Augmentation type for versatile data storage/retrieval (e.g., fileSystem, in-memory, Firestore). Updated `README.md` with pipeline usage, examples, and augmentations reorganization. Included new demo files for augmentation examples.
2025-05-27 10:08:01 -07:00
49480e694c Initial commit of Brainy vector database v0.1.0 2025-05-23 10:55:20 -07:00