Architecture
Built so partners can trust you with their clients
A simple stack you can run and audit yourself: Python, PostgreSQL and plain JavaScript in Docker. Security rules also live in the database itself.
The problem
What partners worry about
- "Will a competitor see my client?"
Partners often compete for the same clients.
- "Where does the AI send my data?"
Many AI tools send everything to an outside provider.
- "What if there is a bug?"
A single wrong query can expose data in many systems.
The building blocks
- PostgreSQL with row-level security
Every query carries the user's role and id. The database itself returns only the rows that user may see. With no context, protected tables return nothing.
- One instance per company
Each company gets its own database, secrets and network. Each company's data sits in its own, separate instance.
- A local AI agent
The agent talks only to Ollama on the same machine. There is no cloud AI fallback. The AI proposes; only an authenticated click confirms.
- A read-only gateway
/mcp for Claude and /api/v1 for scripts. Off by default, read-only, the same role checks on every call, OAuth or API keys.
- Plugins next to the core
Plugins react to events or run daily, keep only ids and dates, and read data without writing to CRM tables.
- An append-only audit log
Every change is recorded with who, what and when. No role can edit it.
Stack
- Python 3.12 and Flask
- Gunicorn
- PostgreSQL 17
- Plain JavaScript
- Docker and Compose
- Ollama with an open model
- MCP server
- OpenAPI
Built in
- Two-factor sign-in (TOTP) for staff
- Sign-in attempt limits
- Session policy and security headers
- Encrypted backups with a restore drill
- Vulnerability scanning with pinned scanners
- Over 4,000 automated tests
Questions
Short answers before you start
Why PostgreSQL row-level security?
Because a bug in one query should not expose another partner's data. The database refuses it even if the code asks.
Can I use another AI model?
Yes. The model is set in the Modelfile; any model Ollama runs can be used.
Where do I read more?
ARCHITECTURE.md, SECURITY.md and the docs folder in the repository.
Ready to start? Run it yourself, or let us roll it out
- Use it for free
Download the code from GitHub and run it on your own server. The licence is free for any number of partners.
- Get help with the roll-out
We install PartnerType, import your data and fit the system to your sales process.