IM-based office collaboration intelligent assistant integrating Feishu messaging, intent routing, document/whiteboard actions, and conversation memory.
English · 简体中文
Table of contents
- Receive Feishu IM messages through long connection
- Push incoming messages into BullMQ for async consumption
- Send queued acknowledgment, retry failed jobs, and avoid duplicate processing
Route user requests into planning, documentation, whiteboard/presentation, sync, delivery, identity, safety, clarification, and chitchat scenes.
| Intent | Description |
|---|---|
| SCENE_PLAN | Task understanding & planning |
| SCENE_DOC | Document/whiteboard editing |
| SCENE_PRESENT | Whiteboard/presentation |
| SCENE_SYNC | Cross-device synchronization |
| SCENE_DELIVERY | Summary & delivery |
| AGENT_IDENTITY | Identity queries |
| SAFE_REFUSAL | Safety responses |
| CLARIFY | Ambiguous intent clarification |
| CHITCHAT | Casual conversation |
User Input
│
▼
┌─────────────────┐
│ Redis Cache │ ← Recent conversations
└────────┬────────┘
▼
┌─────────────────┐
│ PostgreSQL │ ← Conversation history & fact snippets
└────────┬────────┘
▼
┌─────────────────┐
│ Ollama Embedding│ ← Generate embeddings for extracted facts
└─────────────────┘
- ConversationHistory: Conversation records (userId, role, content, metadata)
- FactSnippet: Extracted facts (userId, content, category, embedding)
- UserSession: User session state (sessionData, lastActive)
- Long connection messaging via Feishu SDK
- Document creation and append
- Whiteboard creation and markdown-to-node writing
- Presentation creation
- AI timeout and retry handling
- Queue retry and worker concurrency control
- OpenTelemetry tracing support
- Node.js >= 20
- pnpm >= 8
- Docker (optional, for dependency services)
All services run in Docker containers without local environment setup.
- Configure environment variables
cp .env.example .env
# Edit .env with Feishu, ARK credentials- Build and start services
docker-compose build
docker-compose up -d- Run database migrations
docker exec -it zeno-app npx prisma migrate dev --name init- Download Ollama embedding model
docker exec -it zeno-ollama ollama run nomic-embed-textdocker-compose build
docker-compose up- Install dependencies
pnpm install- Start dependency services
docker-compose up -d redis postgres ollama- Configure environment variables
cp .env.example .env- Run migrations
npx prisma migrate dev --name init- Start dev server
pnpm run start:dev| Service | Port | Description |
|---|---|---|
| Main App | 3000 | API service |
| Redis | 6379 | Cache & immediate context |
| PostgreSQL | 5432 | Relational & vector storage |
| Ollama | 11434 | Vector embedding service |
src/
├── modules/
│ ├── lark/ # Feishu IM and workspace actions
│ ├── agent/ # Intent routing and agent loop
│ ├── memory/ # Recent context and fact persistence
│ ├── queue/ # Async message queue and worker
│ ├── ai/ # Model invocation wrapper
│ └── common/ # Shared utilities
└── main.ts # Application entry
| Variable | Description | Required |
|---|---|---|
| LARK_APP_ID | Feishu application ID | Yes |
| LARK_APP_SECRET | Feishu application secret | Yes |
| LARK_WEBHOOK_URL | Feishu webhook URL | Yes |
| ARK_API_KEY | ByteDance ARK API key | Yes |
| ARK_BASE_URL | ARK API endpoint | Yes |
| DATABASE_URL | PostgreSQL connection string | Yes |
| REDIS_HOST | Redis host | Yes |
| REDIS_PORT | Redis port | Yes |
| OLLAMA_BASE_URL | Ollama service address | Yes |
| Category | Technologies |
|---|---|
| Framework | NestJS |
| Language | TypeScript |
| Storage | PostgreSQL, Redis |
| ORM | Prisma |
| AI | ByteDance ARK, Ollama Embeddings |
| Queue | BullMQ |
| Observability | OpenTelemetry, Jaeger |
| Deployment | Docker / Docker Compose |
Contributions, issues, and feature requests are welcome!
ISC