NeuronDB: AI Database Extension for PostgreSQL
REST API and WebSocket agent runtime system with long-term memory, tool execution, and streaming responses. Integrates seamlessly with NeuronDB.
NeuronDB A PostgreSQL AI-Extension Demo
Architecture
AI agent runtime architecture with state management, memory store, and tool execution
NeuronAgent Architecture
API Layer
REST API | WebSocket | Health Check
Agent State Machine
- • State Persistence
- • Task Execution
- • Recovery & Retry
- • State Transitions
Session Management
- • Session Lifecycle
- • Context Management
- • Message History
- • Multi-tenancy
Tool Registry
- • SQL Tools
- • HTTP Tools
- • Code Execution
- • Shell Commands
Memory Store
- • HNSW Vector Search
- • Context Retrieval
- • Long-term Memory
- • Semantic Search
Job Queue
- • Background Jobs
- • Retry Logic
- • Poison Handling
- • SKIP LOCKED
NeuronDB Integration
Vector Search | Embeddings | LLM Operations | PostgreSQL
Why NeuronDB
Agent State Machine
Complete state machine for autonomous task execution with state persistence, recovery, and transition management. Supports complex workflows with conditional branching and state validation.
Long-term Memory
HNSW-based vector search for context retrieval from historical conversations and knowledge base. Semantic search across agent interactions. Memory persistence across sessions with temporal relevance weighting.
Tool System
Extensible tool registry supporting SQL, HTTP, Code, and Shell operations. Tool execution with timeout, validation, and error handling. Streaming responses for long-running operations. Custom tool registration API.
REST API & WebSocket
Full CRUD API for agents, sessions, and messages. WebSocket support for real-time streaming responses. RESTful endpoints with OpenAPI documentation. Rate limiting and authentication middleware.
Background Jobs
PostgreSQL-based job queue with worker pool, retries, and poison message handling. SKIP LOCKED for concurrent processing. Crash recovery and job state persistence. Tenant-aware job isolation.
Authentication & Security
API key-based authentication with rate limiting and role-based access control. Request validation and sanitization. Audit logging for security compliance. Multi-tenant isolation at the database level.
Session Management
Session lifecycle management with context preservation. Message history tracking and pagination. Multi-agent session support. Session timeout and cleanup policies.
NeuronDB Integration
Deep integration with NeuronDB for embeddings generation, vector search, and LLM operations. Direct SQL tool access to NeuronDB functions. Efficient context retrieval using HNSW indexes.
Capabilities
Agent runtime features
| Capability | Description | Performance | Production Ready |
|---|---|---|---|
| Agent State Machine | State persistence, recovery, transitions | Sub-second state changes | ✓ |
| Long-term Memory | HNSW vector search, semantic retrieval | Millisecond context lookup | ✓ |
| Tool Registry | SQL, HTTP, Code, Shell tools | Concurrent execution | ✓ |
| REST API | Full CRUD operations for agents, sessions | High-throughput requests | ✓ |
| WebSocket | Real-time streaming responses | Low-latency streaming | ✓ |
| Background Jobs | Job queue with retries, SKIP LOCKED | Non-blocking async ops | ✓ |
| Authentication | API keys, rate limiting, RBAC | OAuth-ready | ✓ |
Build AI Agents with NeuronAgent
Deploy NeuronAgent. Create autonomous agent systems with persistent memory, tool execution, and streaming responses.