# Agentic Coding

## Examples

Both our customers and Marple internal people are building awesome mini-apps on top of Marple using agentic coding. These are perfect to fine-tune a specific workflow on top of Marple's powerful architecture and [performance](https://www.marpledata.com/resources/how-marple-db-achieves-top-of-market-ingestion-speed). Some examples:

* Flight test campaign status tracker
* [Speech2Marple](https://youtu.be/7HJ-pZ4v7wY) (decoding driver/pilot radio communication to text annotations)
* Race setup comparison between sessions
* Model parameter estimation of a solar car based on experimental data

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FgU6mBdaXECcK2nrGT4ke%2Fagentic-coding-demos(1).png?alt=media&#x26;token=937f430b-9f75-4afe-b09f-6a6ab91e4293" alt=""><figcaption><p>Four examples of agentic apps on top of Marple. Top row: 1) Flight test campaign status tracker, 2) Speech2Marple converting audio to text annotations. Bottom row: 3) Race setup comparison tool, 4) Solar car model parameter estimation</p></figcaption></figure>

{% hint style="info" %}
[Read the full blog post about Speech2Marple](https://www.marpledata.com/resources/automatic-extraction-of-radio-comms-to-marple-using-agentic-coding) for an in-depth example.
{% endhint %}

Below are some key learnings for agentic coding with Marple that you can apply yourself.

## Agentic framework

Agents are really good at writing easy code. But once you give it a challenging task, it might take a pretty naive approach, like allocating 80 GB of memory:

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FhTZggF32bHRqIXFfKRGY%2Fimage.png?alt=media&#x26;token=2ef981ec-83b6-431d-bc19-23f88f9d02ec" alt=""><figcaption></figcaption></figure>

That's why we propose a framework for agentic coding where you split your problem space in:

1. **Easy parts**: UI components, glue code, storing application state, ... Basically everything a decent full stack developer would be able to write.
2. **Hard problems**: Performance-critical or security-sensitive parts. The kind where you need to rely on well-built libraries to do the job for you.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FNG0wRDhhFClLYLf611bD%2Fimage.png?alt=media&#x26;token=471e6f2d-29c4-4019-a851-5ccfff110bb6" alt=""><figcaption></figcaption></figure>

The hard problems require powerful building blocks. Marple DB and Insight are perfect to do all the heavy lifting regarding large quantities of time series data. For speech decoding, you might use [`whisper`](https://github.com/openai/whisper). Running ML models can be done using [PyTorch](https://pytorch.org/), ... etc. We recommend writing down the key hard problems, and assigning a core building block as a solution to each:

<table><thead><tr><th width="521.7667236328125">Hard problem (examples)</th><th>Solution (building block)</th></tr></thead><tbody><tr><td>Scalable storage of kHz-frequency MDF files</td><td>Marple DB</td></tr><tr><td>Decoding speech audio to text</td><td>Whisper (Python library)</td></tr><tr><td>Performant dashboarding across 1000s of measurement datasets</td><td>Marple Insight</td></tr><tr><td>Store application state for multiple users</td><td>PostgreSQL</td></tr></tbody></table>

## Prompting recommendations

#### **Tip 1: Write a plan**

Always write a plan (e.g. in Markdown, or plain text) that outlines what mini-app you want to build. Isolate the hard parts (see [Agentic Framework](#agentic-framework) above) and clearly write how you think they should be solved.

After writing the plan, ask your agent to read it through (e.g. in [plan mode](https://cursor.com/docs/agent/plan-mode) for Cursor/Claude/Codex) to improve on unclear sections if needed.

{% hint style="info" %}
[Read a full example of a plan file here.](https://gitlab.com/NeroVanbiervliet/linux-config/-/blob/master/llm/plans/speech2marple.md?ref_type=heads)
{% endhint %}

#### **Tip 2: Marple guidance**

The agent works best if it knows how to use Marple SDKs and APIs. You can paste the prompt below straight into your plan.

```markdown
# Marple guidance
## Products and capabilities
Two products are available as core building blocks:
- Marple DB: High-performance Data Lakehouse for processing and standardising time series data coming from measurement files. Docs: https://docs.marpledata.com/docs/marple-db/welcome
- Marple Insight: Collaborative web interface for deep analysis, reporting and dashboarding on complex time series data. Docs: https://docs.marpledata.com/docs/marple-insight/welcome

## Programming language
- Python: preffered choice, works excellent with our Python SDK `marpledata` [Marple DB + Insight]
- MATLAB: SDK available [Marple DB only]
- Other: REST API available [Marple DB + Insight]

## Python SDK
- Installation: from Pypi as `marpledata`
- Docs: https://marpledata.gitlab.io/marple-sdk/
- Read through source code to understand types and available functions better
- Only make raw API calls using `DB.get` or `Insight.post` (etc...) if no built-in functions is available

## MATLAB SDK
- Installation: download`DB.m` from https://gitlab.com/marpledata/marple-sdk/-/tree/main/matlab?ref_type=heads
- Docs: https://docs.marpledata.com/docs/sdk/overview/matlab-sdk
- Read through DB.m source code to view all available functions
- Requires a `config.json` with API_token and other configuration

## REST API
- Prefer Python or MATLAB SDK built-in functions because they are typed
- If not possible, prefer to call `DB.get(...)`, `Insight.post(...)` etc (Python) or `DB.make_request(...)` (MATLAB) over raw HTTP calls
- Authenticate using `Authorization: Bearer <api-token>` for raw calls
- Swagger docs (Insight): https://db.marpledata.com/api/docs
- Swagger docs (DB): https://insight.marpledata.com/api/v1/spec/

## URLs
- Marple products exist in 3 deployment options: SaaS, VPC, Self-hosted
- By default, SDKs will assume SaaS URLs (e.g. https://db.marpledata.com/api/v1/)
- If API token returns 403, ask user if they are on a different deployment than SaaS
```

#### **Tip 3: Provide feedback loops**

Agents work best if they can debug their output directly by having a feedback loop. If you can, give the agent an API token to work with in its environment. Make the token of the account type [editor](https://docs.marpledata.com/docs/marple-insight/user-manuals/team-and-accounts/account-types#editor) by default.

Read more about creating API tokens here:

{% content-ref url="overview/api-tokens" %}
[api-tokens](https://docs.marpledata.com/docs/sdk/overview/api-tokens)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.marpledata.com/docs/sdk/agentic-coding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
