AI Concepts & Orchestration
A Treasury Professional's Guide to the AI Ecosystem.
From Domain Expert to AI-Fluent Professional. This course has two parts: the AI concepts you must know (LLMs, fine-tuning, RAG, embeddings, agents, function calling), and AI orchestration (how to connect, control, and direct AI systems to do real work).
- ✓ Explain what an LLM actually does, and why it's a tool, not an oracle
- ✓ Tell fine-tuning, RAG, and embeddings apart — and know which one you need
- ✓ Distinguish a chatbot from an AI agent, and know what function calling does
- ✓ Read an API call, and write prompts that get you the output you actually want
- ✓ Name the four agentic patterns and see how a full AI system's layers connect
treasuryease.com
AI Concepts You Must Know
The building blocks that power every AI application.
Six concepts, in order: LLMs · Fine-Tuning · RAG · Embeddings & Vector Databases · AI Agents · Function Calling
What is an LLM?
Large Language Model
A neural network trained on massive text data that predicts the next word in a sequence. It doesn't "think" — it calculates the most probable continuation based on patterns learned from billions of documents.
Examples: Claude (Anthropic), GPT-4 (OpenAI), Llama (Meta), Mistral, Gemini (Google)
Think of an LLM like an extremely well-read treasury analyst who has studied every financial textbook, regulation, and report ever published. They can draft, analyze, and respond — but they can make confident mistakes because they're pattern-matching, not reasoning from first principles.
Key Insight: LLMs are tools, not oracles. Always validate outputs against your domain expertise.
What is Fine-Tuning?
Specializing a General Model
General purpose LLM. Knows everything broadly, nothing deeply in your domain.
Domain-specific examples: treasury reports, FX analyses, cash flow patterns, SWIFT messages.
Understands treasury terminology, formats, and patterns. Better at your specific tasks.
Cost: $10K–$100K+ in compute for meaningful fine-tuning
Data needed: Thousands of high-quality, domain-specific examples
Better alternative: Use a general model with great prompts + RAG (next module)
What is RAG?
Retrieval-Augmented Generation
"What's our EUR/USD exposure this quarter?"
Searches your documents, databases, reports for relevant context.
Combines retrieved data with its general knowledge to produce an accurate answer.
Without RAG: the LLM guesses based on general training. It might hallucinate numbers, invent policies, or give outdated rates.
With RAG: the LLM answers using YOUR actual data — real bank balances, real FX positions, real policy documents. Grounded and verifiable.
Embeddings & Vector Databases
The Engine Behind RAG
An embedding converts text into a list of numbers (a vector) that captures its meaning.
"cash pooling structure"
→ [0.82, -0.14, 0.67, 0.31, ...]
"liquidity management setup"
→ [0.79, -0.11, 0.64, 0.28, ...]
Similar meaning = similar numbers!
A database optimized for storing and searching embeddings. You search by meaning, not by exact keyword match.
Search: "How do we manage EUR exposure?"
Finds: FX hedging policy doc, Q3 exposure report, EUR/USD forward contracts memo
Even though none contained exact words!
Popular vector DBs: Pinecone, Weaviate, Chroma, pgvector (PostgreSQL extension)
What is an AI Agent?
From Answering Questions to Taking Actions
You ask → It answers → Done
Single turn, no memory of state, no ability to take action in the real world. Like asking a colleague a question in the hallway.
You ask → It plans → It acts → It checks → It adjusts → Done
Multi-step reasoning. Can call tools, query databases, make decisions. Like a junior analyst who executes a full workflow autonomously.
You're already building this. TOSY in TreasuryOS is an AI agent: it receives a request, decides which Core to use (ReportCore, CalculatorCore, IntercompanyCore), executes the task, and delivers the result.
What is Function Calling?
Also Called: Tool Use
Function calling lets an LLM decide WHEN to use an external tool (API, database, calculator) and WHAT parameters to pass. The LLM doesn't execute the function itself — your code does. The LLM just structures the request.
"Show me all EUR payments due this week"
Call get_payments() with currency=EUR, due_date=this_week
Queries your database, returns payment list as structured data
Presents results in a readable summary with totals & actions
AI Orchestration
How to connect, control, and direct AI systems to do real work.
Five topics, in order: API Calls · Prompt Engineering · Agentic Patterns · How It All Connects · Your Learning Roadmap
API Calls — Talking to AI
How Your App Communicates with AI Models
An API (Application Programming Interface) is a structured way for software to talk to other software. When TreasuryOS sends a message to Claude, it's making an API call: sending a request with your prompt, and receiving a structured response back.
response = claude.messages.create( model = "claude-sonnet-4", messages = ["role": "user", "content": "Analyze our Q3 cash"], tools = [get_balances, get_fx] )
Model: Which AI brain to use
Messages: The conversation history + your current request
System prompt: Instructions that define how the AI behaves
Tools: Functions the AI can call (databases, calculators, APIs)
Temperature: Creativity dial (0 = precise, 1 = creative)
Prompt Engineering
The Art of Telling AI Exactly What You Want
"Analyze our cash position"
No context. No format. No time frame. No currencies. The AI will guess everything — and guess wrong.
"You are a treasury analyst. Analyze cash positions for EUR, USD, GBP as of today. Output a table with bank, currency, balance, and flag any account below €50K."
"You are a senior treasury analyst with 15 years experience"
"Return results as a JSON object with these fields: ..."
Show 2-3 examples of input/output pairs you want
"Think step by step before giving your final answer"
Agentic Patterns
Architectures for AI Systems That Take Action
AI reads the request and routes it to the right handler. No execution, just classification.
TOSY reads "forecast Q4 cash" → routes to ReportCore
Output of step 1 feeds into step 2. Linear pipeline. Each step transforms the data.
Parse MT940 → Categorize → Reconcile → Report
AI calls tools repeatedly until it has enough info. It decides what to call and when to stop.
Check balances → Check FX rates → Calculate exposure → Done
AI generates output, then critiques its own output and improves it. Self-correction loop.
Draft board report → Review for gaps → Revise → Final
How It All Connects
A Complete AI-Powered Treasury System
Treasurer asks a question or triggers a workflow in the app
System prompt + prompt engineering + agentic pattern (router/chain/loop) decides how to proceed
Claude/GPT processes the request, decides which tools to call via function calling
API calls execute: query database, call bank APIs, run calculations, fetch FX rates
RAG retrieves context from vector DB (policies, history). Embeddings power semantic search.
Your Learning Roadmap
What to Learn Next, In Order of Impact
This is your highest-leverage skill. Better prompts = better AI outputs instantly. No code needed.
This is how you make AI work with YOUR data. Critical for any product that handles private company info.
Router, Chain, Tool-Use Loop. These are the blueprints for building AI systems that do real work.
Browse models, test in Spaces, understand what's possible. Useful for privacy-first features.
You don't need to build AI. You need to direct it. That's the skill that makes you irreplaceable.
Key takeaways
LLMs are tools, not oracles — pattern-matching, not reasoning. Always validate outputs.
RAG beats fine-tuning for most treasury use cases: cheaper, faster, and grounds answers in your real data.
An AI agent isn't a chatbot — it plans, acts, checks, and adjusts, using function calling to reach real tools.
Prompt engineering is your highest-leverage skill right now, and it needs no code.
Four agentic patterns — Router, Chain, Tool-Use Loop, Reflection — cover almost every AI system you'll build or evaluate.
You don't need to build AI. You need to direct it. That's the skill that makes you irreplaceable.
AI Agents in Treasury & Finance
From concept to implementation — architecture, use cases, roadmap, risks.
Next step · CourseAI for Treasury: Build Your Own Tools
Put these concepts to work — no-code, prompt+API, or a custom app.
Built by a treasurer, for treasurers. · treasuryease.com