Skip to main content

Ask Feature Guide

The Ask feature is a powerful RAG (Retrieval Augmented Generation) system that enables natural language conversations with your code documentation. It combines advanced retrieval techniques with AI to provide accurate, contextual answers about your codebase.

What is the Ask Feature?

The Ask feature transforms your static documentation into an interactive knowledge base where you can:
  • Ask natural questions about your code, APIs, and documentation
  • Get contextual answers with relevant code snippets and explanations
  • Maintain conversation history for follow-up questions
  • Access real-time streaming responses for immediate feedback
  • Query programmatically via API for integration into other tools

RAG Architecture

The Ask feature uses Retrieval Augmented Generation (RAG) to combine the best of both worlds: precise information retrieval from your docs with the natural language capabilities of large language models.

How RAG Works with Code

1. Document Indexing

When your wiki is generated, DeepWikiOpen creates semantic embeddings of your documentation:

2. Query Processing

When you ask a question, the system:
  1. Converts your question into a semantic embedding
  2. Searches the vector database for relevant documentation chunks
  3. Retrieves contextual information from multiple sources
  4. Generates a comprehensive answer using the retrieved context

Using the Ask Interface

Basic Question Interface

The Ask feature provides an intuitive chat interface in your generated wiki:
Ask Feature Interface

Conversation Flow

1

Ask Your Question

Type your question in natural language in the Ask input field
2

Real-time Processing

Watch as the system processes your query with streaming responses
3

Receive Answer

Get a comprehensive answer with code examples and source references
4

Follow-up Questions

Continue the conversation with contextual follow-up queries

Types of Questions That Work Best

βœ… Excellent Question Types

How-To Questions

Examples:
  • β€œHow do I set up authentication?”
  • β€œHow to handle errors in the API?”
  • β€œHow do I deploy this application?”

What-Is Questions

Examples:
  • β€œWhat is the UserService class?”
  • β€œWhat does the config.json file contain?”
  • β€œWhat are the available endpoints?”

Code Location Questions

Examples:
  • β€œWhere is the database connection configured?”
  • β€œWhere are the API routes defined?”
  • β€œWhich file contains the main application logic?”

Best Practice Questions

Examples:
  • β€œWhat’s the recommended way to handle validation?”
  • β€œBest practices for error handling?”
  • β€œHow should I structure my tests?”

❌ Less Effective Question Types

These types of questions may not yield optimal results:
  • Vague questions without context (β€œHow does this work?”)
  • Questions about code not in your documentation
  • Highly specific implementation details not documented
  • Questions requiring real-time data or external information

Example Questions and Responses

API Documentation Questions

User: β€œHow do I authenticate requests to the API?”

Code Structure Questions

User: β€œWhat’s the structure of the database models?”

Conversation History and Context

Context Retention

The Ask feature maintains conversation context throughout your session:

Follow-up Question Examples

Q: β€œWhat API endpoints are available?”A: Lists all available endpoints with descriptions…Follow-up: β€œHow do I use the user endpoint?” Follow-up: β€œWhat’s the rate limiting for these endpoints?” Follow-up: β€œAre there any authentication requirements?”
Q: β€œHow does error handling work?”A: Explains the error handling strategy with examples…Follow-up: β€œWhat about async errors?” Follow-up: β€œHow do I log these errors?” Follow-up: β€œAre there custom error types?”

Streaming Responses and Real-time Interaction

Streaming Implementation

The Ask feature provides real-time streaming responses for immediate feedback:

Visual Feedback

Streaming Response Animation
The interface provides visual indicators for:
  • Search progress with animated loading states
  • Token-by-token streaming for real-time response building
  • Source highlighting as references are found
  • Completion status when the response is finished

API Usage for Programmatic Q&A

REST API Endpoints

API Response Format

Best Practices for Effective Questions

🎯 Writing Better Questions

Be Specific

Instead of: β€œHow does this work?”Try: β€œHow does user authentication work in the login endpoint?”

Provide Context

Instead of: β€œFix this error”Try: β€œHow do I handle the β€˜Database connection failed’ error when starting the server?”

Ask About Documented Features

Good: β€œWhat configuration options are available for the email service?”Less Good: β€œHow do I integrate with an undocumented third-party service?”

Use Examples

Better: β€œHow do I format a POST request to create a new user with email and password fields?”vs: β€œHow do I create users?”

πŸ“ Question Templates

πŸ’‘ Advanced Query Techniques

Break complex questions into parts:Instead of: β€œHow do I set up the database, configure authentication, and deploy to production?”Try:
  1. β€œHow do I set up the database for development?”
  2. β€œHow do I configure JWT authentication?” (follow-up)
  3. β€œWhat’s the deployment process for production?” (follow-up)
Build on previous answers:After asking about authentication:
  • β€œHow do I test these authentication endpoints?”
  • β€œWhat error codes does this authentication return?”
  • β€œHow do I refresh expired tokens mentioned earlier?”
Request concrete examples:Good questions:
  • β€œCan you show me an example of making a POST request to create a user?”
  • β€œWhat does a typical error response look like?”
  • β€œCan you provide a sample configuration file?”

Limitations and Troubleshooting

Known Limitations

Current limitations of the Ask feature:
  • Documentation Scope: Only searches indexed documentation and code files
  • Real-time Data: Cannot access live databases or external APIs
  • Code Execution: Cannot run or test code, only explain existing code
  • Version Specificity: May not distinguish between different versions of your code
  • Complex Logic: May struggle with highly complex business logic without clear documentation

Common Issues and Solutions

Symptoms: The AI responds with β€œI couldn’t find relevant information”Solutions:
  • Check if your question relates to documented features
  • Try rephrasing with different terminology
  • Ensure your documentation was properly indexed
  • Ask more specific questions about documented components
Example Fix:
  • ❌ β€œHow do I use advanced features?”
  • βœ… β€œHow do I configure the email notification system?”
Symptoms: The response doesn’t match your actual codebaseSolutions:
  • Verify your documentation is up-to-date
  • Re-index your documentation if you’ve made recent changes
  • Provide more context in your question
  • Ask follow-up questions for clarification
Example:
Symptoms: Questions take a long time to processSolutions:
  • Check if you’re asking very broad questions (try being more specific)
  • Verify your internet connection for streaming responses
  • Consider if your documentation is very large (may require longer processing)
  • Use the API with appropriate timeout settings
Optimization:
Symptoms: Follow-up questions don’t reference previous conversationSolutions:
  • Ensure you’re using the same conversation session
  • Check that cookies/session storage is enabled
  • For API usage, pass the same conversation_id
  • Start a new conversation if context becomes confusing
API Example:

Performance Optimization Tips

Optimize your questions for better performance:

Debug Mode

Enable debug mode to troubleshoot issues:

Need Help?

Still having issues?
  • Check the API Documentation for detailed endpoint information
  • Review Common Patterns for question examples
  • Contact support with specific error messages and question examples
  • Join our community Discord for real-time help

Next Steps

API Reference

Detailed API documentation for programmatic access

Integration Guide

Learn how to integrate Ask into your applications

Advanced Features

Explore advanced Ask feature capabilities

Best Practices

Tips and patterns for effective documentation Q&A