add services (Graph RAG, HITL, Workflow Generator, Hooks) + Docker dev env + Chat UX#23
Open
nnnet wants to merge 1 commit intoownpilot:mainfrom
Open
add services (Graph RAG, HITL, Workflow Generator, Hooks) + Docker dev env + Chat UX#23nnnet wants to merge 1 commit intoownpilot:mainfrom
nnnet wants to merge 1 commit intoownpilot:mainfrom
Conversation
…) + Docker dev environment + chat UX improvements New services: - Graph RAG: knowledge graph with entity/relation management, hybrid search (vector + keyword), LightRAG integration - HITL: human-in-the-loop approval system for workflow nodes (approve/reject/modify) - Workflow Generator: LLM-powered DAG creation from natural language goals with SSE progress streaming - Workflow Hooks: lifecycle hooks (logging, metrics, webhook, notification) for workflow execution Infrastructure: - Docker dev environment (docker-compose.dev.yml + Dockerfile.dev) with hot reload via tsx watch - Localhost→host.docker.internal URL rewriting for Docker↔host AI server connectivity - LightRAG service in docker-compose.yml (optional profile) - PostgreSQL migration 028: knowledge graph tables, HITL requests, workflow hooks, generation history Chat UX: - Arrow-up/down input history navigation (localStorage, max 50 entries) - Persist selected LLM provider/model across page refreshes (localStorage) - Cross-model conversation transfer (switch models mid-conversation without losing history) - Provider resolution fallback to local providers (fixes "Provider not found" for LMStudio/Ollama UUIDs) - Toggle endpoint works without body (inverts current state) Other: - Integration test suite (tests/) with seed-demo.sh for demo data - SEED_DATA.md documentation - CLAUDE.md added to .gitignore (fork-specific) - ExecutionLogPanel component for workflow execution visualization Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
New backend services — Graph RAG (knowledge graph with hybrid vector/graph/keyword search), HITL (human-in-the-loop approvals for workflows), Workflow Generator Also includes: Docker dev environment with hot reload, chat UX improvements (input history, persistent LLM selection, cross-model conversation transfer), 7 new DB tables, 30+ API Key bug fixes: "Provider not found" for local providers (LMStudio/Ollama), conversation 404 on model switch, Docker→host AI server connectivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds four new backend services, a Docker-based development environment, and several chat UX improvements. It lays the foundation for knowledge graph management,
human-in-the-loop workflow approvals, LLM-powered workflow generation, and lifecycle hooks.
42 files changed | +4,802 lines | 7 new database tables | 30+ new API endpoints
New Services
1. Graph RAG — Knowledge Graph + Hybrid Retrieval
Manages entity-relationship knowledge graphs with three search modes: vector similarity (pgvector HNSW), graph traversal (neighbor depth queries), and fuzzy keywo23:04:15 [160/538]
(pg_trgm). Optional LightRAG integration for advanced entity extraction.
packages/core/src/services/graph-rag-service.tspackages/gateway/src/services/graph-rag-service.ts(913 LOC)packages/gateway/src/routes/knowledge-graph.ts/api/v1/knowledge-graph/ingest-text/api/v1/knowledge-graph/extract/api/v1/knowledge-graph/ingest/api/v1/knowledge-graph/search/api/v1/knowledge-graph/entities/api/v1/knowledge-graph/entities/:id/api/v1/knowledge-graph/entities/:id/neighbors/api/v1/knowledge-graph/entities/:id/api/v1/knowledge-graph/collections/api/v1/knowledge-graph/collections/api/v1/knowledge-graph/collections/:id/api/v1/knowledge-graph/decay/api/v1/knowledge-graph/lightrag/status/api/v1/knowledge-graph/lightrag/insert/api/v1/knowledge-graph/lightrag/queryDB tables:
knowledge_entities,knowledge_entity_embeddings,knowledge_relations,knowledge_collections2. HITL — Human-in-the-Loop Approvals
Manages approval/rejection requests during workflow execution. Supports multiple interaction types: approve/reject, collect input, review tool calls, multi-turn conversation.
Requests expire automatically after a configurable timeout.
packages/core/src/services/hitl-service.tspackages/gateway/src/services/hitl-service.ts(305 LOC)packages/gateway/src/routes/hitl.ts/api/v1/hitl/requests/api/v1/hitl/requests/pending/api/v1/hitl/requests/:id/api/v1/hitl/requests/:id/resolve/api/v1/hitl/requests/cancel-workflow/api/v1/hitl/expireDB table:
hitl_requests3. Workflow Generator — LLM-Powered DAG Creation
Generates complete workflow definitions from natural-language goals. Three-phase pipeline: decompose goal into subtasks, build DAG with appropriate node types, validate result.
Streams progress to the client via Server-Sent Events.
packages/core/src/services/workflow-generator-service.tspackages/gateway/src/services/workflow-generator-service.ts(556 LOC)packages/gateway/src/routes/workflow-generator.ts/api/v1/workflow-generator/generate/api/v1/workflow-generator/decompose/api/v1/workflow-generator/review/api/v1/workflow-generator/historyDB table:
workflow_generations4. Workflow Hooks — Lifecycle Event Hooks
Registers and fires hooks on workflow execution events (start, end, node start/end/error/retry, approval events). Five hook types: logging, metrics, notification, webhook, custom.
Fire-and-forget execution with 60s in-memory cache.
packages/core/src/services/workflow-hooks-service.tspackages/gateway/src/services/workflow-hooks-service.ts(247 LOC)packages/gateway/src/routes/workflow-hooks.ts/api/v1/workflow-hooks/:workflowId/api/v1/workflow-hooks/:workflowId/api/v1/workflow-hooks/hook/:id/api/v1/workflow-hooks/hook/:id/toggleDB table:
workflow_hook_configsDocker Development Environment 23:04:15 [75/538]
New files:
Dockerfile.dev,docker-compose.dev.ymltsx watchrestarts on changeslocalhost/127.0.0.1→host.docker.internalURL rewriting so containers can reach host-side AI servers (LMStudio, Ollama) withoutmanual configuration
packages/gateway/src/utils/docker-url.ts— shared rewrite function used byBaseProvider,EmbeddingService, andLocalDiscoveryProduction
docker-compose.ymlalso updated with optional LightRAG service.Chat UX Improvements
Arrow-Up Input History
packages/ui/src/components/ChatInput.tsxownpilot-chat-input-history)Persistent LLM Selection
packages/ui/src/hooks/useChatStore.tsxCross-Model Conversation Transfer
packages/gateway/src/routes/chat.tsProvider Resolution Fallback
packages/gateway/src/routes/providers.tsGET /providers/:idandGET /providers/:id/modelsnow fall back to local providers (LMStudio, Ollama) when core preset lookup returns nullToggle Endpoint Fix
packages/gateway/src/routes/local-providers.tsPATCH /local-providers/:id/togglenow works without a request body (inverts current state)Database Migration
File:
packages/gateway/src/db/migrations/postgres/028_knowledge_graph.sqlCreates 7 tables, all idempotent (
IF NOT EXISTS):knowledge_entitiesknowledge_entity_embeddingsknowledge_relationsknowledge_collectionshitl_requestsworkflow_hook_configsworkflow_generationsAll tables enforce multi-tenancy via
user_id; optionalagent_idfor per-agent scoping.Testing & Demo Data
tests/run-all.shtests/seed-demo.shtests/test-health.shtests/test-knowledge-graph.shtests/test-hitl.shtests/test-workflow-generator.shtests/test-workflow-hooks.shdocs/SEED_DATA.mdBugs Fixed
user_id)knowledge_entity_embeddings(referenced by service but not in migration)