# Repository Briefing: wangziqi06/724-office
> Source: https://repoforai.com/repo/wangziqi06/724-office (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/wangziqi06/724-office
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: JavaScript
- **License**: MIT
- **Engineering Health**: B (57/100 · Maintenance 12/35 · Adoption 19/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP, API
- **Momentum**: 1,020 ★ total (+0 24h / +1 7d) · 168 forks
- **When to Use**: Best for: An operator-led team that wants a persistent assistant in an existing messaging platform, with scheduled work, searchable memory, and a tool stack it can inspect and extend. Skip if: You need offline inference out of the box, verified isolation for untrusted tenants, or a managed service that handles uptime and provider configuration for you.

## Overview
```text
### Architecture & Core Mechanics
7/24 Office is a messaging-first application, not an agent framework. The original runtime enters through xiaowang.py, which handles HTTP callbacks, message debouncing, and media intake. In multi-tenant mode, router.py fronts the workers and manages per-user Docker containers. llm.py assembles token-budgeted context and drives an OpenAI-compatible function-calling loop; tools_base.py provides registration, filtering, and a circuit breaker for tools split across domain modules.

State lives in JSON session files and LanceDB-backed memory; scheduler.py handles persistent jobs, and nudge.py injects corrective hints when it detects tool misuse. The Python runtime avoids a large orchestration framework but still uses packages such as croniter, lancedb, and httpx. MCP is a separate extension path: mcp_client.py connects to external servers over JSON-RPC using stdio or HTTP, with hot reload.

### Key Capabilities & Differentiators
The Python edition exposes 36 built-in tools, with automatic retries and up to 20 tool-loop iterations per conversation. It combines persistent one-shot and recurring schedules, multi-engine search, messaging and media handling, and diagnostics. Group conversations use @-mention gating and a 20-message context buffer. Model configuration supports OpenAI-compatible endpoints with a fallback chain; embeddings, ASR, and video generation have separate configuration sections.

The memory pipeline retains the latest 40 messages in JSON, auto-archives sessions over 100 KB, and uses an LLM to extract facts from evicted messages. Facts are deduplicated at a cosine similarity threshold of 0.92 and stored in LanceDB. At recall time, the agent embeds the incoming message, retrieves relevant memories, and injects them within the prompt budget. Runtime Python tool creation, MCP reloads, and daily self-checks extend the service without requiring a full redeploy for every tool change.

### Trade-offs & Limitations
Compared with assembling an app on LangChain or CrewAI, the Python edition already connects messaging callbacks, schedules, memory, and tenant routing. Its plain Python call path is easy to inspect, but the operator owns provider configuration, uptime, and data retention. Separate containers give each tenant a process boundary at the cost of more provisioning and sizing work. API-backed inference removes the need to run a model in the agent process, but introduces provider latency, usage costs, and data-handling obligations.

Shell execution and runtime Python tool creation make trusted deployments flexible, but also increase the consequences of prompt injection or a compromised integration. Treat each worker as a privileged service until verified otherwise: restrict sensitive tools, keep tenant workers away from host Docker controls, and vet MCP servers. Do not treat per-user containers as proof of hardened isolation. MIT permits commercial use, but service-provider terms remain separate.

### Hardware & Deployment Guide
For a direct run, prepare config.json from config.example.json, install the Python dependencies, create workspace/memory and workspace/files, and start python3 xiaowang.py. The container path starts from Dockerfile.example and docker-compose.example.yml, adds the deployment credentials, and uses Docker Compose to build and run the service. The HTTP listener uses port 8080 for messaging callbacks. Before exposing it, verify callback authentication, restrict network access, and confirm that mutable workspace data and schedules survive container replacement.

Self-hosting the agent does not make its model, embedding, or media APIs offline. The Jetson Orin Nano target (8 GB RAM, ARM64) and sub-2 GB RAM budget are design goals, not capacity measurements; size for active containers, memory growth, and media work. No GitHub release is listed. The in-tree xiaowang-v2 rewrite uses a single Node process and WAL-mode SQLite, focusing on durable cross-day jobs and personal WeCom use; evaluate it separately rather than assuming a drop-in upgrade.
```

## Key Capabilities
```text
- Tool execution: OpenAI-compatible function calling with retries and a ceiling of 20 iterations per conversation.
- Memory lifecycle: The latest 40 messages stay in JSON session history; evicted content can become LanceDB-backed recall, with deduplication at 0.92 cosine similarity.
- Tool extension: Domain modules register Python functions with @tool; MCP servers use JSON-RPC over stdio or HTTP and support hot reload.
- Tenant routing: router.py provisions one Docker container per user and runs health checks and reconciliation; group chats use separate containers and @-mention gating.
- Persistent scheduling: Timezone-aware one-shot and recurring jobs survive restarts, with an inactivity guard.
- Node successor: xiaowang-v2 pairs a single Node process with WAL-mode SQLite, approval gates, and idempotency controls.
```

## Quick Start / Clone
```bash
git clone https://github.com/wangziqi06/724-office.git
cd 724-office
cp config.example.json config.json
# Edit config.json with your API keys

pip install croniter lancedb websocket-client pilk numpy httpx beautifulsoup4 pydub jieba fpdf2

mkdir -p workspace/memory workspace/files
python3 xiaowang.py
```
