Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory Tree

3D knowledge graph visualization with Express API and PostgreSQL backend. Extracted from MF0-1984 project.

Features

  • 3D force-directed graph (3d-force-graph)
  • Brain visualization mode (Three.js)
  • Node CRUD: merge, delete, rename
  • Edge operations: delete, move
  • Text-based search
  • Hemisphere assignment for brain visualization
  • S3 sync — auto-import from TRIZ Wiki (Cloudflare R2)

Setup

  1. npm install
  2. Copy .env.example to .env, set DATABASE_URL and S3 credentials
  3. npm run dev (development) or npm run build && npm start (production)

API

Graph CRUD

  • GET /api/memory-graph — full graph
  • POST /api/memory-graph/ingest — add nodes/edges/commands
  • POST /api/memory-graph/import — replace entire graph (JSON)
  • PATCH /api/memory-graph/nodes/:id/hemisphere — set hemisphere
  • POST /api/memory-graph/search — text search
  • GET /api/brain/visual — brain visualization data
  • GET /api/brain/hemisphere-counts — hemisphere counts
  • POST /api/brain/calibrate — calibrate brain positions

S3 Sync

  • POST /api/sync — full sync from TRIZ Wiki (replaces graph)
    • Body: { "includeContent": false } — set true to fetch article text as blob (slower)
  • POST /api/sync/ingest — add wiki articles without replacing existing graph

Sync workflow

# Full import from wiki (nodes + links, no content)
curl -X POST http://localhost:3000/api/sync

# Full import with article content (first 200 articles)
curl -X POST http://localhost:3000/api/sync -H "Content-Type: application/json" -d '{"includeContent":true}'

Environment Variables

Variable Description
PORT Server port (default: 3000)
DATABASE_URL PostgreSQL connection string
S3_ENDPOINT Cloudflare R2 endpoint URL
S3_ACCESS_KEY_ID S3 access key
S3_SECRET_ACCESS_KEY S3 secret key

Categories (TRIZ Wiki)

  • Якорь — root articles (00_якорь)
  • Ядро — fundamental laws, principles (01_ядро)
  • Методологии — tools and approaches (02_методологии, 02_широкие_темы)
  • Практики — cases, analysis, patents (03_практики)
  • Контекст — participants, competitors, platform (04_контекст)
  • Медиа — images and diagrams
  • Другое — uncategorized

Railway deploy

  1. Connect repo to Railway
  2. Add PostgreSQL plugin
  3. Set environment variables (DATABASE_URL, S3_*)
  4. Deploy
  5. Run curl -X POST https://your-app.up.railway.app/api/sync to import wiki

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages