How chengpeng-cp/nexus-agent works
NexusAgent is a Go agent platform with a React console. Users sign in, configure models or agents, and send chat requests that return streamed answers, tool activity, and references. The backend also supports document indexing and retrieval, workflow execution with approval pauses, persistent memory, MCP tools, and remote A2A agents. The graph combines sampled call sites with README-documented capabilities; several subsystem links are documented rather than verified from sampled implementation.
Main entry points: service Service orchestration · chatsvc.go Chat service · engine.go RAG engine · App.tsx React console
Components 28
Web console
- React console
frontend/src/App.tsx - Feature pages
frontend/src/pages - Typed API clients
frontend/src/api - SSE client
frontend/src/lib/sse.ts
API and services
- HTTP router
backend/internal/api/router.go - REST and SSE handlers
backend/internal/api - Service orchestration
backend/internal/service
Agent runtime
- Chat service
backend/internal/service/chatsvc.go - ReAct runtime
backend/internal/agent/runtime/runner.go - Host and experts
backend/internal/agent/host/host.go - Tool execution
backend/internal/tool/executor_impl.go - LLM gateway
backend/internal/llm/gateway.go - Long-term memory
backend/internal/memory/long_term/long_term.go
Knowledge and workflows
- Knowledge service
backend/internal/service/kbsvc.go - RAG engine
backend/internal/rag/engine/engine.go - Chunk and vector stores
backend/internal/vector/store.go - ETL worker
backend/internal/worker/worker.go - Workflow engine
backend/internal/workflow/engine.go
Platform services
- Authentication
backend/internal/service/auth.go - Redis Streams
- MCP client
backend/internal/mcp/client.go - A2A endpoint
backend/internal/a2a/server.go - Tracing and metrics
backend/internal/observability - Data repositories
backend/internal/repo
Other components
- Platform user
- Model provider
- MCP tool ecosystem
- Remote agent
Connections 30
- Platform user → React console: uses
README.md - React console → Feature pages: routes to
README.md - React console → Typed API clients: requests
README.md - Feature pages → SSE client: streams chat
- Typed API clients → HTTP router: calls API
README.md - HTTP router → REST and SSE handlers: routes requests
README.md - REST and SSE handlers → Service orchestration: delegates
backend/internal/api/handler_auth.go - Service orchestration → Data repositories: accesses data
README.md - Service orchestration → Authentication: authenticates
- Service orchestration → Chat service: orchestrates chat
- Chat service → ReAct runtime: runs agent
- ReAct runtime → LLM gateway: requests completion
README.md - ReAct runtime → Tool execution: invokes tools
README.md - Chat service → Host and experts: uses collaboration
README.md - LLM gateway → Model provider: calls model
README.md - Service orchestration → Knowledge service: orchestrates knowledge
- Knowledge service → RAG engine: indexes and retrieves
README.md - RAG engine → Chunk and vector stores: reads and writes vectors
backend/internal/rag/engine/engine.go - ETL worker → RAG engine: indexes documents
backend/internal/worker/worker.go - ETL worker → Redis Streams: consumes tasks
backend/internal/worker/worker.go - Knowledge service → Redis Streams: publishes ETL task
- Service orchestration → Workflow engine: runs workflows
README.md - Workflow engine → Tool execution: invokes tool nodes
backend/internal/workflow/engine.go - Workflow engine → RAG engine: retrieves KB context
backend/internal/workflow/engine.go - Chat service → Long-term memory: persists memories
README.md - Service orchestration → MCP client: manages integration
README.md - MCP client → MCP tool ecosystem: connects
README.md - Remote agent → A2A endpoint: sends A2A request
README.md - A2A endpoint → Service orchestration: delegates locally
- HTTP router → Tracing and metrics: exposes monitoring