brainy/examples/README.md

2.4 KiB

Brainy Examples

This directory contains examples demonstrating various features and use cases of the Brainy vector graph database.

Browser-Server Search Example

The browser-server-search example demonstrates how to use Brainy in a browser, call a server-hosted version for search, store the results locally, and then perform further searches against the local instance.

This approach allows you to:

  • Search a server-hosted Brainy instance from a browser
  • Store the search results in a local Brainy instance
  • Perform further searches against the local instance without needing to query the server again
  • Add data to both local and server instances

See the browser-server-search README for detailed instructions.

Other Examples

Augmentation Examples

Pipeline Examples

Demo

  • demo.html - A web demo showcasing Brainy's capabilities

Configuration Examples

Data Inspection

Running the Examples

Most JavaScript examples can be run using Node.js:

node examples/sequentialPipelineExample.js

For HTML examples, you can open them directly in a browser or serve them using a local HTTP server:

# Using a simple HTTP server
npx http-server

Then navigate to the appropriate URL in your browser (e.g., http://localhost:8080/examples/demo.html).

Creating Your Own Examples

Feel free to use these examples as a starting point for your own projects. You can copy and modify them to suit your needs.

If you create an example that might be useful to others, consider contributing it back to the Brainy project!