ContextWeaver AI is a FastAPI-based project designed to build a context-based AI agent leveraging LangGraph and PydanticAI. The agent is capable of searching the web for information and answering queries based on the gathered data. It incorporates advanced features such as token budgeting, maintaining conversation context, and dynamic decision-making across subgraphs.
- Detailed Reporting: Provides a comprehensive report on any topic by searching the web.
- Knowledge Base Creation: Creates a knowledge base from shared URLs using an efficient chunking strategy.
- Context Preservation: Maintains the context of each conversation for seamless interactions.
- QA Agent Integration: Uses a QA agent in each graph to validate answers and loops the process if the QA agent is not satisfied for each subgraph.
- Dynamic Subgraph Switching: Dynamically decides which subgraph to activate based on the query and context.
- Dockerized: The application is containerized using Docker for easy deployment and scalability.
- streamlit frontend chatbot: Provides a user-friendly interface for interaction with the bot.
Ensure you have the following installed on your system:
- Python 3.8 or higher
pip(Python package manager)
-
Clone the repository:
git clone <repository-url> cd subgraph-web-bot
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venvScriptsactivate
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Copy the
env.samplefile to.env:cp env.sample .env
- Update the
.envfile with your API keys and configuration.
- Copy the
-
Start the FastAPI server:
uvicorn app.main:app --reload
-
Access the API documentation at:
http://127.0.0.1:8000/docs
- Use the
queryendpoint to perform a web crawl and get detailed reports. - Use the
project-detailsendpoint to get project metadata. - Use the
healthendpoint to check the application's health.
- Improved token budgeting strategies.
- Enhanced subgraph decision-making algorithms.
- Support for additional AI models and APIs.
We welcome contributions from everyone! Please read our Contributing Guide to get started. ✨
This project is licensed under the MIT License.