What Are Threads?
Threads let you have multi-turn conversations with Tako, similar to how you’d chat with an AI assistant. Instead of one-off queries, you can ask follow-up questions, refine your requests, and build context over multiple messages. The thread interface is similar to OpenAI’s Assistants API: you create a thread with one call, then attach messages to it separately. This gives you full control over the conversation flow.How Threads Work
1. Create a Thread: Start a new conversation thread. You can optionally include the first message when creating the thread, or add messages separately. You can also initialize threads with context like an in-focus card (for follow-up questions) or file sources (for data analysis). 2. Add Messages: Send user messages to the thread. Tako processes each message and responds with assistant messages that can include text, visualizations, data queries, and more. 3. Retrieve Messages: Get the full conversation history, including all user messages and Tako’s responses with rich content blocks.Create Thread With First Message
Create Thread With First Message
Add Message to Existing Thread
Add Message to Existing Thread
Create Empty Thread, Then Add Messages
Create Empty Thread, Then Add Messages
Sometimes you want to create a thread first, then add messages separately:
Create Thread With In-Focus Card
Create Thread With In-Focus Card
When you want to ask follow-up questions about a specific visualization or card, initialize the thread with Tako will understand the context of the in-focus card and respond with relevant analysis:
in_focus_card_id. This tells Tako the conversation is about that particular card:Create Thread With File Sources
Create Thread With File Sources
When you have data files that are relevant to the conversation—either for analyzing alongside an in-focus card or for creating new visualizations—include them as file sources:Alternative: Inline CSV DataIf you want to pass CSV data directly instead of using file URLs, use the When to Include File Sources or CSV:
csv field. This serves the same function as file sources but lets you include the data inline:- When you want Tako to analyze data from your files to create new visualizations
- When you have an in-focus card and want to provide additional data context for follow-up questions
- When the user is asking about data that lives in CSV files or other data sources
Understanding Assistant Responses
Tako’s assistant messages can include multiple types of content blocks:- Text: Natural language explanations and context
- Visualizations: Interactive Tako cards with data visualizations
- Queries: The underlying data queries Tako used
- Follow-ups: Suggested follow-up questions
- Thinking Steps: Tako’s reasoning process (when available)
Pro Tips for Using Threads
1. Threads Maintain Context:- The Power: Unlike single queries, threads remember the conversation. Ask a follow-up and Tako knows what “that” or “it” refers to.
- Use Case: Perfect for exploratory analysis, iterative refinement, or when users naturally ask follow-up questions in your app.
- With First Message: Create thread + send first message in one call. Great for getting started quickly.
- Empty Then Messages: Create an empty thread, then add messages separately. Useful when you want the thread_id before adding content, or when managing conversation state in your app.
- Both Work! The interface is flexible – use whichever fits your app’s flow.
- GET /v1/threads//messages returns the complete conversation, including all content blocks.
- Why It Matters: You can display the full conversation in your UI, resume conversations later, or analyze what visualizations were generated.
- Rich Content: Assistant messages can include multiple visualizations, not just text.
- Display Options: Each visualization includes:
embed_url: Drop into an iframe for interactive chartsimage_url: Static image for reports or thumbnailswebpage_url: Link to the full Tako card pagedescription: Natural language summary of the data for groundingsources&methodologies: Build trust by showing data provenance
- List Threads: Use GET /v1/threads to see all threads for your account
- Get Specific Thread: Use GET /v1/threads/ to retrieve thread metadata
- Plan for Scale: Consider how you’ll manage threads in your app – map them to user sessions, projects, or conversations
- No Special Syntax: Just send natural language messages like “compare that to last year” or “show me the breakdown by region”
- Context-Aware: Tako understands references to previous messages, data points, and visualizations
- Conversational: Users can chat naturally without learning a query language
- In-Focus Card: Use
in_focus_card_idwhen users want to ask follow-up questions about a specific visualization. This tells Tako “the conversation is about this card” from the start. - File Sources: Include
file_sourceswhen you have data files (CSV, JSON, etc.) that Tako should analyze to create new visualizations or provide context for an in-focus card. - Inline CSV: Use the
csvfield to pass CSV data directly in the request—it serves the same function as file sources but without needing a URL. - When to Use: Add context at thread creation when you know what data or card the conversation will focus on. This helps Tako provide more relevant, grounded responses.