ChatTensorFlow is an intelligent assistant that helps users with TensorFlow related queries by utilizing the power of LangGraph based Agents, vector embeddings, and a conversational interface powered by various LLM providers.
- Multi-provider support: Works with multiple LLM providers (Google Gemini, OpenAI, Anthropic, Cohere)
- Content processing: Splits and embeds TensorFlow documentation for semantic search
- Query routing: Intelligently classifies user questions and determines next steps
- Assisted research: Follows a research plan to answer complex TensorFlow queries
- Context-aware responses: Provides answers with citations from official TensorFlow documentation
ChatTensorFlow is built with a modular architecture:
- Document Crawler: Efficiently crawls TensorFlow documentation using sitemap.xml
- Data Ingestion: Processes web content into chunks for embedding
- Vector Store: Stores embeddings for semantic search using Chroma
- Retriever: Retrieves relevant content when answering questions
- Researcher Graph: Follows a structured plan to research answers
- Router Graph: Determines how to handle each user query
- Response Generator: Creates coherent, accurate responses based on retrieved information
![]() TF Assistant main Graph |
![]() Researcher sub Graph |
- Python 3.9+
- API keys for at least one supported LLM provider
-
Clone the repository:
git clone https://github.com/yourusername/chatTensorFlow.git cd chatTensorFlow
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up your environment variables:
cp .env.example .env # Edit .env with your API keys
To crawl and process the Scikit-learn documentation:
-
Run the web crawler:
python -m processor.crawler
-
Process and ingest the data:
python -m processor.data_ingestion
This will create a Chroma vector database with the embedded documentation chunks.
Run the application:
python app/main.py
The assistant can answer questions about:
- TensorFlow API usage
- Deep learning concepts
- Model building and training
- TensorFlow data pipelines
- Common errors and troubleshooting
Example queries:
- "How do I compile and train a Keras model?"
- "How do I use tf.data.Dataset to load and preprocess large datasets?"
- "What are the parameters for a Conv2D layer?"
- "How do I create and use a custom loss function?"
The application can be configured by setting the following environment variables:
# LLM Provider (gemini, openai, anthropic, cohere)
LLM_PROVIDER=gemini
# Embedding Provider (gemini, openai, cohere)
EMBEDDING_PROVIDER=gemini
# API Keys
GOOGLE_API_KEY=your_gemini_api_key
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
COHERE_API_KEY=your_cohere_api_key
# Model selections (optional, defaults provided)
GEMINI_LLM_MODEL=gemini-2.0-flash
OPENAI_LLM_MODEL=gpt-4o
ANTHROPIC_LLM_MODEL=claude-3-sonnet-20240229
COHERE_LLM_MODEL=command
chatTensorFlow/
├── app/
│ ├── core/ # Core utilities and model interfaces
│ ├── graphs/ # LangGraph state management and flow
│ ├── retriever/ # Document retrieval components
│ ├── static/ # Static files (CSS, JS, images)
│ ├── templates/ # HTML templates
│ └── main.py # Application entry point
├── config/ # Application configuration
├── DATA/ # Vector store data
├── logs/ # Application logs
├── processor/ # Web crawling and data ingestion
├── tensorflow_docs/ # Crawled TensorFlow documentation
└── tests/ # Unit and integration tests
- User Query Analysis: The system classifies the query as TensorFlow related, general, or requiring more information
- Research Planning: For TensorFlow queries, a research plan is created
- Document Retrieval: Relevant documentation is retrieved using semantic search
- Response Generation: A detailed, accurate response is generated citing relevant documentation
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with LangChain and LangGraph
- Uses crawl4ai for crawling
- Uses ChromaDB for vector storage
- Powered by various LLM providers (Gemini, OpenAI, Anthropic, Cohere)
- Documentation content from TensorFlow
- Developed by Lalan Kumar