🏢 Stack AI
Stack AI - nền tảng enterprise cho AI workflows và agents.
Giới thiệu Stack AI
What is Stack AI?
Text
1Enterprise AI platform:2- Visual workflow builder3- LLM orchestration4- Knowledge bases5- Team collaboration6- Enterprise securityKey Features
Text
1✅ Visual AI workflow builder2✅ Multiple LLM support3✅ Document processing4✅ RAG (Retrieval Augmented Generation)5✅ API endpoints6✅ Team collaboration7✅ Enterprise security8✅ Pre-built templatesUse Cases
Text
1- Document Q&A systems2- Customer support agents3- Data analysis workflows4- Content generation5- Code assistance6- Research automationGetting Started
Account Setup
Text
11. Go to stack-ai.com22. Sign up (free tier available)33. Create workspace44. Create first projectInterface Overview
Text
1┌────────────────────────────────────────────────────┐2│ [Project] [Deploy] [Share] [Settings] │3├──────────┬─────────────────────────────────────────┤4│ Nodes │ │5│ ──────── │ WORKFLOW CANVAS │6│ Input │ │7│ LLM │ ┌────┐ ┌────┐ ┌────┐ │8│ Output │ │In │───▶│LLM │───▶│Out │ │9│ Logic │ └────┘ └────┘ └────┘ │10│ Data │ │11│ Tools │ │12└──────────┴─────────────────────────────────────────┘Core Concepts
Nodes
Text
1Input Nodes:2- Text Input: User query3- File Input: Documents4- API Input: External data5 6Processing Nodes:7- LLM: Generate responses8- Vector DB: Search documents9- Code: Custom logic10- Condition: Branching11 12Output Nodes:13- Text Output: Responses14- API Output: Send data15- File Output: Generate filesConnections
Text
1Data flows through connections:2- Drag from output port3- Connect to input port4- Data transforms between nodesVariables
Text
1Pass data between nodes:2- {{input.text}}: User input3- {{llm.output}}: LLM response4- {{search.results}}: Search resultsBuilding Document Q&A
Step 1: Knowledge Base
Text
1Create knowledge base:21. Go to Knowledge section32. Click "New Knowledge Base"43. Name it (e.g., "Company Docs")54. Upload documents:6 - PDF7 - Word8 - Text9 - Web pages105. Process documentsStep 2: Create Workflow
Text
1Workflow structure:2Input → Search KB → LLM → Output3 41. Add Text Input node52. Add Knowledge Base Search node63. Add LLM node74. Add Text Output node85. Connect nodesStep 3: Configure Search
Text
1Knowledge Base Search node:2- Select knowledge base3- Query: {{input.text}}4- Top K: 5 (number of results)5- Threshold: 0.7 (relevance cutoff)Step 4: Configure LLM
Text
1LLM node:2Model: gpt-4o-mini (or preferred)3 4System prompt:5"You are a helpful assistant. 6Answer questions based on the provided context.7If the answer isn't in the context, say so.8 9Context:10{{search.results}}"11 12User prompt:13"{{input.text}}"Step 5: Test & Deploy
Text
1Test:21. Click "Test" button32. Enter sample question43. Check response quality54. Adjust parameters6 7Deploy:81. Click "Deploy"92. Get API endpoint103. Integrate into appAdvanced Workflows
Multi-Step Reasoning
Text
1Complex task breakdown:2 3Input → Analyze Intent4 ↓5 ┌────┴────┐6 ↓ ↓7 Question Action8 ↓ ↓9 Search Execute10 ↓ ↓11 LLM Confirm12 ↓ ↓13 └────┬────┘14 ↓15 OutputAgent with Tools
Text
1Give LLM access to tools:2 31. LLM decides what tool to use42. Tool executes53. Result back to LLM64. LLM generates final response7 8Tools:9- Search knowledge base10- Query database11- Call external API12- Calculate13- Generate contentConditional Logic
Text
1Condition node:2If {{llm.confidence}} > 0.83 → Direct response4Else5 → Ask clarifying question6 7If {{intent}} == "complaint"8 → Escalation flow9Else10 → Standard flowDocument Processing
Upload & Process
Text
1Document pipeline:21. Upload documents32. Extract text (OCR if needed)43. Chunk into sections54. Generate embeddings65. Store in vector DBDocument Types
Text
1Supported:2- PDF (text & scanned)3- Word documents4- PowerPoint5- Excel/CSV6- HTML7- Plain text8- Images (with OCR)Processing Options
Text
1Chunking:2- Size: 500-1000 tokens3- Overlap: 100-200 tokens4- By paragraph/section5 6Embedding:7- OpenAI embeddings8- Cohere9- Custom modelsAPI Integration
External APIs
Text
1HTTP Request node:2- URL: API endpoint3- Method: GET/POST4- Headers: Authentication5- Body: Request data6 7Parse response:8- JSON parsing9- Extract fields10- Error handlingWebhook Trigger
Text
1Start workflow from external event:21. Add Webhook Input node32. Get webhook URL43. Configure in external system54. Workflow triggers on webhookAPI Output
Text
1Expose workflow as API:21. Deploy workflow32. Get API endpoint43. Call from your app5 6Request:7POST /api/workflow/{id}8{9 "input": "User question here"10}11 12Response:13{14 "output": "Answer here"15}Team Collaboration
Workspaces
Text
1Organize:2- Create workspaces per team3- Invite members4- Set permissions5- Share workflowsPermissions
Text
1Roles:2- Owner: Full access3- Editor: Build & modify4- Viewer: Run only5- API: API access onlyEnterprise Features
Security
Text
1Enterprise security:2- SSO integration3- SOC 2 compliance4- Data encryption5- Private cloud option6- Audit logsCustom Models
Text
1Bring your own:2- Azure OpenAI3- AWS Bedrock4- Custom fine-tuned models5- On-premise deploymentBest Practices
Stack AI Best Practices
Text
11. Start simple2 - Basic workflow first3 - Add complexity gradually4 52. Test incrementally6 - Test each node7 - Verify data flow8 - Check edge cases9 103. Optimize prompts11 - Clear instructions12 - Relevant context13 - Output format14 154. Monitor usage16 - Track API costs17 - Review performance18 - Optimize as needed19 205. Version control21 - Save versions22 - Document changes23 - Rollback capabilityCommon Patterns
RAG Pattern
Text
1Standard RAG:21. User question32. Search knowledge base43. Retrieve relevant docs54. Include in prompt65. Generate answer76. Cite sourcesAgent Pattern
Text
1ReAct agent:21. Receive task32. Think: What do I need to do?43. Act: Use appropriate tool54. Observe: Review result65. Repeat until complete76. Return final answerChain Pattern
Text
1Sequential processing:21. Summarize document32. Extract key points43. Generate action items54. Format output65. Send notificationTroubleshooting
Common Issues
Text
1Search returns no results:2- Check document processing3- Lower threshold4- Review query format5 6LLM response poor quality:7- Improve prompt8- Add more context9- Check search results10 11Workflow slow:12- Reduce context size13- Use smaller model14- Optimize search15- Cache results16 17API errors:18- Check authentication19- Verify endpoints20- Review rate limitsBài Tập
Practice
Build Stack AI System:
- Create Stack AI account
- Upload company documents
- Build Q&A workflow
- Add conditional logic
- Deploy as API
- Test with various questions
- Optimize based on results
Tiếp theo: Bài 10 - Integrations
