๐ก Inspiration
As a developer working with increasingly complex LangGraph-based AI agents, I realized that debugging and understanding agent behavior was like peering through a fog. There were no good tools to see how agents thought, what went wrong, or where vulnerabilities might be lurking, especially in real-time. Inspired by tools like Sentry, Postman, and LangSmith, I wanted to build something that offered:
- Real-time observability for AI workflows.
- A vulnerability scanner tailored for agentic code logic.
- The ability to trace how large language models "think."
NeuroTrace was born from this gap: a seamless DevTool for inspecting, securing, and controlling LangGraph agents like never before.
๐ค What It Does
NeuroTrace is a developer-first platform that transforms opaque AI workflows into interactive, inspectable experiences. It brings together:
- ๐ฎ Agent Flow Visualization: A dynamic graph shows exactly how your LangGraph agent is executingโnode by node, edge by edge.
- ๐ก๏ธ AI Security Scanner:
- Static and GPT-powered vulnerability analysis (SQLi, command injection, hardcoded secrets, etc.).
- Categorized risks by severity: Critical, High, Medium, Low.
- ๐ Structured Logs:
- Captures every step, error, decision, and response.
- Token usage, prompt/responses, execution metadata.
- ๐ง LLM Thought Capture: Log the inner monologue of your LLMs with minimal setup.
- ๐ป Click-to-Inspect Nodes:
- Source code with syntax highlighting.
- Runtime context and state.
- Vulnerability context with auto-suggested remediations.
- ๐ก Real-time Updates: Frontend continuously polls backend endpoints for latest data.
๐ ๏ธ How I Built It
๐ Agent Instrumentation Layer:
- Built a custom
NeuroTraceclass that wraps LangGraph workflows. - Injects a specialized
NTCallbackHandlerto capture LLM events, decisions, and metadata. - Uses AST parsing to extract code and static analysis for vulnerabilities.
- GPT-4 used via OpenAI API to generate non-obvious risk vectors and remediation advice.
โ๏ธ Backend:
- Python 3.9+, using LangChain, LangGraph, OpenAI, and Requests.
- API calls to frontend handled via Next.js API Routes instead of a standalone server.
- Data stored in
processed_agent_code.jsonandprocessed_logs.jsonfor simplicity and portability.
๐งโ๐จ Frontend:
- Next.js with TypeScript and Tailwind CSS.
- Visualized execution flow via ReactFlow, enhanced with animations using Framer Motion.
- Includes loading skeletons, click-to-expand nodes, and card-style vulnerability summaries.
- Fully responsive UI with support for keyboard navigation and dark mode.
๐ง Challenges I Ran Into
- LangGraph Complexity: Nodes and subgraphs dynamically mutate, making static visualization tricky.
- Security Detection: GPT-4 outputs were verboseโI had to engineer smart prompt templates and extract concise summaries.
- Frontend-Backend Sync: Maintaining state between a Python process and a polling JS frontend required careful debounce and refresh tuning.
- Latency: Real-time logging with LLMs and OpenAI calls had to be optimized to feel snappy.
๐ Accomplishments That I'm Proud Of
- Built a LangGraph-native DevTool that works with a one-line wrapper.
- Created a GPT-4 powered security engine that finds nuanced logic bugs in AI code.
- Designed a beautiful, fast frontend that updates live without ever refreshing.
- Architected for extensibility: modular logging, flexible API endpoints, and frontend-first rendering logic.
๐ What I Learned
- How to build hybrid AI+frontend tools across Python and JS ecosystems.
- Practical prompt engineering techniques for generating structured, actionable insights from GPT-4.
- Graph theory principles for rendering dynamic LLM workflows.
- Best practices for building developer-facing tools: fail-safe logging, stateless polling, and minimal user config.
๐ Whatโs Next for NeuroTrace
- [ ] ๐งช Real-time Agent State Viewer: View the agentโs full state at every decision point.
- [ ] ๐ Log Explorer: Advanced filters, tags, search across token traces, prompts, and errors.
- [ ] ๐ Static + Dynamic Hybrid Security Engine: Integrate runtime behavior to catch edge-case vulns.
- [ ] ๐ Framework Adapters: Add support for CrewAI, AutoGen, and Fetch.aiโs uAgents.
- [ ] ๐งต Session Export/Replay: Save workflow executions and replay them with updated code.
- [ ] ๐ฆ GitHub Integration: CI vulnerability reports, PR checks, and traceable logs per commit.
Built With
- api
- css
- fastapi
- flask
- github
- langchain
- langgraph
- openai
- python
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.