You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Board: 0 backlog | 0 todo | 0 in progress | 0 review | 136 done
Project Overview
CodeGraph is an enterprise-grade system that extracts ontological entities from UI code snippets (Material UI, Tailwind CSS, Chakra UI, Bootstrap, and proprietary code) and generates complete vanilla web code from natural language queries. The key innovation is the "neural proposes, symbolic disposes" architecture using NARS (Non-Axiomatic Reasoning System) for symbolic reasoning with evidential truth-values, effectively mitigating LLM hallucinations.
Key Differentiators
Feature
Description
Benefit
NARS Reasoning
LLM translates NL↔Narsese, NARS reasons with truth-values
Mitigates hallucinations
AIKR Native
Assumption of Insufficient Knowledge and Resources
# Development
cargo build
cargo test
cargo check
cargo clippy
cargo fmt
# Run server
cargo run -p codegraph-cli -- serve
# Run benchmarks
cargo run -p codegraph-cli -- benchmark
# Docker infrastructure
docker compose -f .cwa/docker/docker-compose.yml up -d
# Run without ONA (offline mode)
CODEGRAPH_ONA_ENABLED=false cargo run -p codegraph-cli -- serve
API Endpoints
Endpoint
Method
Description
/api/snippets
POST
Upload a code snippet
/api/snippets
GET
List snippets (paginated)
/api/snippets/:id
GET
Get snippet by ID
/api/snippets/:id
DELETE
Delete a snippet
/api/query
GET
Search components with ?q= parameter
/api/generate
POST
Generate UI code from description
/api/feedback
POST
Submit RLKGF feedback
/api/stats
GET
Knowledge graph statistics
/api/metrics/rlkgf
GET
RLKGF metrics and trends
/health
GET
Basic health check
/health/ready
GET
Readiness check with service status
/health/live
GET
Liveness probe
/metrics
GET
Prometheus metrics
MCP Tools
Tool
Description
extract_snippet
Extract UI elements from HTML/CSS/JS code
query_ui
Search components using NARS reasoning
generate_code
Generate UI code from natural language
give_feedback
Provide RLKGF feedback (thumbs up/down)
get_graph_stats
Get knowledge graph statistics
Production Features
Rate Limiting: 100 req/min per IP with Redis
Request Tracing: UUID trace_id in all requests
Prometheus Metrics: /metrics endpoint for monitoring
Error Tracking: Sentry-compatible abstraction
Retry Policies: Exponential backoff with circuit breaker
Graceful Degradation: Cached responses when services offline
Health Checks: /health, /health/ready, /health/live
Degradation Modes
Mode
Condition
Behavior
Normal
All services operational
Full functionality
Degraded
Non-critical services offline (Redis, ONA)
Core features work
Cached
Critical services offline
Serves cached responses only
Offline
Degradation disabled and services down
System unavailable
Configuration
All configuration via environment variables. Key settings:
Variable
Default
Description
SERVER_PORT
3000
Server port
NEO4J_URI
bolt://localhost:7687
Neo4j connection
QDRANT_URL
http://localhost:6334
Qdrant URL
REDIS_URL
-
Redis URL (optional)
OPENAI_API_KEY
-
OpenAI API key (required)
CODEGRAPH_ONA_ENABLED
true
Enable NARS reasoning
LOG_LEVEL
info
Log level
See README.md for the complete configuration reference.