Project Setup
Embed ArcFlow in any project type. The API is the same across Node.js, Python, and Rust — in-memory for tests, persistent for production, no configuration files required.
Node.js / Express / Fastify#
import { open } from 'arcflow'
// Open once at startup, share across request handlers
const db = open('./data/graph')
app.get('/api/people', (req, res) => {
const result = db.query("MATCH (n:Person) RETURN n.name, n.age")
res.json(result.rows.map(r => r.toObject()))
})
app.post('/api/people', (req, res) => {
const { name, age } = req.body
db.mutate("CREATE (n:Person {name: $name, age: $age})", { name, age })
res.json({ ok: true })
})
// Graceful shutdown
process.on('SIGTERM', () => {
db.close()
process.exit(0)
})Testing#
import { openInMemory } from 'arcflow'
describe('my graph logic', () => {
let db
beforeEach(() => {
// Fresh in-memory graph per test — fast, no cleanup needed
db = openInMemory()
})
it('creates and queries nodes', () => {
db.mutate("CREATE (n:Person {name: 'Alice'})")
const result = db.query("MATCH (n:Person) RETURN n.name")
expect(result.rows[0].get('name')).toBe('Alice')
})
})TypeScript configuration#
The SDK ships with full type definitions. No extra @types/ packages needed.
// tsconfig.json — no special config required
{
"compilerOptions": {
"target": "ES2022",
"module": "commonjs",
"strict": true,
"esModuleInterop": true
}
}Monorepo setup (pnpm / turborepo)#
// packages/my-app/package.json
{
"dependencies": {
"arcflow": "workspace:*"
}
}If using pnpm with file: protocol during local dev, the .node binary may not sync on rebuild. Workaround:
# Manually copy the built .node binary into your node_modules
cp <built-binary>.node node_modules/arcflow/arcflow.<platform>.nodeEnvironment setup#
# Optional: disable Metal GPU if module load hangs during development
export ARCFLOW_METAL_FORCE_UNAVAILABLE=trueData directory conventions#
my-project/
├── data/
│ └── graph/ # ArcFlow data directory
│ ├── worldcypher.snapshot.json # Graph snapshot (auto-managed)
│ └── wal/ # Write-ahead log (auto-managed)
├── src/
│ └── ...
└── package.json
Add to .gitignore:
data/graph/
See Also#
- Quickstart — first world model query in 5 minutes
- Installation — pre-built binaries for all platforms
- Agent-Native Database — filesystem workspace layout and CLI usage
- Language Bindings — Node.js, Python, Rust, Go, WASM
Try it
Open ↗⌘↵ to run
Loading engine…