CoolFace
Apppublic

Vedanshipanda/layer10-api

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
App README

๐Ÿง  Layer10 Memory Graph

An organizational knowledge graph built from GitHub issues using LLMs โ€” visualized as an interactive force-directed graph.


๐Ÿ“ Project Structure

layer10-memory-graph/
โ”œโ”€โ”€ Dockerfile              # Backend container for Hugging Face
โ”œโ”€โ”€ README.md               # This file
โ”œโ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.py             # FastAPI backend
โ”‚   โ”œโ”€โ”€ graph.py            # Graph building logic
โ”‚   โ”œโ”€โ”€ extraction.py       # LLM entity extraction
โ”‚   โ””โ”€โ”€ ingestion.py        # Data ingestion
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ memory_graph.json   # Knowledge graph (139 nodes, 81 edges)
โ””โ”€โ”€ ui/                     # React frontend
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ App.js
    โ”‚   โ””โ”€โ”€ App.css
    โ””โ”€โ”€ package.json

๐Ÿ”ง Backend โ€” FastAPI

Endpoints

MethodPathDescription
GET/graphReturns all nodes and edges as {nodes, links}
GET/retrieve?query=Search over graph nodes, returns {context_pack}
GET/healthHealth check
GET/docsInteractive Swagger UI

Stack

  • โ€”FastAPI โ€” REST API
  • โ€”NetworkX โ€” graph data structure
  • โ€”Uvicorn โ€” ASGI server
  • โ€”Docker โ€” containerized deployment

Local Development

bash
# Create virtual environment
python -m venv venv
venv\Scripts\activate       # Windows
source venv/bin/activate    # Mac/Linux

# Install dependencies
pip install -r requirements.txt

# Run server
uvicorn src.main:app --reload --port 8000

API docs at http://localhost:8000/docs

Deployment โ€” Hugging Face Spaces (Docker)

  1. 1.Go to huggingface.co โ†’ New Space
  2. 2.Name: layer10-api ยท SDK: Docker
  3. 3.Push repo with Dockerfile, src/, data/, README.md
  4. 4.Space auto-builds and runs on port 7860

Live at: https://Vedanshipanda-layer10-api.hf.space


๐Ÿ–ฅ๏ธ Frontend โ€” React

Features

  • โ€”Knowledge Graph โ€” interactive force-directed graph with glowing nodes and animated edges
  • โ€”Filters โ€” filter by entity type, relationship type, min degree, max nodes
  • โ€”Analytics โ€” type distribution charts, top relationship types, most connected nodes table
  • โ€”Node Explorer โ€” inspect any node's incoming and outgoing relationships
  • โ€”Query โ€” search the graph via backend API and highlight matching nodes

Stack

  • โ€”React โ€” frontend framework
  • โ€”react-force-graph-2d โ€” WebGL graph rendering
  • โ€”Axios โ€” API calls
  • โ€”Orbitron + Share Tech Mono โ€” robotic HUD-style fonts

Local Development

bash
cd ui
npm install
npm start

Make sure the backend is running at http://localhost:8000 first.

Deployment โ€” Hugging Face Spaces (Static)

  1. 1.Go to huggingface.co โ†’ New Space
  2. 2.Name: layer10-ui ยท SDK: Static
  3. 3.Build the frontend:
bash
cd ui
npm run build
  1. 1.Upload everything inside ui/build/ to the Space

Live at: https://Vedanshipanda-layer10-ui.hf.space


๐Ÿš€ Full Stack Setup

ServiceURL
Backend APIhttps://Vedanshipanda-layer10-api.hf.space
Frontend UIhttps://Vedanshipanda-layer10-ui.hf.space
API Docshttps://Vedanshipanda-layer10-api.hf.space/docs

๐Ÿ“Š Graph Stats

  • โ€”139 nodes โ€” Bugs, Developers, Features, Issues, Repositories, Technologies
  • โ€”81 edges โ€” relationships extracted from GitHub issues via LLM
  • โ€”6 entity types โ€” color-coded with neon glow in the visualization