# Ask Graphlit - AI Code Assistant

**Your AI pair programmer for Graphlit** - trained on all documentation, samples, and API patterns.

Don't know the right operation name? Not sure about the parameters? Just ask in natural language and get working code.

[**🚀 Open Ask Graphlit in the Developer Portal →**](https://portal.graphlit.dev)

Prefer the standalone experience? Visit [ask.graphlit.dev](https://ask.graphlit.dev).

{% hint style="success" %}
**No credit surprises**: Ask Graphlit is **unbilled** (it does not consume your project credits).
{% endhint %}

***

## What is Ask Graphlit?

Ask Graphlit is an AI chatbot that understands Graphlit's API and can generate working code in Python, TypeScript, or .NET based on your intent.

Instead of searching through documentation or memorizing operation names, just describe what you want to do.

***

## Billing, Data Access, and Trust

* ✅ **Unbilled**: Ask Graphlit does **not** consume your project credits.
* ✅ **No project access**: Ask Graphlit does not have your Graphlit credentials and cannot access your content.
* ✅ **Grounded answers**: Ask Graphlit is preloaded with the current GraphQL schema and documentation context.

If you want an AI tool to search **your actual Graphlit data**, use the **Graphlit MCP Server** (local) from the [MCP integration guide](/mcp-integration/mcp-integration.md).

### The Discovery Problem

**Traditional API documentation:**

* You need to know operation names ("createWorkflow", "promptConversation")
* You browse through exhaustive parameter lists
* You read bottom-up (operations → use cases)

**Ask Graphlit:**

* You describe your intent ("extract entities from PDF")
* You get working code immediately
* You learn top-down (use case → operations)

***

## When to Use Ask Graphlit

### Perfect For

**Learning the API:**

* "How do I ingest a PDF?"
* "Show me code to create a Slack feed"
* "How do I extract entities from content?"

**Finding the Right Operation:**

* "What's the operation to search across multiple sources?"
* "How do I create a conversation with custom model?"
* "Show me streaming conversation code"

**Getting Code Examples:**

* "Give me Python code to ingest and search a PDF"
* "Show TypeScript example for knowledge graph extraction"
* "How do I use tool calling with conversations?"

**Troubleshooting:**

* "Why isn't my content finishing processing?"
* "How do I wait for ingestion to complete?"
* "What's the right way to handle async operations?"

### Not Ideal For

* **Accessing your actual data** - Use [Graphlit MCP Server](/mcp-integration/mcp-integration.md) instead
* **Real-time project integration** - Install MCP server locally
* **Non-code questions** - Check [Getting Started](/getting-started/overview.md) or the [Quickstart tutorial](/getting-started/quickstart.md)

***

## SDK Parity (Python, TypeScript, .NET)

All three SDKs are **code-generated from the same GraphQL schema**, so **core API operations and types are equivalent**.

What differs:

* **Naming conventions**:
  * TypeScript: `camelCase`
  * Python: `snake_case`
  * .NET: `PascalCase`
* **TypeScript-only helpers**: the TypeScript SDK includes optional convenience wrappers (e.g., `streamAgent`, `promptAgent`) that build on top of the same underlying API operations.

***

## How to Use It

### Option 1: Developer Portal Chatbot

Sign in to the [Graphlit Developer Portal](https://portal.graphlit.dev) and open **Ask Graphlit** from the sidebar. The chatbot lives alongside your projects so you can copy code straight into your app.

Prefer the standalone site? Use [**ask.graphlit.dev**](https://ask.graphlit.dev).

***

### Option 2: In Your IDE (MCP)

Integrate Ask Graphlit into Cursor, Windsurf, VS Code (Cline), or Claude Desktop.

**Add this endpoint to your MCP configuration:**

```
https://ask.graphlit.dev/mcp
```

**Cursor example:**

```json
{
  "mcpServers": {
    "ask-graphlit": {
      "url": "https://ask.graphlit.dev/mcp"
    }
  }
}
```

Then use it like:

```
@ask-graphlit How do I ingest a PDF and extract entities?
```

[**Full MCP setup guide →**](/mcp-integration/mcp-integration.md)

***

## Example Queries

{% hint style="success" %}
**Pro tip**: Add your preferred language to any query - "Show me **TypeScript** code to...", "Give me the **Python** version", or "How would I do this in **C#**?"
{% endhint %}

### Ingestion

```
How do I ingest a PDF from a URL?
Show me TypeScript code to create an RSS feed
How do I upload a file and wait for it to finish processing?
Give me Python code to ingest Slack messages
```

### Searching & Retrieval

```
How do I search across all my content?
Show me semantic search with filters in TypeScript
How do I search within specific collections?
What's the Python code to find content by entity?
```

### Conversations & RAG

```
How do I create a conversation in TypeScript?
Show me streaming conversation code
Give me the C# version of tool calling with conversations
What's the difference between promptConversation and streamAgent?
```

### Knowledge Graph

```
How do I extract entities from content?
Show me code to query people and organizations
How do I build a knowledge graph from web search?
What entities can I extract?
```

### Workflows

```
How do I create a workflow?
Show me workflow with entity extraction
How do I use vision models for PDF extraction?
What workflow stages are available?
```

### Feeds & Connectors

```
How do I connect to Slack?
Show me code to sync Google Drive
How do I create a podcast RSS feed?
What OAuth connectors are available?
```

***

## What Ask Graphlit Knows

Ask Graphlit is trained on:

**Documentation:**

* All quickstart tutorials
* Platform concept pages
* API patterns and best practices
* MCP integration guides

**Code Samples:**

* 60+ Google Colab notebooks
* Next.js application examples
* Streamlit UI applications
* Production patterns (from Zine)

**API Coverage:**

* All SDK operations (Python, TypeScript, .NET)
* GraphQL schema and types
* Parameter options and configurations
* Common error patterns and solutions

**Real-World Patterns:**

* Multi-tenant architecture
* Production deployment
* Error handling
* Async workflows
* Tool calling with agents
* Streaming responses

***

## Tips for Best Results

### Specify Your SDK/Language

**Ask Graphlit supports all 3 SDKs** - just mention your preference:

Instead of:

> "How do I ingest content?"

Try:

> "Show me **TypeScript** code to ingest a PDF" "Give me the **Python** version" "Show this in **C#/.NET**"

### Describe Your Use Case

Instead of:

> "How do I use conversations?"

Try:

> "I want to chat with my ingested PDFs using GPT-4, show me the code"

### Ask for Complete Examples

Instead of:

> "What parameters does createWorkflow take?"

Try:

> "Give me a complete example of creating a workflow with entity extraction"

### Change Languages Mid-Conversation

You can switch SDKs anytime:

* "Show me this in TypeScript"
* "Convert that to Python"
* "Give me the .NET version"
* "How would this look in C#?"

***

## Related Resources

**Learn by Doing:**

* [Quickstart: Your First Agent](/getting-started/quickstart.md) - Build a streaming agent in 7 minutes
* [AI Agents Tutorial](/tutorials/ai-agents.md) - Build agents with memory
* [Sample Gallery](https://github.com/graphlit/graphlit-samples) - 60+ working examples

**Understand the Concepts:**

* [Semantic Memory](/platform/semantic-memory.md) - How memory works
* [Key Concepts](/platform/key-concepts.md) - Data model overview
* [Platform Overview](/getting-started/overview.md) - Platform architecture

**Get Help:**

* [Discord Community](https://discord.gg/ygFmfjy3Qx) - Community support
* [GitHub Issues](https://github.com/graphlit/graphlit-client-python/issues) - Report bugs
* [MCP Integration](/mcp-integration/mcp-integration.md) - IDE setup

***

## Technical Details

### How It Works

Ask Graphlit uses:

* **RAG (Retrieval Augmented Generation)** - Searches documentation and samples
* **Code generation models** - Generates syntactically correct SDK code
* **Schema validation** - Ensures generated code matches current API
* **Best practices** - Follows production patterns from real applications

### Privacy & Security

* ✅ **No credentials required** - Ask Graphlit doesn't access your data
* ✅ **No data stored** - Conversations aren't persisted
* ✅ **Open source MCP server** - Inspect the code on [GitHub](https://github.com/graphlit/graphlit-mcp-server)

For accessing your actual data, use the [Graphlit MCP Server](/mcp-integration/mcp-integration.md) with your credentials.

***

## Frequently Asked Questions

### Can Ask Graphlit access my Graphlit data?

No - Ask Graphlit only helps you write code. It doesn't have your credentials.

To search your actual data, use the [Graphlit MCP Server](/mcp-integration/mcp-integration.md) locally with your credentials.

### Does it work offline?

No - Ask Graphlit is a cloud service. However, you can browse the [Sample Gallery](https://github.com/graphlit/graphlit-samples) offline.

### Can I use both Ask Graphlit and Graphlit MCP Server?

Yes! Use them together:

* **Ask Graphlit**: "How do I code this?"
* **Graphlit MCP Server**: "Search my actual data"

Both can be configured in your IDE simultaneously.

### Is it free?

Ask Graphlit is **unbilled**.

* **Standalone** (`ask.graphlit.dev`): no Graphlit account or credentials required.
* **Developer Portal**: requires a Portal login, but Ask Graphlit itself does not consume credits.

### What if the code doesn't work?

1. Copy the code and try it
2. Check the error message
3. Ask a follow-up question with the error
4. Join [Discord](https://discord.gg/ygFmfjy3Qx) for help

Ask Graphlit generates code based on current documentation, but edge cases may need adjustment.

***

## Example Session

{% hint style="info" %}
**Language flexibility**: Examples below use TypeScript (consistent with docs). Ask Graphlit supports **Python, TypeScript, and .NET** - just specify your preference in your question.
{% endhint %}

**You:**

> I want to ingest a PDF from Google Drive and extract people and organizations. Show me the code.

**Ask Graphlit:**

```typescript
import { Graphlit } from 'graphlit-client';
import {
  EntityTypes,
  FeedTypes,
  ObservableTypes
} from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

async function main() {
  // Step 1: Create workflow with entity extraction
  const workflow = await graphlit.createWorkflow({
    name: 'Extract Entities',
    extraction: {
      jobs: [{
        connector: {
          type: EntityExtractionServiceTypes.ModelText,
          extractedTypes: [
            ObservableTypes.Person,
            ObservableTypes.Organization
          ]
        }
      }]
    }
  });

  // Step 2: Create Google Drive feed
  const feed = await graphlit.createFeed({
    name: 'Google Drive Documents',
    type: FeedTypes.Site,
    site: {
      type: FeedServiceTypes.GoogleDrive,
      // Note: Set up OAuth credentials first
    },
    workflow: { id: workflow.createWorkflow.id }
  });

  console.log('Feed created:', feed.createFeed.id);
}

main();
```

**You:**

> How do I wait for the feed to finish processing before querying entities?

**Ask Graphlit:**

```typescript
async function waitForFeedCompletion(feedId: string) {
  while (true) {
    const feedResult = await graphlit.getFeed(feedId);
    const state = feedResult.feed?.state;
    
    if (state === 'COMPLETED') {
      console.log('Feed processing complete!');
      break;
    } else if (state === 'FAILED') {
      console.log('Feed processing failed');
      break;
    }
    
    await new Promise(resolve => setTimeout(resolve, 10000)); // Wait 10s
  }
}

// Use it
await waitForFeedCompletion(feed.createFeed.id);

// Now query extracted entities
const observables = await graphlit.queryObservables({
  filter: {
    types: [ObservableTypes.Person, ObservableTypes.Organization]
  }
});

const people = observables.observables?.results?.filter(
  obs => obs?.type === ObservableTypes.Person
);
const orgs = observables.observables?.results?.filter(
  obs => obs?.type === ObservableTypes.Organization
);

console.log('People:', people?.map(p => p?.observable.name));
console.log('Organizations:', orgs?.map(o => o?.observable.name));
```

**You:**

> Show me the Python version of this

**Ask Graphlit:**

```python
import asyncio
from graphlit import Graphlit
from graphlit_api.input_types import *

graphlit = Graphlit()

async def wait_for_feed_completion(feed_id):
    while True:
        feed_result = await graphlit.client.get_feed(id=feed_id)
        state = feed_result.feed.state
        
        if state == EntityState.COMPLETED:
            print("Feed processing complete!")
            break
        elif state == EntityState.FAILED:
            print("Feed processing failed")
            break
        
        await asyncio.sleep(10)

# Use it
await wait_for_feed_completion(feed.create_feed.id)

# Query entities
observables = await graphlit.client.query_observables(
    filter=ObservableFilter(
        types=[ObservableTypes.PERSON, ObservableTypes.ORGANIZATION]
    )
)

for obs in observables.query_observables.results:
    print(f"{obs.type}: {obs.observable.name}")
```

***

## Get Started

[**🚀 Launch Ask Graphlit in the Portal →**](https://portal.graphlit.dev)

Or integrate it into your IDE:

* [MCP Integration Guide](/mcp-integration/mcp-integration.md)
* [Cursor Setup](/mcp-integration/mcp-integration.md#cursor)
* [VS Code Setup](/mcp-integration/mcp-integration.md#vs-code-cline)

***

**Can't find what you need? Just ask!**


---

# 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.graphlit.dev/resources/ask-graphlit.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.
