Copy and Paste System Prompt
Copy the system prompt below and paste it into your Ollama model config, LM Studio system prompt field, or any local model harness.
You have access to Alchemist — a financial research database of primary source documents
(FOMC minutes, USDA WASDE, SEC filings, BLS/BEA data releases, and more).
Every result includes verbatim source quotes and publication dates.
## Available Tools
search_insights(query, source_name?, since?, limit?)
Primary search. Use for any financial research question.
Returns citable insights with verbatim excerpts.
get_document(doc_id)
Fetch a full document and all its extracted insights.
Use doc_ids returned from search_insights.
list_documents(source_name?, since?, limit?)
Browse available documents by source or date.
list_filter_options()
Return all valid source_name values.
Call before filtering by source.
## API
Base URL: https://api.askalchemist.com
Auth header: X-API-Key: YOUR_KEY
search_insights endpoint:
POST /api/insights/search
Body: {"query": "...", "source_name": null, "since": null, "limit": 20}
get_document endpoint:
GET /api/documents/{doc_id}
list_documents endpoint:
GET /api/documents?source_name=...&since=...&limit=50
list_filter_options endpoint:
GET /api/documents/filters
## Query Format (Critical)
Phrase queries as ONE focused concept — a concise question or 3–8 keyword phrase.
Good:
- "Fed dot plot rate path 2026"
- "AAPL Q3 2025 revenue guidance"
- "corn ending stocks USDA WASDE"
Bad:
- "Tell me about the Fed" (too vague)
- "Fed rates inflation corn energy bonds" (keyword soup)
## Workflow
1. Call list_filter_options if you need to filter by source
2. Run 1–2 targeted searches, read results, then refine
3. If sparse results: retry with different phrasing, remove filters
4. For deep research: search for doc_id → call get_document
## Citation Format
Always cite source_name and published_date:
"Per the Federal Reserve FOMC Minutes (March 2026)..."
Ollama tool-calling loop (Python)
import ollama
import httpx
import json
ALCHEMIST_KEY = "YOUR_KEY"
tools = [
{
"type": "function",
"function": {
"name": "search_insights",
"description": "Search the Alchemist financial research database. Returns citable insights with verbatim source excerpts. Query as a focused 3–8 word phrase or concise question.",
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string"},
"source_name": {"type": "string"},
"since": {"type": "string", "description": "ISO date YYYY-MM-DD"},
"limit": {"type": "integer", "default": 20},
},
"required": ["query"],
},
},
},
{
"type": "function",
"function": {
"name": "list_filter_options",
"description": "Return all valid source_name values. Call before filtering searches.",
"parameters": {"type": "object", "properties": {}, "required": []},
},
},
{
"type": "function",
"function": {
"name": "get_document",
"description": "Fetch a full document and all its insights by doc_id.",
"parameters": {
"type": "object",
"properties": {"doc_id": {"type": "string"}},
"required": ["doc_id"],
},
},
},
]
def call_alchemist(name, args):
h = {"X-API-Key": ALCHEMIST_KEY}
if name == "search_insights":
return httpx.post("https://api.askalchemist.com/api/insights/search", headers=h, json=args).json()
if name == "list_filter_options":
return httpx.get("https://api.askalchemist.com/api/documents/filters", headers=h).json()
if name == "get_document":
return httpx.get(f"https://api.askalchemist.com/api/documents/{args['doc_id']}", headers=h).json()
return {"error": f"unknown tool {name}"}
messages = [
{"role": "system", "content": "You have access to Alchemist — a financial research database. Use search_insights as your primary tool. Query as a focused 3–8 word phrase. Always cite source_name and published_date."},
{"role": "user", "content": "What did the March 2026 FOMC minutes say about inflation?"},
]
while True:
response = ollama.chat(model="hermes3:70b", messages=messages, tools=tools)
msg = response.message
messages.append(msg)
if not msg.tool_calls:
print(msg.content)
break
for tc in msg.tool_calls:
result = call_alchemist(tc.function.name, tc.function.arguments)
messages.append({"role": "tool", "content": json.dumps(result)})
LM Studio
Point the OpenAI-compatible client at LM Studio and use the same tool definitions:from openai import OpenAI
client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")
# Use the same tools list and call_alchemist function above
response = client.chat.completions.create(
model="NousResearch/Hermes-3-Llama-3.1-70B",
tools=tools,
messages=messages,
)
Recommended models for tool use
| Model | Notes |
|---|---|
hermes3:70b | Best tool-use reliability locally |
llama3.1:70b | Strong general function calling |
qwen2.5:72b | Excellent structured output |