This repository has been archived on 2026-09-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
open-brainy/src/browserFramework.ts
David Snelling 2a94fca875 feat: Brainy 3.0 - Production-ready Triple Intelligence database
Major improvements and simplifications:
- Simplified to Q8-only model precision (99% accuracy, 75% smaller)
- Removed WAL augmentation (not needed with modern filesystems)
- Eliminated all fake/stub code - 100% production-ready
- Added comprehensive cloud deployment support (Docker, K8s, AWS, GCP)
- Enhanced distributed system capabilities
- Improved Triple Intelligence find() implementation
- Added streaming pipeline for large-scale operations
- Comprehensive test coverage with new test suites

Breaking changes:
- Renamed BrainyData to Brainy (simpler, cleaner)
- Removed FP32 model option (Q8 provides 99% accuracy)
- Removed deprecated augmentations

Performance improvements:
- 10x faster initialization with Q8-only
- Reduced memory footprint by 75%
- Better scaling for millions of items

Co-Authored-By: Recovery checkpoint system
2025-09-11 16:23:32 -07:00

40 lines
No EOL
1.2 KiB
TypeScript

/**
* Browser Framework Entry Point for Brainy
* Optimized for modern frameworks like Angular, React, Vue, etc.
* Auto-detects environment and uses optimal storage (OPFS in browsers)
*/
import { Brainy, BrainyConfig } from './brainy.js'
import { VerbType, NounType } from './types/graphTypes.js'
/**
* Create a Brainy instance optimized for browser frameworks
* Auto-detects environment and selects optimal storage and settings
*/
export async function createBrowserBrainy(config: Partial<BrainyConfig> = {}): Promise<Brainy> {
// Brainy already has environment detection and will automatically:
// - Use OPFS storage in browsers with fallback to Memory
// - Use FileSystem storage in Node.js
// - Request persistent storage when appropriate
const browserConfig: BrainyConfig = {
storage: {
type: 'opfs',
options: {
requestPersistentStorage: true // Request persistent storage for better performance
}
},
...config
}
const brainyData = new Brainy(browserConfig)
await brainyData.init()
return brainyData
}
// Re-export types and constants for framework use
export { VerbType, NounType, Brainy }
export type { BrainyConfig }
// Default export for easy importing
export default createBrowserBrainy