Objlab
← News
Linguaggi e compilatori

Show HN: HelixDB – Un database grafico basato su un sistema di archiviazione a oggetti

Sintesi redazionale: Ciao HN, è passato poco più di un anno da quando abbiamo lanciato HelixDB (https://news.ycombinator.com/item?id=43975423), un progetto che io e un mio amico abbiamo avviato all'università. Si tratta di un database grafico OLTP basato su object-storage, con ricerca vettoriale nativa e ricerca full-text (FTS).. Fonte originale: https://github.com/HelixDB/helix-db/tree/main

<p>HelixDB is a database that makes it easy to build all the components needed for AI applications in a single platform.</p><p>You don&#x27;t need a separate application DB, relational DB, vector DB, graph DB, or application layers to manage the multiple storage locations. HelixDB gives your agents federated access to company data, for memory, company brains, and applications.</p><p>Helix primarily operates with a graph + vector data model, but it also supports KV, documents, and relational data.</p><p>The Helix CLI runs and manages local instances and talks to Helix Cloud.</p><p>`curl -sSL &quot;https://install.helix-db.com&quot; | bash`</p><p>Already installed? Update to the latest version with `helix update`</p><p>.</p><p>`helix chef`</p><p>is an interactive, one-shot bootstrapper. It installs the HelixDB query skills and docs MCP, scaffolds a project, starts a local instance, seeds some example data, and writes a `HELIX_CHEF_PROMPT.md`</p><p>. If a coding agent is available (Claude Code, Codex, or OpenCode), it can hand off and build a working app — frontend and all — from a one-line description of what you want.</p><p>`helix chef`</p><p>That&#x27;s it — no flags. Answer &quot;what do you want to build?&quot; and follow the prompts.</p><p>If you&#x27;d rather wire things up yourself:</p><p>**Initialize a project.**This scaffolds`helix.toml`</p><p>, a`.helix/`</p><p>workspace dir, and a ready-to-run`examples/request.json`</p><p>.</p><p>```<br>mkdir my-helix-app &amp;&amp; cd my-helix-app<br>helix init<br>```</p><p>**Start a local instance.**Runs a background container on port`6969`</p><p>and waits until it accepts queries.</p><p>` helix start dev`</p><p>⚠️ The default storage mode isin-memory— stopping the instance wipes its data. Use`helix start dev --disk`</p><p>to persist data across restarts, or`--foreground`</p><p>to stream logs.</p><p>**Send a query.**</p><p>` helix query dev --file examples/request.json`</p><p>**Stop the instance when you&#x27;re done.**</p><p>` helix stop dev`</p><p>Queries are authored with the Rust, TypeScript, Go, or Python DSL and sent straight to a running instance as dynamic requests against `POST /v1/query`</p><p>— no build or deploy step. The SDKs produce the same JSON AST. The examples below talk to a local instance on `http://localhost:6969`</p><p>(the default `helix start dev`</p><p>port). See the Querying Guide for the full builder catalog and the dynamic-query wire format.</p><p>Install the crate (published as `helix-db`</p><p>, imported as `helix_db`</p><p>):</p><p>`cargo init &amp;&amp; cargo add helix-db tokio sonic-rs`</p><p>Define your queries as `#[register]`</p><p>functions, then run them directly through the client:</p><p>```<br>use helix_db::Client;<br>use helix_db::dsl::prelude::*;<br>#[register]<br>pub fn add_user(name: String) {<br>write_batch()<br>.var_as(<br>&quot;user&quot;,<br>g().add_n(&quot;User&quot;, vec![(&quot;name&quot;, name)])<br>.value_map(None::&lt;Vec&lt;String&gt;&gt;),<br>)<br>.returning([&quot;user&quot;])<br>}<br>#[register]<br>pub fn get_user(name: String) {<br>read_batch()<br>.var_as(<br>&quot;user&quot;,<br>g().n_with_label(&quot;User&quot;)<br>.where_(Predicate::eq(&quot;name&quot;, name))<br>.value_map(None::&lt;Vec&lt;String&gt;&gt;),<br>)<br>.returning([&quot;user&quot;])<br>}<br>#[tokio::main]<br>async fn main() {<br>let client = Client::new(None).unwrap(); // defaults to http://localhost:6969<br>// add user<br>let new_user = client<br>.query::&lt;sonic_rs::Value&gt;()<br>.dynamic(add_user(&quot;John Doe&quot;.to_string()))<br>.send()<br>.await<br>.unwrap();<br>println!(&quot;new user: {:#}&quot;, sonic_rs::to_string_pretty(&amp;new_user).unwrap());<br>// get user<br>let user = client<br>.query::&lt;sonic_rs::Value&gt;()<br>.dynamic(get_user(&quot;John Doe&quot;.to_string()))<br>.send()<br>.await<br>.unwrap();<br>println!(&quot;user: {:#}&quot;, sonic_rs::to_string_pretty(&amp;user).unwrap());<br>}<br>```</p><p>Install the package (Node.js 20+):</p><p>`npm init -y &amp;&amp; npm install @helix-db/helix-db`</p><p>Define your queries as functions, then `POST`</p><p>them to the running instance:</p><p>```<br>import {<br>Predicate, PropertyInput, PropertyProjection,<br>defineParams, g, param, readBatch, writeBatch,<br>} from &quot;@helix-db/helix-db&quot;;<br>const addUserParams = defineParams({ name: param.string() });<br>function addUser(p = addUserParams) {<br>return writeBatch()<br>.varAs(&quot;user&quot;,<br>g().addN(&quot;User&quot;, { name: PropertyInput.param(&quot;name&quot;) })<br>.project([PropertyProjection.new(&quot;name&quot;)]),<br>)<br>.returning([&quot;user&quot;]);<br>}<br>const getUserParams = defineParams({ name: param.string() });<br>function getUser(p = getUserParams) {<br>return readBatch()<br>.varAs(&quot;user&quot;,<br>g().nWithLabel(&quot;User&quot;)<br>.where(Predicate.eqParam(&quot;name&quot;, &quot;name&quot;))<br>.project([PropertyProjection.new(&quot;name&quot;)]),<br>)<br>.returning([&quot;user&quot;]);<br>}<br>const HELIX_URL = &quot;http://localhost:6969/v1/query&quot;;<br>// add user<br>const newUser = await fetch(HELIX_URL, {<br>method: &quot;POST&quot;,<br>headers: { &quot;content-type&quot;: &quot;application/json&quot; },<br>body: addUser().toDynamicJson(addUserParams, { name: &quot;John Doe&quot; }),<br>}).then((r) =&gt; r.json());<br>console.log(&quot;new user:&quot;, newUser);<br>// get user<br>const user = await fetch(HELIX_URL, {<br>method: &quot;POST&quot;,<br>headers: { &quot;content-type&quot;: &quot;application/json&quot; },<br>body: getUser().toDynamicJson(getUserParams, { name: &quot;John Doe&quot; }),<br>}).then((r) =&gt; r.json());<br>console.log(&quot;user:&quot;, user);<br>```</p><p>Install the package from this repository:</p><p>`pip install -e sdks/python`</p><p>Build dynamic requests with snake_case builders, then send them with the client:</p><p>```<br>from helixdb import Client, Predicate, g, param, define_params, read_batch, write_batch<br>add_user_params = define_params({&quot;name&quot;: param.string()})<br>add_user = (<br>write_batch()<br>.var_as(&quot;user&quot;, g().add_n(&quot;User&quot;, {&quot;name&quot;: add_user_params.name}))<br>.returning([&quot;user&quot;])<br>)<br>get_user_params = define_params({&quot;name&quot;: param.string()})<br>get_user = (<br>read_batch()<br>.var_as(<br>&quot;user&quot;,<br>g()<br>.n_with_label(&quot;User&quot;)<br>.where(Predicate.eq(&quot;name&quot;, get_user_params.name))<br>.value_map([&quot;name&quot;]),<br>)<br>.returning([&quot;user&quot;])<br>)<br>client = Client(&quot;http://localhost:6969&quot;)<br>new_user = client.query().dynamic(<br>add_user.to_dynamic_request(add_user_params, {&quot;name&quot;: &quot;John Doe&quot;})<br>).send()<br>print(&quot;new user:&quot;, new_user)<br>user = client.query().dynamic(<br>get_user.to_dynamic_request(get_user_params, {&quot;name&quot;: &quot;John Doe&quot;})<br>).send()<br>print(&quot;user:&quot;, user)<br>```</p><p>HelixDB Cloud is an object-storage-backed deployment with integrated vector and full-text search, full ACID transactions, a single writer with auto-scaling reader nodes, and high availability (3+ gateways and DB nodes). Cloud clusters use a separate deploy path from local instances:</p><p>```<br>helix auth login # authenticate<br>helix workspace switch &lt;workspace&gt; # select workspace + project<br>helix project switch &lt;project&gt;<br>helix init cloud --cluster-id &lt;cluster-id&gt; # or: helix add cloud --name production --cluster-id &lt;id&gt;<br>helix sync production # pull gateway URL + auth contract into helix.toml<br>helix query production --file examples/request.json<br>```</p><p>HelixDB is available as a distributed, high-availability, managed service. If you&#x27;re interested in using Helix&#x27;s managed service, go to our website to get started or contact us to talk with a founder.</p><p>Just Use Helix.</p>