haiku.rag/tests/cassettes/test_rlm/TestClientRLMIntegration.test_rlm_aggregation.yaml

2693 lines
159 KiB
YAML

interactions:
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '108'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
encoding_format: base64
input:
- 'Sales report Q1: Revenue was $100,000.'
model: qwen3-embedding:4b
uri: http://localhost:11434/v1/embeddings
response:
headers:
content-type:
- application/json
transfer-encoding:
- chunked
parsed_body:
data:
- embedding: MEiTuB+tUrxEqQi9spEBPZZ3JLqnuS49puRkPcaWbz3YXoI8I6hwO96m87zf65u8U5ywO7sYH73xPZ48RFiRvHy6KzyWNE+7kZIFPMxAHbtl/i27XWBfPTkjJj2U8Yu9X/ZuvB/SprxBh6q8GsguvZeUaLz5cpq8YOcvvdXPAb3SQio9uryKvLTGZjpH1qE7VfOHPBw/b7sgJ5Y7GTxSO4i0OzyYDai8InEWPLi0xzv9qKu8Y80uvL9jDDx9em88f4kUvFigBL1iAsy6MtmiOx1XZ7365nq8s/SAPLU0LDwk2qc8ccmJujMPMb2mfWi7kHbtu4yDsrkhrMi82mHGO4IfHLzKFdm8GYn3uzf1Ab0oxJ47HhSZPEpzsjz0z2y6d3FOvKPr4bjQqpY7/glrvEaXhbwUE588NwHUu7OkADyIxLI8C/T9u5MhAjx2t4I7sAZEOxMzODzgA3G8/0aGu1pLE719QtK7QYPpOeXcED1yooA7zuyDPDQ0MTxfTQA8xlJ/vGUTX7xUiKg6IyKcO6S4mrvooIq6pTkYvTRGmLwq6vO8XBAFvM5QNTpKZp88NIazO4IjWjwoxnO8qpnQu+ZTZDw3VrQ6raASvEwcITzAwgW9o3m0PD0Is7srrFi8TR4yvCB/4TwTxyU7BsVsu2o4ADx34a08/vzsugQZkDz3ezy8rDbLPBaMW7xH+wm78PxnPAhmjDk94Hu9evtIvF9BbLwtv6c7IfVIvBdqlzykWXK76GMDPNMa+TvQ4jm8QFsavDWyRLwcm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TxGeb+6QsXgvGFYU7rhu6o7ZbR5vAJ1cDpkSrc79gMfOxdaxDpkAY26HFHkvF3l6bxFYos9rNAwPA9Q47z/faq8hWl1PFONxjzNu2G826fOPJCMDr23su48YN2LuwFQbbxUpWM8YXEdvDuQWzxm7QI7el8yvNrNx7sfalm8TbTOvOaUZrvKuP47muqVvOiQ4TxulGY8i+nlvFCdmLwJ+a08bueAPFnhKzxI3yc9gB0Fu5GRwLxPJhk8dwPpOuO6P7w9jJO8ejY8vFSqxbvVk3Q7bdpPvOE7AT1R0AE76zYZPOKeYbuC+DO83v2KvAFXpTyEcie9TYb5O18+1bzozTs8Y1T7PCXtpzucOzs8y7srPDafpjz3B5W8irIyPUTe27xDoFo58aXMO8RktbwPYim8Cj2GPPW07jwKYG+8ZNPTOwFk9LsQOLO8BYMVPAfFArxCG+q732vNu3g8QLsiW4+80/jXu76t1zwOwKa85diuu4pIsztgOHO84F1GvIjrXz0XeQm9l/rkvBG1gLw5TgK6UHTsPDPQezwkxy08IrXvOuMb6LrW7QC88toJvbpCoDw4+jo8Rm4aPP9TsLzCzcE8irEXPHS0zTygsVm8r98FPYyN8LqKDso8L3hhPLBvy7xC3bw8KPuHu1x6+Ly/ZDO8fdgOvaDH5boUMKU8pmahvKOqDruYbXM8vU+vuQCoiDzaCAY9gs2XO0O3T7zRVQO9g3IGve4tCz17V5y8EKBwPC1uCb1kfw28zL2bPCIulbqwAMc8wVC4vBwcoLxaMkc8nlLuOvX91byWqwg9A+mSvCj3/7wxILA5hungPC+1M7zksLW64tl3PKto6ztlb2I8e4kEvakJLzvOCzO8c6ldvKGFhLylkzS7uN6XO8OFMLw6Nkq8xw8lPUFZnLvFFVG8/fqyPC6U9jvKp9M8ne1LvPcsRbyIP1Q7dtUUvA==
index: 0
object: embedding
model: qwen3-embedding:4b
object: list
usage:
prompt_tokens: 17
total_tokens: 17
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '108'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
encoding_format: base64
input:
- 'Sales report Q2: Revenue was $150,000.'
model: qwen3-embedding:4b
uri: http://localhost:11434/v1/embeddings
response:
headers:
content-type:
- application/json
transfer-encoding:
- chunked
parsed_body:
data:
- embedding: R8wouHKQP7wdPLi8uwsdPZgR3blVmxI9YXFEPcq8hD0rXHM8VDgpunpxtbxgcly8izukO4Unx7w5r6w86D8ZvKllrLrcJN+5FkiIPAaYhbtDSmi79f1tPaaAxzwUWIy9iUYovDbN1bww0cW8ic/xvKxc27zYoUU8nZAivQ1E3Lyvpyc9rFuAvFhgJjsUgWq64+7jPF+pz7t+LgU8C+OPu9i4GzyPQbC8Cv26PKVHEjloZje8+22CPNJY1TvPIKw7t4imvCclB73kKu26N3lzuuQEXb24kF28EO20POnKgTwHb8069NkqO5l9F73BoFa8w38cvGkDRDzDyQm9WqhrO7xvCLwfI7y80W+qupg8xbz38CG7JZ5uPGbCkTycqqY8BM5LvDBE2ruYO/E8UXt2vD4YRLy/mrI8DjynOsi7UDxE0lA8Lcbru24NTjz+40o8xfogPA2NyLrBAiy8R3Jhu3B3B73oORy8uebFOxBQqDz18OI7Lzh9u7SAVDxRZL07Fd+jvPzsH7zwFaA6V/W5O5JPs7nN0HU7AOIfvRFNrLxk3eu8h8EcvIwW3rlQKJ086U5uO6MAXDypZZW8tu6xOoXQIT0Rz0Y85EaavO2OBDzEVZe8PveQPGNPdLpNR5S7EbYuvP4tET0iF+87nTWEO3lI+DvOeiU8mEaAu2IspbpJg6q8Poi9PIzkbrwO9qQ7Ui2tPIzhLjrHnka9+PhQvNUzRrxo5sE5BUaAvHArwTw9NrS6fhHpuqAoXjzLe/+7IUhXvG056zvQANg7mZCiO/s0XDwgVKA7DjFSPC+aNrzwPkW7q5LEPHxNSTsHR5I8lRDQuyLGHjwvmwK8ZQR3PE3wJbzQiFU8mBi1u4wpbj2oqQ66DCiWOwt7gLzsDL88Ha+JvPipEzwZ6g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K0w8oGrRvGT+UjwDU8g7QCZzO46tkDvpDkW87vWkvHwC0jumUag85CHivKqpsjzY94U7SkP9vBBuIL1cliQ8W0tYuxFUNzzimFQ9jgfZuqBY/bwkeQ66hXE5PAG0JLwo9H+8Bi47vPWl1TuWbhA7TST5vK4xBj389eC7eOEjPI68Y7tzaFC7St9/vN/v6zu1tVq9RNLyO+Wuv7xmRSw8Qv3KPDbtXDydL4g8FYTku45HSDzMzJu8FY0NPa1JFL3Xamw8hqf5O1FCOrwSp2+8b8yZO8G7azwV64u8iv0wPGiIwrxrJ4W8Zo12O4Km9bsnmFW8KrUovHrfF7yTU5C8dpo0PLgqCz2v3ES8zOHmO3pfbLs8fNG8M++CvDNiYj1zLwi913LfvBzhATvRoUA8KzXzPAhK/Dsubbw7+eFqO15FzrkB8lO8cfyLvDkIjzz1DYU8rrhWO1pdk7yG2Mo8g1NEPFht4zuSz5g7fAmbPNYfkLocl2w84PS1Oxf0PLx8oJM72/8LvAJ28LxnQpW8KcvjvLyKsDr8wXE8PXJnvGDyF7wDp5I89KrKu0ue2jsHxAo9Z/58O0NhsrwZGQK9HfkGvRXXETwNH1669mNjPHNvWLwZ6mG8nXyqOxNN/Llr/SA8YGe6vGAQkbzGofA8Hf0RO8gjAL14INg8eMt+vIhWAL3vyjk8cZkoPEPozroRJw27T+frPJGEVzzFKaM8I3OdvHEFqDs+zzG86j6JvAqHg7y7l7M75rmUPBkisrsADmu7J+4QPZBqV7y9DM288QrQPDYnizy9+oM8JTa1vENTGr3iW2C7mys/vA==
index: 0
object: embedding
model: qwen3-embedding:4b
object: list
usage:
prompt_tokens: 17
total_tokens: 17
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '108'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
encoding_format: base64
input:
- 'Sales report Q3: Revenue was $200,000.'
model: qwen3-embedding:4b
uri: http://localhost:11434/v1/embeddings
response:
headers:
content-type:
- application/json
transfer-encoding:
- chunked
parsed_body:
data:
- embedding: sBGhuIsXbbpQs7m8+7qwPA9BILov/Dk9TjBvPd8bRT3xymg87nOWu5m02LwdHue6XbeUO9okzbzuE6M8a5N4vO4NJLw/j3k7my1qPB0MPrt/1j27TEYsPT6x3jy0IIy9kGFtvDc5F70IP8q8VgvsvGZcs7wSmPa7Me0HvWTFD72YIx49n4sovC7p9rkXlpO55zQUPNjkqrt36ag79I5+vPkYTDwhgyO8He+DPLYrUTzjpQS85bC0O0klNDyncqe5Cvx9vD1Ly7ygyzK7XygPOyQCgb0UTJa85werPK1UHDx4UZe6DOh/upJjPL2Lneq77bLIu+yBiTolow29cz1iux08Cryfiam864sMu+k9oLxpoAY85FKUPMNG3jxsmZa6qPu4vPsJzzhfj/M8KR5hvGkZgLwfRKk87RSHOo9s5TtgMz48cGilutUpUjuIH787RzYWPBnemDuAa4O8DsMFuwJx1bwSWf27DEq8O0nS/DwQk048wME1O3rBfzxCKC88EdpmvJq6B7yDHRm72kI7O8hmR7yEgiu6BWwMvZRe17zsDe+8D1JivDJhBjrhc9Q8yHdAO8b1oTytTnu8+ZXuuwIxHz0OPT884HqLu30gGzyYI8W8QnesPGhEAjtl2BK8DvhUvKnVBD2C5R83b+9yu7n5JzwfYyc7HsqjutdvHDyOX6i7b7zUPP2lZrybpL66eUzhPMEL3rvQA2e9VlBiu5NHFbwFrhw7HhumvOIO8TwQYnM6QyQcPNVzQjxaYeG7zIplvPijy7pqcdg72SPsO0HDTzwhfsO64floPHqGJrySp1Q5nrqMPEzxnTl25yU8qXsSvA4vkDz74xO7oQeXPJndT7wQs2Y827uFvATfGj0v6is7kj07PLnMRrwZ6fM8EAhUvOY/ijtpUUI8syIYPOkSqbwtiBu8uKOpvL4kczx+o7i86h/ju/lyvLsBgbW8AfwNvOX45jpO4Hq75Az0Ozl8jzyT4KS7HvN6vB8/yLuWPZi7nbdcOjLsXLywz7U7H/FDPN4ktDz4fGq8/QAsvDOvjLuApUC8BA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sdG6NAzMO/iejryT00O8KG9ivJ4kXLoc9LQ78VHrvMTHzjxHQTC6bUYtPMyxwruRuVW7kz/lvBsqFDzHKB+9/mEyuwUNAL24eeY79nn+PG7h9jr0wo48yevDuUA8QzwzpZu8nQAePfcvybzvsSU7rtdDuyVXzrw/6j27D/dcu0fwrDxcjJ68HX2LPFCQv7uNfe66q/0pOy0H9zrdnoy8PcOOO6PSILx1QJ28L6Q6OwhNFz0teRe85mp9u8yGAjxACy+8TlXGvAGMQz0V4MG8+qXovAiQyLtTVOo7LmrOPGwDqjwYZvs7xg7nO1xdlLuObH28v66bvMXQSTslAxg8QL0lOhAPZ7yW9vE8KW6hPP9Nzzt0AuC7urnEPGYo6DtUA8g80Jw/PMCWFztFUFQ83KsFvGhz8Lw/w9y6173NvGPeGTvPrZk88XS/vAwOsjkMi7U7lxjKutsaszxbP/E86kPmugtjNbyWxk+9c2UIvagCdTyfj2y8KD0IPKGJrbzoMy+8h2uEPG+bDrqQV7U8u0STvMG+Br2Y8oE8oup0ukNbkLyC/7A8eDlBvEJQ/LwYWEo6xeGZPEtCn7vqf+G7GxUtPLxxHzy2R/M8cOnXvFehYTuK45a7kjkJvG5ixLwz3Yc5P8tQPOKwNbxVo7Y4jBcTPUxdpbwOQ728JtSSPGfHAzwUEyc8UYC7vM3iAb2jK5u6CsClvA==
index: 0
object: embedding
model: qwen3-embedding:4b
object: list
usage:
prompt_tokens: 17
total_tokens: 17
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '7790'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '777'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: tool_calls
index: 0
message:
content: ''
reasoning: Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report",
"Q2 Report"... Let's search "quarterly report revenue".
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in
results[:5]:\n print(r[''document_title''], r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
index: 0
type: function
created: 1770373346
id: chatcmpl-682
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 106
prompt_tokens: 1749
total_tokens: 1855
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '8709'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
- content: |-
<think>
Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report", "Q2 Report"... Let's search "quarterly report revenue".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
type: function
- content: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n","stdout":"3\nQ1 Report [] 0.03226645663380623\nQ2 Report [] 0.03226645663380623\nQ3
Report [] 0.032258063554763794\n","stderr":"","success":true}'
role: tool
tool_call_id: call_arzz3ioj
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '1307'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: tool_calls
index: 0
message:
content: ''
reasoning: We have 3 reports. Need to extract revenue. Let's fetch each document content and find revenue. Use regex
for "$...".
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor
rep in reports:\n content = get_document(rep)\n if content is None:\n # try by title\n for
doc in list_documents():\n if rep.lower() in doc[''title''].lower():\n content =
get_document(doc[''id''])\n break\n if content:\n # find patterns like \"Revenue:
$1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'', content)\n amounts = [int(m.replace('','',''''))
for m in matches]\n if amounts:\n revenues[rep] = sum(amounts)\n else:\n revenues[rep]
= None\n else:\n revenues[rep] = None\nprint(revenues)\n"}'
name: execute_code
id: call_vuqzymvs
index: 0
type: function
created: 1770373351
id: chatcmpl-118
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 245
prompt_tokens: 1975
total_tokens: 2220
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '10684'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
- content: |-
<think>
Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report", "Q2 Report"... Let's search "quarterly report revenue".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
type: function
- content: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n","stdout":"3\nQ1 Report [] 0.03226645663380623\nQ2 Report [] 0.03226645663380623\nQ3
Report [] 0.032258063554763794\n","stderr":"","success":true}'
role: tool
tool_call_id: call_arzz3ioj
- content: |-
<think>
We have 3 reports. Need to extract revenue. Let's fetch each document content and find revenue. Use regex for "$...".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep
in reports:\n content = get_document(rep)\n if content is None:\n # try by title\n for doc
in list_documents():\n if rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n"}'
name: execute_code
id: call_vuqzymvs
type: function
- content: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep in reports:\n content
= get_document(rep)\n if content is None:\n # try by title\n for doc in list_documents():\n if
rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n","stdout":"{''Q1
Report'': None, ''Q2 Report'': None, ''Q3 Report'': None}\n","stderr":"","success":true}'
role: tool
tool_call_id: call_vuqzymvs
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '626'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: tool_calls
index: 0
message:
content: |-
<think>
No content or revenue not matched. Let's try list documents to see actual names and perhaps extract via pages.
role: assistant
tool_calls:
- function:
arguments: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n"}'
name: execute_code
id: call_z0mgsixf
index: 0
type: function
created: 1770373353
id: chatcmpl-25
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 70
prompt_tokens: 2468
total_tokens: 2538
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '11261'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
- content: |-
<think>
Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report", "Q2 Report"... Let's search "quarterly report revenue".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
type: function
- content: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n","stdout":"3\nQ1 Report [] 0.03226645663380623\nQ2 Report [] 0.03226645663380623\nQ3
Report [] 0.032258063554763794\n","stderr":"","success":true}'
role: tool
tool_call_id: call_arzz3ioj
- content: |-
<think>
We have 3 reports. Need to extract revenue. Let's fetch each document content and find revenue. Use regex for "$...".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep
in reports:\n content = get_document(rep)\n if content is None:\n # try by title\n for doc
in list_documents():\n if rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n"}'
name: execute_code
id: call_vuqzymvs
type: function
- content: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep in reports:\n content
= get_document(rep)\n if content is None:\n # try by title\n for doc in list_documents():\n if
rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n","stdout":"{''Q1
Report'': None, ''Q2 Report'': None, ''Q3 Report'': None}\n","stderr":"","success":true}'
role: tool
tool_call_id: call_vuqzymvs
- content: |2-
No content or revenue not matched. Let's try list documents to see actual names and perhaps extract via pages.
role: assistant
tool_calls:
- function:
arguments: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n"}'
name: execute_code
id: call_z0mgsixf
type: function
- content: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n","stdout":"Q1 Report\nQ2
Report\nQ3 Report\n","stderr":"","success":true}'
role: tool
tool_call_id: call_z0mgsixf
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '859'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: tool_calls
index: 0
message:
content: ''
reasoning: Maybe revenue is in tables. Use docling.
role: assistant
tool_calls:
- function:
arguments: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings
= [t.text for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n#
find tables\nprint(f\"Tables: {len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table
{i} rows {table.data.num_rows} cols {table.data.num_cols}\")\n"}'
name: execute_code
id: call_acbn2mdz
index: 0
type: function
created: 1770373356
id: chatcmpl-268
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 145
prompt_tokens: 2595
total_tokens: 2740
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '12396'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
- content: |-
<think>
Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report", "Q2 Report"... Let's search "quarterly report revenue".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
type: function
- content: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n","stdout":"3\nQ1 Report [] 0.03226645663380623\nQ2 Report [] 0.03226645663380623\nQ3
Report [] 0.032258063554763794\n","stderr":"","success":true}'
role: tool
tool_call_id: call_arzz3ioj
- content: |-
<think>
We have 3 reports. Need to extract revenue. Let's fetch each document content and find revenue. Use regex for "$...".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep
in reports:\n content = get_document(rep)\n if content is None:\n # try by title\n for doc
in list_documents():\n if rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n"}'
name: execute_code
id: call_vuqzymvs
type: function
- content: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep in reports:\n content
= get_document(rep)\n if content is None:\n # try by title\n for doc in list_documents():\n if
rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n","stdout":"{''Q1
Report'': None, ''Q2 Report'': None, ''Q3 Report'': None}\n","stderr":"","success":true}'
role: tool
tool_call_id: call_vuqzymvs
- content: |2-
No content or revenue not matched. Let's try list documents to see actual names and perhaps extract via pages.
role: assistant
tool_calls:
- function:
arguments: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n"}'
name: execute_code
id: call_z0mgsixf
type: function
- content: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n","stdout":"Q1 Report\nQ2
Report\nQ3 Report\n","stderr":"","success":true}'
role: tool
tool_call_id: call_z0mgsixf
- content: |-
<think>
Maybe revenue is in tables. Use docling.
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings =
[t.text for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n#
find tables\nprint(f\"Tables: {len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table
{i} rows {table.data.num_rows} cols {table.data.num_cols}\")\n"}'
name: execute_code
id: call_acbn2mdz
type: function
- content: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings = [t.text
for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n# find tables\nprint(f\"Tables:
{len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table {i} rows {table.data.num_rows} cols
{table.data.num_cols}\")\n","stdout":"content\nheadings: []\nTables: 0\n","stderr":"","success":true}'
role: tool
tool_call_id: call_acbn2mdz
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '643'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: tool_calls
index: 0
message:
content: ''
reasoning: No tables. Probably revenue mentioned in paragraphs. Let's fetch entire content and search for "$".
role: assistant
tool_calls:
- function:
arguments: '{"code":"content = get_document(''Q1 Report'')\nprint(content[:500])\nprint(''...'')\nprint(content.count(''$''))\n"}'
name: execute_code
id: call_y1fiwuj8
index: 0
type: function
created: 1770373358
id: chatcmpl-409
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 72
prompt_tokens: 2895
total_tokens: 2967
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '13054'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
- content: |-
<think>
Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report", "Q2 Report"... Let's search "quarterly report revenue".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
type: function
- content: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n","stdout":"3\nQ1 Report [] 0.03226645663380623\nQ2 Report [] 0.03226645663380623\nQ3
Report [] 0.032258063554763794\n","stderr":"","success":true}'
role: tool
tool_call_id: call_arzz3ioj
- content: |-
<think>
We have 3 reports. Need to extract revenue. Let's fetch each document content and find revenue. Use regex for "$...".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep
in reports:\n content = get_document(rep)\n if content is None:\n # try by title\n for doc
in list_documents():\n if rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n"}'
name: execute_code
id: call_vuqzymvs
type: function
- content: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep in reports:\n content
= get_document(rep)\n if content is None:\n # try by title\n for doc in list_documents():\n if
rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n","stdout":"{''Q1
Report'': None, ''Q2 Report'': None, ''Q3 Report'': None}\n","stderr":"","success":true}'
role: tool
tool_call_id: call_vuqzymvs
- content: |2-
No content or revenue not matched. Let's try list documents to see actual names and perhaps extract via pages.
role: assistant
tool_calls:
- function:
arguments: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n"}'
name: execute_code
id: call_z0mgsixf
type: function
- content: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n","stdout":"Q1 Report\nQ2
Report\nQ3 Report\n","stderr":"","success":true}'
role: tool
tool_call_id: call_z0mgsixf
- content: |-
<think>
Maybe revenue is in tables. Use docling.
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings =
[t.text for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n#
find tables\nprint(f\"Tables: {len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table
{i} rows {table.data.num_rows} cols {table.data.num_cols}\")\n"}'
name: execute_code
id: call_acbn2mdz
type: function
- content: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings = [t.text
for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n# find tables\nprint(f\"Tables:
{len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table {i} rows {table.data.num_rows} cols
{table.data.num_cols}\")\n","stdout":"content\nheadings: []\nTables: 0\n","stderr":"","success":true}'
role: tool
tool_call_id: call_acbn2mdz
- content: |-
<think>
No tables. Probably revenue mentioned in paragraphs. Let's fetch entire content and search for "$".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"content = get_document(''Q1 Report'')\nprint(content[:500])\nprint(''...'')\nprint(content.count(''$''))\n"}'
name: execute_code
id: call_y1fiwuj8
type: function
- content: '{"code":"content = get_document(''Q1 Report'')\nprint(content[:500])\nprint(''...'')\nprint(content.count(''$''))\n","stdout":"Sales
report Q1: Revenue was $100,000.\n...\n1\n","stderr":"","success":true}'
role: tool
tool_call_id: call_y1fiwuj8
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '646'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: tool_calls
index: 0
message:
content: ''
reasoning: Now extract $ amounts.
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\ncontent = get_document(''Q1 Report'')\namounts = re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',
content)\nprint(amounts)\nprint([int(a.replace('','','''')) for a in amounts])\n"}'
name: execute_code
id: call_i5cijc97
index: 0
type: function
created: 1770373360
id: chatcmpl-728
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 90
prompt_tokens: 3045
total_tokens: 3135
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '13771'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
- content: |-
<think>
Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report", "Q2 Report"... Let's search "quarterly report revenue".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
type: function
- content: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n","stdout":"3\nQ1 Report [] 0.03226645663380623\nQ2 Report [] 0.03226645663380623\nQ3
Report [] 0.032258063554763794\n","stderr":"","success":true}'
role: tool
tool_call_id: call_arzz3ioj
- content: |-
<think>
We have 3 reports. Need to extract revenue. Let's fetch each document content and find revenue. Use regex for "$...".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep
in reports:\n content = get_document(rep)\n if content is None:\n # try by title\n for doc
in list_documents():\n if rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n"}'
name: execute_code
id: call_vuqzymvs
type: function
- content: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep in reports:\n content
= get_document(rep)\n if content is None:\n # try by title\n for doc in list_documents():\n if
rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n","stdout":"{''Q1
Report'': None, ''Q2 Report'': None, ''Q3 Report'': None}\n","stderr":"","success":true}'
role: tool
tool_call_id: call_vuqzymvs
- content: |2-
No content or revenue not matched. Let's try list documents to see actual names and perhaps extract via pages.
role: assistant
tool_calls:
- function:
arguments: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n"}'
name: execute_code
id: call_z0mgsixf
type: function
- content: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n","stdout":"Q1 Report\nQ2
Report\nQ3 Report\n","stderr":"","success":true}'
role: tool
tool_call_id: call_z0mgsixf
- content: |-
<think>
Maybe revenue is in tables. Use docling.
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings =
[t.text for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n#
find tables\nprint(f\"Tables: {len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table
{i} rows {table.data.num_rows} cols {table.data.num_cols}\")\n"}'
name: execute_code
id: call_acbn2mdz
type: function
- content: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings = [t.text
for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n# find tables\nprint(f\"Tables:
{len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table {i} rows {table.data.num_rows} cols
{table.data.num_cols}\")\n","stdout":"content\nheadings: []\nTables: 0\n","stderr":"","success":true}'
role: tool
tool_call_id: call_acbn2mdz
- content: |-
<think>
No tables. Probably revenue mentioned in paragraphs. Let's fetch entire content and search for "$".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"content = get_document(''Q1 Report'')\nprint(content[:500])\nprint(''...'')\nprint(content.count(''$''))\n"}'
name: execute_code
id: call_y1fiwuj8
type: function
- content: '{"code":"content = get_document(''Q1 Report'')\nprint(content[:500])\nprint(''...'')\nprint(content.count(''$''))\n","stdout":"Sales
report Q1: Revenue was $100,000.\n...\n1\n","stderr":"","success":true}'
role: tool
tool_call_id: call_y1fiwuj8
- content: |-
<think>
Now extract $ amounts.
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\ncontent = get_document(''Q1 Report'')\namounts = re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',
content)\nprint(amounts)\nprint([int(a.replace('','','''')) for a in amounts])\n"}'
name: execute_code
id: call_i5cijc97
type: function
- content: '{"code":"import re\ncontent = get_document(''Q1 Report'')\namounts = re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',
content)\nprint(amounts)\nprint([int(a.replace('','','''')) for a in amounts])\n","stdout":"[''100,000'']\n[100000]\n","stderr":"","success":true}'
role: tool
tool_call_id: call_i5cijc97
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '875'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: tool_calls
index: 0
message:
content: ''
reasoning: Do same for Q2 and Q3.
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'',''Q2 Report'',''Q3 Report'']\nvalues={}\nfor r in reports:\n c=get_document(r)\n if
c:\n amounts=re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',c)\n totals=sum(int(a.replace('','',''''))
for a in amounts)\n values[r]=totals\n else:\n values[r]=None\nprint(values)\nprint(''Total
revenue:'',sum(v for v in values.values() if v is not None))\n"}'
name: execute_code
id: call_4f61ktvo
index: 0
type: function
created: 1770373364
id: chatcmpl-865
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 158
prompt_tokens: 3239
total_tokens: 3397
status:
code: 200
message: OK
- request:
headers:
accept:
- application/json
accept-encoding:
- gzip, deflate, zstd
connection:
- keep-alive
content-length:
- '15009'
content-type:
- application/json
host:
- localhost:11434
method: POST
parsed_body:
messages:
- content: |-
You are a Recursive Language Model (RLM) agent that solves complex research questions by writing and executing Python code.
IMPORTANT: You MUST use the `execute_code` tool to run Python code. The functions described below are ONLY available inside the execute_code tool - you cannot access them any other way. Always execute code to answer questions; do not just describe what code would do.
CRITICAL: Inside execute_code, these functions are ALREADY available in the namespace. Do NOT import them - just use them directly:
- search("query") ✓ CORRECT
- from haiku.rag import search ✗ WRONG - will fail
You have access to a sandboxed Python environment with these haiku.rag functions (use them directly, no imports needed):
## Available Functions
### search(query, limit=10) -> list[dict]
Search the knowledge base using hybrid search (vector + full-text).
Returns list of dicts with keys: chunk_id, content, document_id, document_title, document_uri, score, page_numbers, headings
### list_documents(limit=10, offset=0) -> list[dict]
List available documents in the knowledge base.
Returns list of dicts with keys: id, title, uri, created_at
### get_document(id_or_title) -> str | None
Get the full text content of a document by ID, title, or URI.
Returns the document content as a string, or None if not found.
### get_docling_document(id_or_title) -> DoclingDocument | None
Get the structured DoclingDocument object for advanced analysis.
Returns a DoclingDocument object, or None if not found.
See "DoclingDocument API" section below for how to use it.
### llm(prompt) -> str
Call an LLM directly with the given prompt. Returns the response as a string.
Use this for classification, summarization, extraction, or any task where you
already have the content and just need LLM reasoning.
## Pre-loaded Documents Variable
If documents were pre-loaded for this session, a `documents` variable is available:
```python
# documents is a list of dicts with keys: id, title, uri, content
for doc in documents:
print(doc['title'], len(doc['content']))
```
Check if it exists with: `if 'documents' in dir(): ...`
## Standard Library Modules
You can import any Python standard library module.
## Strategy Guide
1. **Explore First**: Start by listing documents or searching to understand what's available. Document names may differ from filenames (e.g., "tbmed593.pdf" might be stored as "TB MED 593" or similar).
2. **If get_document returns None**: Use `list_documents()` to see actual document titles, or `search()` to find relevant content.
3. **Iterative Refinement**: Run code, examine results, adjust your approach based on what you find.
4. **Use print() Liberally**: The REPL captures stdout - print intermediate results to see what you're working with.
5. **Aggregate with Code**: For counting, averaging, or comparing across documents, write loops and use collections.
6. **Use llm() for Classification/Extraction**: When you need to classify, summarize, or extract structured data from content you already have, use llm().
7. **Cite Your Sources**: Track which documents/chunks informed your answer for citation.
## DoclingDocument API
When you call `get_docling_document(id_or_title)`, you get a DoclingDocument object for structured document analysis.
### Properties
- `doc.texts` - List of all text items (paragraphs, headings, etc.)
- `doc.tables` - List of all tables
- `doc.pictures` - List of all pictures/figures
- `doc.name` - Document name
### Methods
- `doc.iterate_items(with_groups=False)` - Iterate all items with hierarchy level
Returns tuples of (item, level) where level is nesting depth
- `doc.export_to_markdown()` - Export entire document as markdown string
### Text Item Properties
- `item.text` - The text content
- `item.label` - Type: title, paragraph, section_header, list_item, etc. (lowercase enum values)
- `item.prov` - Provenance (page numbers, bounding boxes)
### Table Access
- `table.data.num_rows`, `table.data.num_cols` - Dimensions
- `table.data.table_cells` - List of TableCell objects
- `cell.text`, `cell.start_row_offset_idx`, `cell.start_col_offset_idx`
### Example Usage
```python
doc = get_docling_document("My Document")
# Get all headings
headings = [t.text for t in doc.texts if "header" in str(t.label)]
# Iterate with structure
for item, level in doc.iterate_items():
print(" " * level + item.text[:50])
# Extract table data
for table in doc.tables:
for cell in table.data.table_cells:
print(f"Row {cell.start_row_offset_idx}, Col {cell.start_col_offset_idx}: {cell.text}")
```
## Example Patterns
### Counting documents matching a condition
```python
docs = list_documents(limit=100)
count = 0
for doc in docs:
content = get_document(doc['id'])
if content and 'keyword' in content.lower():
count += 1
print(f"Found in: {doc['title']}")
print(f"Total: {count}")
```
### Aggregating data across documents
```python
import re
numbers = []
results = search("financial data", limit=20)
for r in results:
matches = re.findall(r'\$([\d,]+)', r['content'])
for m in matches:
numbers.append(int(m.replace(',', '')))
print(f"Average: ${sum(numbers)/len(numbers):,.2f}")
```
### Using llm() for classification
```python
# Get document content
content = get_document("Q1 Report")
# Use llm() to classify sentiment
sentiment = llm(f"Classify the sentiment as positive, negative, or mixed: {content}")
print(sentiment)
```
## Workflow
1. **ALWAYS start by using execute_code** to explore the knowledge base
2. Run multiple code blocks as needed to gather information
3. After collecting data, provide your final answer
## Output Format
CRITICAL: Your final response MUST be valid JSON matching this exact schema:
```json
{"answer": "Your complete answer here as a string", "program": "Your final consolidated program here as a string"}
```
- `answer`: A clear answer to the user's question with key findings and references to specific documents/chunks.
- `program`: A single, self-contained Python program that produces the answer. Consolidate your exploratory code executions into one clean script.
Do NOT return arbitrary JSON structures. Always use the exact format: {"answer": "...", "program": "..."}
CRITICAL: You MUST call execute_code at least once before providing your answer. Never give up without trying to execute code first.
role: system
- content: What is the total revenue across all quarterly reports?
role: user
- content: |-
<think>
Need to find quarterly reports, extract revenue amounts, sum. Likely documents titled like "Q1 Report", "Q2 Report"... Let's search "quarterly report revenue".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n"}'
name: execute_code
id: call_arzz3ioj
type: function
- content: '{"code":"results = search(\"quarterly report revenue\", limit=20)\nprint(len(results))\nfor r in results[:5]:\n print(r[''document_title''],
r[''page_numbers''], r[''score''])\n","stdout":"3\nQ1 Report [] 0.03226645663380623\nQ2 Report [] 0.03226645663380623\nQ3
Report [] 0.032258063554763794\n","stderr":"","success":true}'
role: tool
tool_call_id: call_arzz3ioj
- content: |-
<think>
We have 3 reports. Need to extract revenue. Let's fetch each document content and find revenue. Use regex for "$...".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep
in reports:\n content = get_document(rep)\n if content is None:\n # try by title\n for doc
in list_documents():\n if rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n"}'
name: execute_code
id: call_vuqzymvs
type: function
- content: '{"code":"import re\nreports = [''Q1 Report'', ''Q2 Report'', ''Q3 Report'']\nrevenues = {}\nfor rep in reports:\n content
= get_document(rep)\n if content is None:\n # try by title\n for doc in list_documents():\n if
rep.lower() in doc[''title''].lower():\n content = get_document(doc[''id''])\n break\n if
content:\n # find patterns like \"Revenue: $1,234,567\"\n matches = re.findall(r''Revenue[:\\s]*\\$([\\d,]+)'',
content)\n amounts = [int(m.replace('','','''')) for m in matches]\n if amounts:\n revenues[rep]
= sum(amounts)\n else:\n revenues[rep] = None\n else:\n revenues[rep] = None\nprint(revenues)\n","stdout":"{''Q1
Report'': None, ''Q2 Report'': None, ''Q3 Report'': None}\n","stderr":"","success":true}'
role: tool
tool_call_id: call_vuqzymvs
- content: |2-
No content or revenue not matched. Let's try list documents to see actual names and perhaps extract via pages.
role: assistant
tool_calls:
- function:
arguments: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n"}'
name: execute_code
id: call_z0mgsixf
type: function
- content: '{"code":"docs = list_documents(limit=50)\nfor d in docs:\n print(d[''title''])\n","stdout":"Q1 Report\nQ2
Report\nQ3 Report\n","stderr":"","success":true}'
role: tool
tool_call_id: call_z0mgsixf
- content: |-
<think>
Maybe revenue is in tables. Use docling.
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings =
[t.text for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n#
find tables\nprint(f\"Tables: {len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table
{i} rows {table.data.num_rows} cols {table.data.num_cols}\")\n"}'
name: execute_code
id: call_acbn2mdz
type: function
- content: '{"code":"doc = get_docling_document(''Q1 Report'')\nprint(doc.name)\n# print headings\nheadings = [t.text
for t in doc.texts if ''header'' in str(t.label)]\nprint(''headings:'', headlines:=headings[:5])\n# find tables\nprint(f\"Tables:
{len(doc.tables)}\")\nfor i,table in enumerate(doc.tables):\n print(f\"Table {i} rows {table.data.num_rows} cols
{table.data.num_cols}\")\n","stdout":"content\nheadings: []\nTables: 0\n","stderr":"","success":true}'
role: tool
tool_call_id: call_acbn2mdz
- content: |-
<think>
No tables. Probably revenue mentioned in paragraphs. Let's fetch entire content and search for "$".
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"content = get_document(''Q1 Report'')\nprint(content[:500])\nprint(''...'')\nprint(content.count(''$''))\n"}'
name: execute_code
id: call_y1fiwuj8
type: function
- content: '{"code":"content = get_document(''Q1 Report'')\nprint(content[:500])\nprint(''...'')\nprint(content.count(''$''))\n","stdout":"Sales
report Q1: Revenue was $100,000.\n...\n1\n","stderr":"","success":true}'
role: tool
tool_call_id: call_y1fiwuj8
- content: |-
<think>
Now extract $ amounts.
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\ncontent = get_document(''Q1 Report'')\namounts = re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',
content)\nprint(amounts)\nprint([int(a.replace('','','''')) for a in amounts])\n"}'
name: execute_code
id: call_i5cijc97
type: function
- content: '{"code":"import re\ncontent = get_document(''Q1 Report'')\namounts = re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',
content)\nprint(amounts)\nprint([int(a.replace('','','''')) for a in amounts])\n","stdout":"[''100,000'']\n[100000]\n","stderr":"","success":true}'
role: tool
tool_call_id: call_i5cijc97
- content: |-
<think>
Do same for Q2 and Q3.
</think>
role: assistant
tool_calls:
- function:
arguments: '{"code":"import re\nreports = [''Q1 Report'',''Q2 Report'',''Q3 Report'']\nvalues={}\nfor r in reports:\n c=get_document(r)\n if
c:\n amounts=re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',c)\n totals=sum(int(a.replace('','',''''))
for a in amounts)\n values[r]=totals\n else:\n values[r]=None\nprint(values)\nprint(''Total
revenue:'',sum(v for v in values.values() if v is not None))\n"}'
name: execute_code
id: call_4f61ktvo
type: function
- content: '{"code":"import re\nreports = [''Q1 Report'',''Q2 Report'',''Q3 Report'']\nvalues={}\nfor r in reports:\n c=get_document(r)\n if
c:\n amounts=re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',c)\n totals=sum(int(a.replace('','',''''))
for a in amounts)\n values[r]=totals\n else:\n values[r]=None\nprint(values)\nprint(''Total revenue:'',sum(v
for v in values.values() if v is not None))\n","stdout":"{''Q1 Report'': 100000, ''Q2 Report'': 150000, ''Q3 Report'':
200000}\nTotal revenue: 450000\n","stderr":"","success":true}'
role: tool
tool_call_id: call_4f61ktvo
model: gpt-oss
reasoning_effort: low
stream: false
tool_choice: auto
tools:
- function:
description: |-
<summary>Execute Python code in a Docker-sandboxed environment.
The code has access to haiku.rag functions (search, list_documents,
get_document, get_docling_document, llm) and any Python standard
library module.
Use print() to output results.</summary>
<returns>
<description>Structured result with success status, stdout, and stderr.</description>
</returns>
name: execute_code
parameters:
additionalProperties: false
properties:
code:
description: Python code to execute.
type: string
required:
- code
type: object
strict: true
type: function
- function:
description: Result from RLM agent execution.
name: final_result
parameters:
additionalProperties: false
properties:
answer:
description: The answer to the user's question
type: string
program:
description: The final consolidated program
type: string
required:
- answer
- program
type: object
strict: true
type: function
uri: http://localhost:11434/v1/chat/completions
response:
headers:
content-length:
- '1016'
content-type:
- application/json
parsed_body:
choices:
- finish_reason: stop
index: 0
message:
content: '{"answer":"The combined revenue reported across the three quarterly reports equals $450,000. Individual
figures are:\n• Q1 Report: $100,000\n• Q2 Report: $150,000\n• Q3 Report: $200,000\n\nSources are the full text
of each report where the amounts are stated in the revenue sentences.","program":"import re\nreports = [''Q1 Report'',''Q2
Report'',''Q3 Report'']\nvalues={}\nfor r in reports:\n c=get_document(r)\n if c:\n amounts=re.findall(r''\\$(\\d{1,3}(?:,\\d{3})*)'',c)\n totals=sum(int(a.replace('','',''''))
for a in amounts)\n values[r]=totals\n else:\n values[r]=None\nprint(values)\nprint(''Total revenue:'',sum(v
for v in values.values() if v is not None))"}'
role: assistant
created: 1770373369
id: chatcmpl-835
model: gpt-oss
object: chat.completion
system_fingerprint: fp_ollama
usage:
completion_tokens: 206
prompt_tokens: 3588
total_tokens: 3794
status:
code: 200
message: OK
version: 1