Synapse Documentation
repository·master·Indexed 19 days ago
https://github.com/vertexproject/synapseA central intelligence system designed to assist analyst teams across the intelligence life cycle. Documentation covers the deployment of core services including Cortex, Axon (binary blob storage), and JSONStor, as well as the management of the Synapse Data Model, local JSON schema caching via getrefs.py, and the development of Advanced Power-Ups through Storm Services.
What's inside Synapse
- Synapse is a central intelligence system designed to support analyst teams throughout every stage of the intelligence life cycle.
Overview of Advanced Storm features
masterWhile basic Storm operations are sufficient for most analytical workflows, developers and power users can leverage advanced constructs for automation, custom Power-Ups, and complex logic.
Advanced features include:
VariablesMethodsControl FlowFunctions- Storm Type Libraries
- Storm Primitive Types
Rapid Power-Ups are a specific implementation of these advanced features, where extensions are written entirely in Storm and exposed as Storm commands, allowing them to be deployed or updated on the fly without restarting Synapse.
Introduction to Synapse
masterSynapse is a central intelligence and analysis system designed to support analysts through the intelligence life cycle. It is built to fuse large, disparate datasets from multiple disciplines to answer complex questions.
Core Architecture
- Cortex: The Synapse data store, organized as a hypergraph. It is designed to scale vertically to tens of billions of nodes.
- Note on Usage: Synapse is not a replacement for big-data/data-lake storage. It is designed to connect to your existing data sources on demand and ingest relevant data for specific analyses.
- Storm: A powerful and intuitive query language used to interact with data within a Cortex.
- Data Model: An extensible model capable of representing real-world objects, relationships, and events.
- Power-Ups: A modular system used to extend functionality, integrate third-party data, or connect to external databases.
Understand the Synapse Library Structure
masterThe Synapse library is organized into several functional submodules. Understanding these helps locate specific primitives, data models, or tools:
synapse.cmds: Command implementations for theCmdrCLI tool.synapse.data: Internal data files.synapse.lib: Core primitives used to implement applications.synapse.lookup: Lookup definitions.synapse.models: Core Synapse data model definitions.synapse.servers: Modules used to start and run Synapse applications.synapse.tools: Tools for interacting with the Synapse ecosystem.synapse.vendor: Third-party code (internal use only; no API stability guaranteed).synapse.tests.utils: Helper utilities for writing tests.
Access Storm via Telepath and HTTP APIs
masterStorm queries can be executed through two primary interfaces: Telepath (for message streams and RPC-style calls) and HTTP API (for web-based access). Both interfaces accept a Storm query string and optional
optsarguments.Telepath API
storm(text, opts=None): Returns a continuous stream of messages.callStorm(text, opts=None): Returns a single message specified by the Stormreturn()syntax.count(text, opts=None): Returns the number of nodes that would be emitted by the query.
# Example Telepath usage (conceptual) # storm(text, opts=None) -> returns stream # callStorm(text, opts=None) -> returns single message via return() # count(text, opts=None) -> returns node countWhat is a Dmon (Daemon)?
masterA Dmon (short for daemon) is a long-running or recurring query or process that runs continuously in the background. It is typically implemented by a Storm service and is used for non-blocking background tasks, such as processing elements from a queue. Dmons are persistent and will restart if they exit.What is a Constructor (Ctor)?
masterA constructor (or ctor) is code that defines how a property value of a specific type is constructed to ensure it is well-formed. Constructors support type normalization (
type-norm) and type enforcement (type-enforce).Constructor, Guid: A specific constructor used to create
guidvalues. Often referred to as a "gutor", it uses JSON dictionary syntax to deconflict guid nodes and generate predictable values.What is a Storm Package?
masterA Storm Package is a Rapid Power-Up used to extend the capabilities of the Storm query language. It consists of a YAML configuration file that defines commands, modules, documentation, and workflows. These packages can be loaded directly into your Cortex to provide custom functionality, implement use-case specific commands, and embed documentation.
Best Practices:
- Namespacing: Always use a unique namespace (e.g.,
company.functionality) to avoid collisions with other packages. - File Structure: The YAML file acts as the root. Modules and commands are typically stored in subdirectories (
storm/modules/,storm/commands/) relative to the YAML file location.
name: acme-hello version: 0.0.1 synapse_version: '>=2.144.0,<3.0.0' genopts: dotstorm: true author: url: https://acme.newp name: ACME Explosives and Anvils desc: Acme-Hello is a minimal example of a Rapid Power-Up. modules: - name: acme.hello commands: - name: acme.hello.sayhi descr: Print the hello message.- Namespacing: Always use a unique namespace (e.g.,
What is an Auth Gate?
masterAn auth gate (short for "authorization gate", informally a "gate") is an object within a Synapse service that may have its own set of permissions. Common examples of auth gates include a layer or a view.What is an Advanced Power-Up?
masterAn Advanced Power-Up is a standalone application designed to extend the capabilities of the Cortex. It achieves this by implementing a Storm Service.
A typical use case for an Advanced Power-Up is to introduce a new Storm command that executes custom Python logic. This logic can be used to parse files, translate the parsed data into the Synapse datamodel, and subsequently ingest that data into the hypergraph.
What is a BUID?
masterShort for Binary Unique Identifier, a BUID is a globally unique (within a Cortex) SHA-256 digest of a node's msgpack-encoded ndef.What is Storm?
masterStorm is the query language used to interact with data in Synapse. It is designed as a "data language" rather than a programming language, allowing users to ask questions about, retrieve, annotate, add, modify, and delete data within a Synapse Cortex. It uses intuitive syntax, such as the->arrow for pivot operations, to make querying feel like natural language.