How zte-aicloud/co-sight works
Project type and purpose
• This is a full-stack AI research platform (“Co-Sight”) that mimics Manus:
• Frontend: Angular/TypeScript SPA under cosight_ui/
• Backend: Python web server (cosight_server/) exposing REST & WebSocket APIs
• Core logic & domain: in app/ (agent dispatcher, planning, LLM orchestration, toolkits)
• Auxiliary CLI: CoSight.py, llm.py
• Packaging/deployment: Dockerfile, .env_template, build scripts under tools/
File structure
• Top-level: CLI entrypoints, Docker & env templates, Python package setup
• app/agent_dispatcher: layered DDD (application / domain / infrastructure) managing agent planning & execution
• app/cosight: core “agent” definitions, prompts, toolkits, LLM wrappers, task & record management
• config/: JSON & Python config for model endpoints & MCP server
• cosight_server/: two sub-apps
• deep_research: FastAPI routers, services, WebSocket manager
• manus_server: static UI hosting (index.html + web assets)
• sdk/: client SDK for external integration
• cosight_ui/: Angular project with modules, components, services, build tools
• tools/: spec files and Python build scripts
Insights from the README
• Describes one-click deployment, LLM configuration, search engine integration, MCP tool plugin
• Entry point: cosight_server/deep_research/main.py, HTTP port 7788, UI served at /cosight/
• Docker image workflow & environment variables
a. Main components
1. Frontend UI (cosight_ui): Angular app served as static assets
2. Web/API Server (cosight_server):
– RESTful routers (chat_manager, search, feedback, user_manager)
– WebSocket manager for real-time updates
– Manus server module for static UI hosting
3. Service Layer (inside cosight_server/deep_research/service.py): orchestrates requests
4. Agent Dispatcher (app/agent_dispatcher): application service, domain logic, infrastructure adapters
5. Core Cosight Logic (app/cosight):
– Agent definitions (actor, planner)
– Task & report management
– Toolkit library for tools (web search, file download, interpreters, etc.)
6. External Dependencies:
– LLM endpoints (OpenAI/Azure, local models)
– Search APIs (Google, Tavily)
– MCP micro-service (configurable external process)
7. Storage:
– In-memory or CSV persistence (app/cosight/record)
– Optional DB (if added) via infrastructure/entity models
8. Configuration & Deployment:
– Environment variables (.env)
– Config files (config/mcp_server_config.json)
– Docker container
b. Relationships & interactions
• UI ↔ HTTP API (REST calls for user actions, initial page load)
• UI ↔ WebSocket (real-time chat messages & updates)
• API Server → Service Layer → Agent Dispatcher → Domain & Toolkits
• Agent Dispatcher → External LLM APIs / Search APIs / MCP server
• Results flow back through layers → API → UI
• SDK module exposes client endpoints for third-party integration
c. Architectural patterns & design principles
• Layered + Domain-Driven Design (application / domain / infrastructure)
• Hexagonal/Ports-and-Adapters for tool integration (each toolkit or MCP is a “port”)
• Plugin/skill orchestration for extending agent capabilities (skill subpackages)
• SPA + backend API (separation of concerns)
d. Key technologies
• Frontend: Angular, TypeScript, WebSocket
• Backend: Python 3.11+, FastAPI (inferred from router structure), Uvicorn/Gunicorn
• LLM client wrappers (app/cosight/llm/chat_llm.py)
• Toolkits: custom modules under app/cosight/tool
• Docker, environment-based configuration, JSON config