Agentic Company — Qwen Hackathon Submission


Inspiration

Companies are adopting AI agents as isolated tools — ChatGPT here, Copilot there. But nobody is asking the hard question: How do these agents fit into the organizational structure? Whose authority do they operate under? Who is accountable for their decisions?

We have Jira, Notion, and HRMS software for human employees. For AI agents, there's nothing.

The inspiration was simple: if an agent is going to work like an employee, it needs to be managed like one. It should have a title, a set of policies, a skill profile, and its own SLA. That's the gap we set out to fill.


What it does

Agentic Company is a fully self-hosted, open-source platform that lets organizations manage AI agents alongside human employees within a unified org structure.

  • Agent Management — Define a title, department, policy document, and skill set for each agent. Agents are linked to real personnel; one becomes an HR assistant, another a sales agent.
  • A2A Delegation — When an agent can't complete a task, it delegates to another agent. Autonomous workflows are built on top of this chain.
  • Flow Automation — Trigger-based flows where agents run sequentially; execution status is tracked in real time.
  • SLA Monitoring — Success rate, session count, token consumption, and flow performance for every agent, visible in a live dashboard.
  • Multi-Provider AI — Qwen, Anthropic, OpenAI, Google, Mistral, and local models (Ollama, LM Studio) all run on the same platform. Each agent can be assigned a different model.
  • Single-Command Deploy — curl -fsSL .../install.sh | bash delivers a production environment with Let's Encrypt SSL in under five minutes.

How we built it

Backend: FastAPI + SQLModel + SQLite. We started monolithic, then split into modular routers (api/agents.py, api/flows.py, api/providers.py, etc.). Agent sessions and token usage are tracked per conversation. Provider keys are stored with AES encryption.

Frontend: SvelteKit 5 with Svelte 5 runes ($state, $derived). Custom UI components built with Tailwind CSS following shadcn aesthetics. Full TR/EN i18n support.

Qwen Integration: Qwen's DashScope API is OpenAI-compatible, which made integration seamless. We wrote a detect_qwen_base_url() function that automatically probes both endpoints (dashscope-intl and dashscope CN) and selects the one that responds — the platform detects the user's region instantly with no configuration required. All Qwen models (Max, Plus, Turbo, Long) are fetched dynamically from the live model list.

Infrastructure: Docker Compose, Nginx reverse proxy, Let's Encrypt via Certbot, install.sh single-command installer, setup-env.sh interactive environment wizard.


Challenges we ran into

1. Agent identity and policy boundaries — Ensuring an agent never acts outside its own policy is a real technical constraint. We solve it by injecting policy.md and agent.md into every system prompt; the agent learns its own limits from these documents at the start of each session.

2. A2A delegation security — Agent A must be able to assign work to Agent B, but B must not be able to exceed A's authority. We solved this with a DelegationToken model: every delegation is recorded, traceable, and logged in the audit trail.

3. Qwen endpoint ambiguity — Users shouldn't have to know whether to use the international or China-mainland DashScope endpoint. We auto-detect and persist the correct base URL per key.

4. Provider key lifecycle — When a key is added, we run a live validation test and store it encrypted. On restart, .env is synced into the DB — but we needed to ensure that a key the user deliberately deleted doesn't silently reappear. We implemented a soft-delete pattern to handle this correctly.

5. Production quality from day one — We didn't want to ship a hackathon demo. SSL, structured logging, backup support, audit log, JWT auth — all built in, all working.


Accomplishments that we're proud of

  • Real A2A delegation — Two agents, each running a different Qwen model, successfully delegate and complete tasks between themselves.
  • Production-ready installer — A working, SSL-enabled, encrypted platform from a single curl | bash command.
  • Live SLA dashboard — Agent success rates, token spend, and flow performance give managers real data to make decisions.
  • Truly self-hosted under MIT — No data leaves the company's server. No license enforcement. No phone-home.
  • Qwen Long integration — Agents can ingest entire company policy documents in a single context window; a Policy Agent that reads and enforces all internal rules is now a realistic deployment.

What we learned

Qwen Long's 1M-token context window is a paradigm shift. Company documents, historical sessions, and policy files can all be loaded into context at once — dramatically improving agent consistency and reducing hallucination from missing context.

OpenAI-compatible API design really matters. Qwen's compatibility with the OpenAI format meant zero friction integration with our existing tooling. We wrote one abstraction layer and every provider, including Qwen, just worked.


What's next for Agentic Company

  • Qwen-first features — Deep document analysis mode powered by Qwen Long; a "Company Memory" agent that permanently digests and recalls long-form policy documents.
  • Visual Flow Builder — Drag-and-drop agent workflow design with per-step model selection; choose Qwen Turbo for high-frequency tasks and Qwen Max for complex reasoning nodes.
  • Push Notifications — WhatsApp/Telegram integration for agent task alerts (infrastructure already in place, UI in progress).
  • PostgreSQL support — A migration path from SQLite for organizations that outgrow single-server deployments.
  • Agent Marketplace — Ready-made templates — Legal Assistant, HR Agent, Finance Analyst — deployable in one click with pre-configured Qwen model recommendations.
Share this project:

Updates

Submission history