Skip to content

ACP Integration and Local LLM Capability #997

Closed

Description

@malibio

Overview

Implement NodeSpace's two-tier agent architecture: an embedded local agent (Tier 1) for knowledge graph manipulation and external agent support via ACP (Tier 2) for coding tasks.

This epic covers the complete implementation from shared interface contracts through to end-to-end integration testing, organized for maximum parallel development.

Architecture

Tier 1 — Local Agent (always available, embedded):

  • In-process knowledge graph copilot using llama-cpp-2 with Ministral GGUF models
  • ReAct loop with direct Rust calls to NodeService/NodeEmbeddingService
  • Auto-selects model based on system RAM (>16GB -> 8B, <=16GB -> 3B)
  • Tools: search_nodes, search_semantic, get_node, create_node, update_node, create_relationship, get_related_nodes

Tier 2 — External Agents via ACP (optional, on demand):

  • Claude Code, Gemini CLI, Mistral Vibe spawned as ACP subprocesses
  • NDJSON over stdio (bidirectional JSON-RPC 2.0)
  • Context assembly from knowledge graph at session start + ongoing MCP access

UX Entry Point:

  • Side nav AI item opens AI panel
  • First-launch modal: choose between existing LLM provider (ACP) or download local model
  • Subsequent visits go straight to chat panel

AI Chat as Node:

  • Conversations stored as ai-chat nodes with messages[] in nested properties (same pattern as playbook rules[])
  • Both local and ACP conversations captured for end-to-end development traceability
  • Behavior-owned embedding: get_embeddable_content() extracts user + assistant text, skips tool calls
  • Permissions via Stamped ACL (access_tags), sync as regular nodes

Child Issues

Foundation

Phase 2 - Parallel Implementation (5 streams, zero cross-dependencies)

Phase 3 - Dependent Implementation (4 streams)

Phase 4-5 - Integration

Dependency Graph

                      #998 Foundation Types
                    /      |       |       |        \
                   v       v       v       v         v
              #999     #1000   #1001   #1002      #1003
              NLP Chat  Model   ACP     ACP      Frontend
              Inference  Mgr   Transport Registry  Chat UI
                  \       |       |        |        /
                   \      |       v        v       /
                    \     |    #1004    #1005     /
                     \    |    ACP     Context   /
                      \   |    Session Assembly /
                       v  v       \      /
                      #1006 Local Agent Loop
                          |
                          v
                      #1007 Agent Tools
                          |
                          v
                      #1008 Tauri Command Wiring
                          |
                          v
                      #1009 E2E Integration Tests

Independent (can run anytime after #998):
  #1017 AI Chat Node Type
  #1018 Embedding Service Refactor

Parallel Lanes After #998

Lane Issues Focus
A #999, #1000 NLP Engine + Model Manager
B #1001, #1002, #1004, #1005 ACP stack
C #1003, #1017 Frontend + AI Chat node type
D #1006, #1007 Local Agent (mock inference)
E #1018 Embedding refactor (independent)

Critical path: #998 -> #999 -> #1006 -> #1008 -> #1009

Key Architecture References

  • nodespace-docs/architecture/acp-integration.md — Complete ACP spec
  • nodespace-docs/decisions/008-nlp-engine-architecture.md — NLP engine ADR
  • nodespace-docs/architecture/mcp-integration.md — MCP server spec
  • nodespace-docs/architecture/cloud-sync.md — Stamped ACL permissions and sync
  • packages/nlp-engine/ — Existing embedding service (foundation for chat)
  • packages/core/src/behaviors/mod.rs — NodeBehavior trait (embedding ownership)

Design Decisions

  • Auto-select model based on system RAM (not user picker on first launch)
  • Agent services live OUTSIDE AppServices (survive database hot-swaps)
  • Knowledge graph is the coordination layer between tiers (no agent-to-agent RPC)
  • Local-first guarantee: NodeSpace fully functional with zero models and zero agents
  • Chat messages as nested properties (playbook rules pattern), not child nodes
  • Behavior-owned embedding: types decide what content to embed via get_embeddable_content()
  • ACP conversations captured as ai-chat nodes for development traceability

Activity

  1. malibio commented on Apr 5, 2026

    @malibio
    CollaboratorAuthor

    All 14 sub-issues completed and closed (#998, #999, #1000, #1001, #1002, #1003, #1004, #1005, #1006, #1007, #1008, #1009, #1017, #1018). Epic done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions