Querying Tako
Long and Short Queries
Tako can handle natural language queries like “How has Nvidia performed over the last 10 years?”, direct queries like “Nvidia stock price last 10 years”, or find related knowledge for long-form content like article or presentation.
You can also give Tako longer form text (eg an article or essay) and it will find data related to the text.
Try it in our playground
Pro Tips for Querying Tako
Using Tako’s Knowledge Search API in your app? Awesome! It’s great at understanding natural language right out of the box. But if you wanna fine-tune things for your specific app (bots, search, you name it), here are a few quick tips:
1. Be Smart About When You Tweak Queries:
- Baseline: Sending user queries straight to Tako often works great!
- Pro Move: For key query types your app handles (think data trends, comparisons, financial facts), consider tweaking the query before sending it. You can just send everything, but sometimes a little pre-processing boosts relevance, especially if your app has extra context (see Tip #2!).
2. Make Your Queries Crystal Clear (Programmatically!):
- The Goal: Help Tako nail the request by providing relevant context it wouldn’t otherwise have, especially if the user’s input is vague within the broader application context.
- How: Your code can inject context when your app has relevant information (from its domain, user session, prior interactions, etc.) that clarifies the user’s likely intent. Add these clarifying details to the
inputs.text
string you send Tako.- Example: User typed
"MSFT"
? If your app knows it’s a financial context, it might send"MSFT stock price last 6 months"
to Tako for better precision. If the user was just looking at Ford market share, asking about"comparison to GM"
could trigger sending"Compare Ford vs GM market share"
based on that session context.
- Example: User typed
3. Use ALL the Good Stuff in the Response:
- It’s JSON, Baby! Tako gives you structured knowledge_cards, not just text. Since Tako returns highly relevant results, you can often show them directly.
- Go Deeper: Your app/agent can inspect all the fields to get creative:
title
/description
: Great for display text, summaries, or even grounding your agent’s research (“Okay, Tako says the description is…”).webpage_url
: Link to the cool interactive chart page.image_url
: Static image of the visualization – perfect for embedding in a report.embed_url
: URL for an interactive iframe embed – drop it right into your content creation app. ✨sources
: Show users where the data’s from (builds trust!) or use it for citations in research output.
4. Rank Tako Results Smartly:
- Mix ‘n’ Match: When showing Tako results alongside stuff from your web index or other sources, think about ranking.
- Leverage Strengths: A relevant Tako card (especially the ones from vetted sources) often deserves a prime spot for data/fact queries compared to just plain web links. Use that structure (Point 3) to inform your ranking logic.
Basically: Send queries directly when simple, enhance them programmatically when you have useful external context, use the rich structured output (directly or creatively!), and rank results smartly. Happy coding!