π¦ Soojh-AI/
βββ π€ chatbot.py # Interactive chat interface
βββ π graph.py # LangGraph workflow definition
βββ π― node.py # Graph nodes and state management
βββ π οΈ tools.py # External research tools
βββ π§ llm.py # LLM configurations and models
βββ βοΈ agent.py # Google ADK agent setup
βββ π README.md # This file
βββ π .env.example # Environment variable template
βββ π requirements.txt # Python dependencies
βββ π« .gitignore # Git ignore rules
- Python 3.12+
- OpenAI API key
- Git
-
Clone the repository
git clone https://github.com/AMRENDRASINGH-COM/Soojh-ai-git.git cd Soojh-ai-git -
Create virtual environment
python -m venv venv # Windows venv\Scripts\activate # Linux/macOS source venv/bin/activate -
Install dependencies
pip install -r requirements.txt -
Configure environment
cp .env.example .env # Edit .env file and add your OpenAI API key: # OPENAI_API_KEY=your_openai_api_key_here -
Run the application
# Interactive chatbot python chatbot.py # Or import as module from graph import build_graph graph = build_graph()
from chatbot import chat_with_bot
# Simple conversation
response = chat_with_bot("What is machine learning?")
print(response)
# Research query
response = chat_with_bot("Find recent papers on transformer architecture")
print(response)
from graph import build_graph
# Build the LangGraph workflow
graph = build_graph()
# Stream responses for complex queries
events = graph.stream({
"messages": [("user", "Explain quantum computing with recent research")]
}, stream_mode="values")
for event in events:
print(event["messages"][-1].content)
from agent import root_agent
from google.adk.apps import AdkApp
# Create ADK application
app = AdkApp(agent=root_agent, enable_tracing=True)
# Start interactive session
session = app.create_session(user_id="user123")
# Query the multi-agent system
for event in app.stream_query(
user_id="user123",
session_id=session.id,
message="Research the latest developments in AI safety"
):
print(event)
- State Management: TypedDict-based state handling
- LLM Integration: GPT-4o with tool binding
- Message Processing: Conversation flow management
- StateGraph: LangGraph-based workflow orchestration
- Tool Integration: Conditional tool usage based on queries
- Flow Control: START β Chatbot β Tools β END
- Wikipedia Integration: Real-time knowledge retrieval
- Arxiv Access: Academic paper search and analysis
- Configurable Limits: Response length and result count control
- Google ADK Integration: Enterprise agent framework
- Sub-Agent Coordination: Specialized agent delegation
- LangGraph Bridge: Seamless integration between systems
- Academic paper analysis and summarization
- Cross-reference verification with Wikipedia
- Literature review automation
- Citation and reference management
- Context-aware conversations
- Multi-turn dialogue handling
- Domain-specific knowledge queries
- Real-time information retrieval
- Customer support automation
- Internal knowledge base queries
- Research and development assistance
- Decision support systems
# Required
OPENAI_API_KEY=your_openai_api_key_here
# Optional
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=your_langchain_api_key
LANGCHAIN_PROJECT=soojh-ai
# In llm.py
llm = ChatOpenAI(
openai_api_key=OPENAI_API_KEY,
model="gpt-4o", # Or gpt-4, gpt-3.5-turbo
temperature=0.1, # Adjust creativity
max_tokens=2000 # Response length limit
)
- langchain-openai: OpenAI integration
- langchain-community: Community tools and utilities
- langgraph: Graph-based workflow orchestration
- google-adk: Google Agent Development Kit
- python-dotenv: Environment variable management
- wikipedia: Wikipedia API wrapper
- arxiv: Academic paper access
- pydantic: Data validation and settings
from google.adk.agents import Agent
from google.adk.models.lite_llm import LiteLlm
# Create specialized agent
research_agent = Agent(
model=LiteLlm(model="openai/gpt-4o"),
name="research_specialist",
description="Expert in academic research and analysis",
instruction="Provide detailed, well-sourced research responses",
tools=[wikipedia_tool, arxiv_tool]
)
from langchain.tools import BaseTool
class CustomTool(BaseTool):
name = "custom_research_tool"
description = "Specialized tool for domain-specific research"
def _run(self, query: str) -> str:
# Your custom tool implementation
return f"Custom research result for: {query}"
# Add to tools list
tools.append(CustomTool())
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
pytest tests/
# Code formatting
black .
isort .
# Type checking
mypy .
This project is licensed under the MIT License - see the LICENSE file for details.
- LangChain Team: For the excellent LangGraph framework
- Google Cloud: For the Agent Development Kit
- OpenAI: For the powerful GPT models
- Arxiv & Wikipedia: For open access to knowledge
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Project Wiki
Made with β€οΈ by Amrendra Singh
Soojh AI - Where Intelligence Meets Innovation π "@ > README.md
This comprehensive README includes:
- Professional branding with badges
- Clear architecture diagram
- Complete installation guide
- Usage examples for all components
- Detailed project structure
- Advanced configuration options
- Contributing guidelines
- Professional formatting
Copy and paste this command to create your README.md file![1][2][3][4][5]