Framework Docs AI is a powerful SaaS solution that revolutionizes documentation management for various frameworks. It seamlessly scrapes framework documentation, creates a comprehensive knowledge base, and utilizes advanced language models to provide accurate, retrieval-based responses to user queries.
Clone the repository:
git clone https://github.com/yourusername/framework-docs-ai.git
cd framework-docs-ai
Install required dependencies:
pip install -r requirements.txt
Set up your OPENAI API key:
.env file in the root directoryOPENAI_API_KEY=your_api_key_here
Run the application:
python app.py
Open your web browser and navigate to the provided local URL (usually http://localhost:8501).
Start exploring framework documentation and asking questions!
You can add your own custom frameworks to the Framework Docs AI. Follow these steps:
Crawl the URLs (crawler.py):
crawler.py file uses a DomainCrawler class to crawl websites and collect URLs.CONFIGS = [
{
"start_url": "https://your-framework-docs-url.com",
"docs_path": "/",
"avoid_keywords": ["blog", "about", "community"]
},
# You can add multiple configurations for different sections of your documentation
]
OUTPUT_PATH = "data/Crawled_url/"
FILE_NAME = "YOUR_FRAMEWORK_crawled.json"CONFIGS list:
start_url: The base URL of your framework's documentation.docs_path: The specific path where the documentation starts.avoid_keywords: List of keywords to avoid in URLs (e.g., blog posts, community pages).OUTPUT_PATH and FILE_NAME as needed.docs_path.crawler.py to save the crawled URLs in the specified output file.Scrape the Content:
scrape.py to extract content from the crawled URLs.scrape.py to match your new framework:
if __name__ == "__main__":
Scrape("data/Crawled_url/YOUR_FRAMEWORK_crawled.json", "data/Scraped_data/YOUR_FRAMEWORK_scraped.json")scrape.py to save the scraped content in the data/Scraped_data directory.Convert to Langchain Document Format:
save.py to convert the scraped JSON to a pickle file compatible with Langchain's Document schema.save.py:
if __name__ == "__main__":
convert_json_to_pkl('data/Scraped_data/YOUR_FRAMEWORK_scraped.json', 'data/Scraped_data/YOUR_FRAMEWORK_scraped.pkl')save.py to create the pickle file.Update app.py:
kb_manager_your_framework = initialize_kb("Your Framework Name", "./Vector_DB/YOUR_FRAMEWORK", "data/Scraped_data/YOUR_FRAMEWORK_scraped.pkl")assistant_your_framework = create_assistant("Your Framework Name", api_key, kb_manager_your_framework) if kb_manager_your_framework else Noneoptions=["Langchain Python", "Next.js", "Vue.js", "MDN_WEB", "Pytorch", "Chainlit", "Your Framework Name"],elif selected == "Your Framework Name" and assistant_your_framework:
display_framework(assistant_your_framework, "Your Framework Name")Restart the Application:
app.py again to see your new framework in action.Remember to replace "YOUR_FRAMEWORK" and "Your Framework Name" with the appropriate names for your custom framework.
We welcome contributions! Please see our Contributing Guide for more details.
This project is licensed under the MIT License - see the LICENSE file for details.