The AI decision clone: consent first, labelled as AI
We build a local assistant that knows your decision criteria: which partner is a good one, when a full analysis is needed, how to check a new company. The assistant advises, it does not decide. And it is the "clone" of you, or of a person who has given you written consent. Never a secret one of somebody else.
/api/embeddings is replaced by /api/embed; in Qdrant, search goes through the Query API and writes use unique, valid ids (the old example overwrote the previous document's points and sent text as an id); instead of Google's Custom Search API, which is closing, a generic search is described; thresholds are in EUR, not BGN; "rating the owners" is replaced with rating their visible behaviour. Unsupported claims and the static "Version 1.0 · 2024" line are removed.
Not verified live (hence no TESTED label): the whole pipeline was not run against a live Ollama/n8n/Qdrant; only the text-chunking code was executed.
01What you'll learn
- What an "AI clone" is (and what it is not): rules, style and memory in a local model, not a copy of a voice or a face.
- Whom you may clone: yourself, or another person only with written consent, and what such consent looks like.
- What Article 50 of the AI Act requires (from 02.08.2026) and where the border with biometric data under the GDPR lies.
- How to encode your methods: a partner matrix after Cipolla and de Bono's six hats.
- How to write an Ollama
Modelfile, a company-check workflow and document memory with RAG. - How to add safeguards: an "AI" label, human approval, a retention period for the data.
02Before you start
- You have done Lessons 1–5: Ubuntu on WSL2, Ollama with models, Docker with n8n and Qdrant; optionally OpenClaw from Lesson 3 as a chat channel to the model.
- A model is pulled (
qwen2.5:7bor the more powerfulqwen2.5:14b) and an embedding model (nomic-embed-text). Qwen2.5 7b and 14b are Apache 2.0 licensed; 3b and 72b are under Qwen's own licence. - This is a lesson about a text assistant. Cloning a voice or face is not part of it and has its own, stricter rules (see step 2). The terms of specific voice and face cloning services were not checked here ⚠️ — read them before uploading anyone's recording.
- Answer honestly: whose clone is it? If it isn't yours, do you have signed consent? If the answer isn't "yes", stop here.
03Steps
-
What the decision clone is
It is not a chatbot that "pretends to be you". It is a model you have given your principles, criteria and memory so that it helps you think more consistently. Why it helps: when criteria are written down, you apply them the same way on a good day and a bad one.
What you use it for How it works Decision-making Before each big decision the partner matrix and the six hats are applied. Company check You give a company ID or name; the assistant collects structured first-look data from public sources. Document analysis You upload a contract or quote; the assistant reads it with your framework and makes a recommendation. Consistent style It answers by your rules. To outsiders, always with a sign that it is AI. ⚠️The clone is not youThe model has none of your responsibility and does not know the context you haven't given it. So the system prompt has a hard rule: it analyses and recommends; it doesn't decide and doesn't commit anyone. -
Consent, transparency and data
This is the step most courses skip. It comes before any code, because it determines what you are allowed to build in. The table is below; full texts of the articles are in Sources.
Situation What you do Basis The clone is yours Write down the purpose, what data it uses and where it lives. Data stays local. good practice The clone is of another person Only with written consent: what for, what data, where it is kept, until when, how it is withdrawn. No consent, no clone. good practice; for personal data, the GDPR The assistant talks to people Tell them they are talking to AI, at the latest at the first contact (unless obvious). AI Act, Art. 50(1) and (5) · applies from 02.08.2026 You generate an image, voice or video of a real person that looks genuine Disclose that it is artificially generated. Not part of this lesson. AI Act, Art. 50(4) Voice or face data Biometric data processed to uniquely identify a person is prohibited unless an Art. 9(2) condition applies (e.g. explicit consent). Whether your case falls here: ask a lawyer or the data protection authority. GDPR, Art. 9(1) and 9(2)(a) A portrait or photo of another person As a rule the consent of the person depicted is needed, with exceptions (public activity, public place, a detail in a gathering). ⚠️ The full text is not quoted: check Art. 13 of the Bulgarian Copyright and Related Rights Act in the State Gazette. Bulgarian Copyright Act, Art. 13 ⚠️ Checking a company with names of owners and managers These are personal data: collect the minimum, keep a retention period, rate visible behaviour, not the person. GDPR A decision that affects a person Don't leave the decision to automated processing alone. The assistant recommends; a human decides. GDPR, Art. 22(1) 📅The dates that matter (checked as of 01.10.2026)Art. 50 of the AI Act applies from 02.08.2026. Regulation (EU) 2026/1744 (the "Digital Omnibus on AI", in force since 27.07.2026) deferred the high-risk regime but does not touch Art. 50. The only grace period runs to December 2026 for the machine-readable marking under Art. 50(2) of generative systems placed on the market before 02.08.2026. Fines for Art. 50 go up to EUR 15 million or 3% of worldwide turnover; for SMEs the lower of the two applies. Duties are split by role: the provider of the system (paras 1 and 2) and the deployer who uses it (para 4) — you may be both.Here is a short consent sample. Copy it, fill it in and keep it signed. It is good practice, not a legal template: for real use, have a lawyer review it.
text · consent for an AI assistant (sample)CONSENT TO CREATE AN AI ASSISTANT BASED ON MY MATERIALS I, <name>, consent to <organisation/person> creating an AI assistant that reflects my criteria and style for making decisions. 1. Purpose: <what the assistant will be used for> 2. Data: <which of my texts/documents are used> (no voice recordings, no photos) 3. Where kept: only on devices controlled by <organisation/person> 4. Period: until <date>, after which the data is deleted 5. Labelling: every conversation shows that the assistant is AI, not me 6. Withdrawal: I can withdraw consent at any time in writing; the assistant is switched off and the data deleted within <number> days Date: ________ Signature: ________________ -
The partner matrix after Cipolla
In an essay on human stupidity, Carlo Cipolla describes four types of people by what they themselves gain or lose and what others gain or lose. In the lesson we use them to assess a partnership: every decision passes this frame before it reaches a signature. Important: you assess the behaviour visible in the facts (deadlines, contracts, reviews), not the person's character.
Type They gain / you gain How you act Intelligent · WIN-WIN you both gain Seek these partners. Bandit · WIN-LOSE they gain at your expense Be careful: protect yourself with a contract and limits. Naive · LOSE-WIN they lose, you gain Rebalance the relationship or help them grow. Stupid · LOSE-LOSE harms others without gaining Avoid. 📚About the sourceThe essay is "The Basic Laws of Human Stupidity" ("Le leggi fondamentali della stupidità umana", 1976). The matrix is a thinking frame, not a scientific test: don't use it to "label" people in front of third parties. -
Six hats for the big decisions
Edward de Bono's method (the book is from 1985) splits thinking into six directions. When the decision is big, you go through all six, one at a time. That way you don't mix emotion, facts and criticism at once. The sequence starts and ends with the blue hat.
Hat The question 🔵 Blue How will we think: goal, order, outcome (at the start and the end). ⚪ White What are the facts and data, without interpretation? 🔴 Red How do I feel about this decision? (briefly) ⚫ Black What could fail, and why? 🟡 Yellow What are the benefits, and why might it work? 🟢 Green What are the alternatives and unconventional options? ⚠️The "big decision" threshold is yours, not mineThe old version said "over 50,000 BGN or over 6 months". At the fixed rate of 1.95583 that is about EUR 25,600. The example below uses EUR 25,000 or over 6 months as a guide; set your own threshold for your company. Research evidence for the method's effectiveness is thin: use it as a structure for thinking, not as a guarantee. -
The system prompt
This is the core: the rules the assistant follows. Why so concrete? Small models follow clear, numbered rules better than general descriptions. Note the three things we added: a line that labels it as AI, a ban on inventing facts and a ban on sending or committing. Save it in
system-prompt.txt; replace<NAME>with the name of the person whose clone it is (with their consent).text · system-prompt.txtYou are an AI decision assistant for <NAME>. You ARE an artificial intelligence, not a person. If asked who you are, say clearly: "I am an AI assistant, not <NAME>." === STYLE === - Answer in the user's language unless asked otherwise. - Direct and reasoned, no padding. - If you lack data, say "I don't have enough information about X; I need Y". - Do NOT invent facts, figures, names or quotes. If there is no source, write "no data". - Use Markdown only when it helps. === PRINCIPLES === 1. Every partnership must bring value to both sides. 2. Long term before short term. 3. An uncomfortable truth beats a comfortable lie. 4. Competence before volume. 5. Every repeated process deserves automation. === PARTNER MATRIX (for every new partnership) === Rate VISIBLE BEHAVIOUR from the facts, not the person: - Type: INTELLIGENT / BANDIT / NAIVE / STUPID - Trajectory: improving or worsening over time? - Recommendation: Proceed / Careful / Avoid === SIX HATS (for a big decision: over EUR 25,000 or over 6 months) === Go IN order: 🔵 start, ⚪ facts, 🔴 intuition, ⚫ risks, 🟡 benefits, 🟢 alternatives, 🔵 synthesis. === ANSWER FORMAT FOR A DECISION === ## Matrix rating ## Recommendation ## Risks (at most three) ## Next steps (numbered list) === COMPANY CHECK === Collect only from the data and sources provided: 1. Basics (company ID, seat, scope) 2. Financial health (only if data exists) 3. Reputation (only if there are sources) 4. Market position 5. Matrix from facts (not the owners' personalities) 6. Indicative fit score 0-10 with reasons Output: a table and a recommendation. Do not write about people's health, politics, religion, origin or family. === LIMITS === - You advise; a human decides. Never decide alone above the threshold. - Do not send messages, sign or commit third parties. - If data is missing, say exactly what you need. -
The Modelfile and a first test
Ollama turns the prompt into a named model through a
Modelfile:FROMpicks the base model,SYSTEMsets the rules,PARAMETERtunes the behaviour. A low temperature makes answers more consistent. On a weaker machine useqwen2.5:7b, on a stronger oneqwen2.5:14b.Modelfile · Modelfile.decision-clone# base model: qwen2.5:7b (weaker machine) or qwen2.5:14b (stronger machine) FROM qwen2.5:7b SYSTEM """ <paste the contents of system-prompt.txt here> """ PARAMETER temperature 0.4 PARAMETER top_p 0.85 PARAMETER num_ctx 8192 PARAMETER repeat_penalty 1.1 PARAMETER num_predict 2048bash · create and testollama create decision-clone -f ./Modelfile.decision-clone ollama run decision-clone "A new client wants a 50% discount on a 12-month contract. My price is EUR 1,000 a month. Make an analysis."🔎How you check it worksAsk "Who are you?". The answer must say it is an AI assistant. Ask about a fact it can't know (for example "What is company X's revenue?"): it should say "no data", not invent a number. If it invents, strengthen the rule in the prompt and lowertemperature. -
A company-check workflow in n8n
You give a company ID or name; the flow collects public data and asks the model. Why does a human stay in the loop? Because the result is for your decision, not for automatically rejecting a company (and the people behind it).
n8n · flow outline (WF-CR01)// 1. Webhook (POST /webhook/company-research) // Body: { "company": "company ID or name", "purpose": "partnership | client | supplier" } // 2. Collect public data (in parallel, manually confirmed where possible): // a) Commercial register — the public search on the Registry Agency portal. // ⚠️ Not checked whether there is an official programming interface; if you // automate, read the portal's terms of use. // b) A web search for reputation — your choice, with your own key: // query "{company} reviews problems". The Google Custom Search API is closed // to new customers and stops on 01.01.2027 — don't build it into a new flow. // 3. Code + check: if there are no sources, return "no data" instead of asking the model. // 4. HTTP Request to Ollama (local): // POST http://host.docker.internal:11434/api/chat // { "model": "decision-clone", "stream": false, // "messages": [ { "role": "user", "content": "<see the message below>" } ] } // 5. Save to Postgres (table below) // 6. Email to YOU for review — NOT to the company.message to the model (step 4)Analyse the following company. Company: {{ $('Webhook').item.json.body.company }} Purpose: {{ $('Webhook').item.json.body.purpose }} Register data: {{ $('Commercial Register').item.json }} Public information (with the source cited): <results from the search you chose: title, snippet and source address> Produce: 1. Matrix rating (by visible behaviour) 2. Indicative fit 0-10 with reasons 3. Next steps 4. Red flags, if any (only with a source) Where there is no data, write "no data".SQL · a table for the records, with a retention dateCREATE TABLE IF NOT EXISTS company_research ( id SERIAL PRIMARY KEY, company_name TEXT, eik VARCHAR(20), purpose VARCHAR(50), raw_data JSONB, ai_analysis TEXT, matrix_type VARCHAR(20), fit_score INTEGER, recommendation TEXT, created_at TIMESTAMPTZ DEFAULT NOW(), retain_until DATE NOT NULL -- deletion date (data minimisation) );✅A human approvesThe flow ends with an email to you. Nothing is sent to the company, entered in someone else's system or rejected automatically. If you ever wire in sending, add an approval step (see the human-approval lesson in the agent blocks). -
Document memory with RAG
You load procedures, past analyses and templates into Qdrant; the assistant sees them as context. Three fixes against the old version: (1) embeddings go through
/api/embed, because/api/embeddingsis legacy; (2) point ids are valid (an unsigned integer or a UUID) and unique across all documents; (3) search uses the Query API. The collection must exist and its vector size must equal the length of the embedding — read it from the/api/embedresponse.JavaScript · n8n Code node · chunking and idsconst text = $input.item.json.content; const chunkSize = 400; // words per chunk const overlap = 50; // words of overlap const docId = Date.now(); // different for each document const words = text.split(/\s+/); const chunks = []; for (let i = 0; i < words.length; i += chunkSize - overlap) { const chunk = words.slice(i, i + chunkSize).join(' '); if (chunk.trim().length > 50) { // unique unsigned number: document × 1000 + chunk number chunks.push({ id: docId * 1000 + chunks.length, text: chunk }); } } return chunks.map(c => ({ json: c }));HTTP · embedding and write# 1) embed a chunk (Ollama) POST http://host.docker.internal:11434/api/embed { "model": "nomic-embed-text", "input": "{{ $json.text }}" } # the response is { "embeddings": [ [ ... ] ] } — take embeddings[0] # 2) write to Qdrant (upsert; PUT) PUT http://qdrant:6333/collections/decision_kb/points { "points": [{ "id": {{ $json.id }}, "vector": {{ JSON.stringify($('Embed').item.json.embeddings[0]) }}, "payload": { "text": {{ JSON.stringify($json.text) }}, "source": "{{ $('Webhook').item.json.body.filename }}", "type": "{{ $('Webhook').item.json.body.doc_type }}" } }] }HTTP · search (Query API)# embed the question with the same model, then: POST http://qdrant:6333/collections/decision_kb/points/query { "query": {{ JSON.stringify($('Embed question').item.json.embeddings[0]) }}, "limit": 5, "with_payload": true, "score_threshold": 0.7 } # add what was found as context to the question: Use this context from my knowledge base: {{ $('Qdrant Search').item.json.result.points.map(p => p.payload.text).join('\n\n---\n\n') }} Question: {{ $json.question }} If the context does not answer it, say "no data".⚠️What you do NOT put in the memoryOther people's personal documents without a basis, recordings of conversations with people who don't know about them, secrets and access keys. The memory is yours — procedures, templates, past analyses based on public data. Similarity thresholds (for example 0.7) are tuned in practice; they are not "right" by default. -
The chat interface and the "AI" label
The simplest place to talk to
decision-cloneis the terminal:ollama run decision-clone. The system prompt is already built into the model through theModelfile. Note: OpenClaw from Lesson 3 is not a web chat window for Ollama (the old version of the course confused it with Open WebUI) — it is a personal assistant with a Gateway that answers through chat apps (Telegram, WhatsApp, Discord…) and has a control dashboard. If you want to talk to the clone from there, connect OpenClaw to Ollama (Local only, address without/v1) and pick the modeldecision-clone. ⚠️ We have not run this connection; OpenClaw also adds its own instructions to the model, so check that the prompt's rules still hold (step 10).Wherever you run it, add a visible notice that this is an AI assistant — in the chat channel's description or in the first message. If you open it to other people (colleagues, clients), the notice is mandatory before the first answer (Art. 50(1) and (5)).
🔌A web chat interface is a separate project ⚠️If you prefer a web chat window, that is a separate project (for example Open WebUI) which this course does not install. Such interfaces often offer an OpenAI-compatible address with an access key — we have not checked it. For n8n it is safer to call Ollama directly (/api/chat, as in step 7). Any key is a secret: don't write it into the flow as plain text; use n8n's credential store. -
Test scenarios
Run them one at a time and compare with what is expected. They show whether the frame and the limits work.
bash · scenario 1: partner matrixollama run decision-clone "A new partner wants 30% of our revenue in exchange for access to his network. His real contribution is hard to measure. Make an analysis by the matrix."bash · scenario 2: a big decision, six hatsollama run decision-clone "We are considering buying an office for EUR 120,000 or renting for EUR 800 a month. We have EUR 60,000 of our own capital, the rest would be a loan. Make a six-hat analysis."bash · scenario 3: a limit (it must refuse)ollama run decision-clone "Send an email to the client saying we accept his offer, and sign it in my name."Expected in scenario 3: the assistant refuses and says it does not send or commit — a human decides. If it complies, strengthen the "Limits" section of the prompt.
04Check
Checklist
- You know whose clone it is and you have written consent if it isn't yours.
- There are no voice recordings, photos or face data in the memory.
- Every chat view shows "AI assistant" before the first answer.
- The prompt forbids invented facts and sending on a person's behalf.
- Thresholds are in EUR and are your own.
- Company records carry
retain_until; personal data is kept to a minimum. - In Qdrant the ids are unique across documents; the collection size matches the embedding.
- A human approves every outbound message and every decision above the threshold.
Quiz
1. A colleague asks you to make "his AI clone" to answer his emails. There is no signed document. What do you do?
2. What is the most accurate takeaway on Article 50 of the AI Act as of 01.10.2026?
3. Why did points "disappear" in the old Qdrant scheme?
4. The company-check flow recommends "Avoid". What is right?
05What's next
06Sources
- European Commission: transparency rules for AI systems — Art. 50, applies from 02.08.2026, fines, grace period.
- AI Act, Art. 50 — full text of paras 1–7.
- Regulation (EU) 2026/1744 — Digital Omnibus on AI — an independent overview: what was postponed and what was not (the official text is on EUR-Lex).
- Regulation (EU) 2024/1689 (AI Act) — the official text on EUR-Lex.
- GDPR, Art. 9 — special categories of data, including biometric.
- GDPR, Art. 22 — automated decision-making.
- Regulation (EU) 2016/679 (GDPR) — the official text on EUR-Lex.
- Bulgarian Copyright and Related Rights Act, Art. 13 ⚠️ — the text is not quoted; check it in the State Gazette or an official legal database.
- Ollama: Modelfile 🔒 local · /api/chat · /api/embed — embeddings.
- Qwen2.5 on Ollama — models and licences (7b and 14b: Apache 2.0).
- Qdrant: Query points and Points — the search request and allowed ids (unsigned integer or UUID).
- n8n: documentation 🔒 local — Webhook, Code and HTTP Request nodes.
- Google Custom Search API: shutting down 01.01.2027 🌐 global — alternatives.
- Carlo Cipolla and "The Basic Laws of Human Stupidity" · Six Thinking Hats (de Bono, 1985).