Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notebook and example reports #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions ntbk/report_maistro.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Report mAIstro Notebook\n",
"\n",
"This notebook demonstrates how to use the Report mAIstro tool to generate customizable reports on any user-supplied topic."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Import necessary libraries\n",
"import os\n",
"from langchain_core.runnables import RunnableConfig\n",
"from langgraph.graph import StateGraph\n",
"from langgraph.constants import Send\n",
"from langchain_openai import ChatOpenAI\n",
"from langchain_anthropic import ChatAnthropic\n",
"from tavily import TavilyClient, AsyncTavilyClient\n",
"from pydantic import BaseModel, Field\n",
"from typing import List\n",
"from typing_extensions import TypedDict\n",
"import asyncio\n",
"import operator\n",
"import configuration\n",
"from langsmith import traceable\n",
"from langchain_core.messages import HumanMessage, SystemMessage\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 1: Set up the environment\n",
"\n",
"Make sure you have the necessary API keys in your `.env` file."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# Load environment variables\n",
"from dotenv import load_dotenv\n",
"load_dotenv()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 2: Define the configuration\n",
"\n",
"Define the configuration for the report generation process."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Define the configuration\n",
"config = RunnableConfig(\n",
" configurable={\n",
" \"report_structure\": configuration.DEFAULT_REPORT_STRUCTURE,\n",
" \"number_of_queries\": 2,\n",
" \"tavily_topic\": \"general\",\n",
" \"tavily_days\": None\n",
" }\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 3: Define the report state\n",
"\n",
"Define the initial state for the report generation process."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# Define the initial state\n",
"initial_state = {\n",
" \"topic\": \"The impact of AI on modern business\",\n",
" \"sections\": [],\n",
" \"completed_sections\": [],\n",
" \"report_sections_from_research\": \"\",\n",
" \"final_report\": \"\"\n",
"}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 4: Define the report generation graph\n",
"\n",
"Define the state graph for the report generation process."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# Define the report generation graph\n",
"graph = StateGraph(\n",
" input=initial_state,\n",
" output={\"final_report\": str},\n",
" config=config\n",
")\n",
"\n",
"# Add nodes and edges to the graph\n",
"graph.add_node(\"generate_report_plan\", generate_report_plan)\n",
"graph.add_node(\"build_section_with_web_research\", section_builder.compile())\n",
"graph.add_node(\"gather_completed_sections\", gather_completed_sections)\n",
"graph.add_node(\"write_final_sections\", write_final_sections)\n",
"graph.add_node(\"compile_final_report\", compile_final_report)\n",
"graph.add_edge(START, \"generate_report_plan\")\n",
"graph.add_conditional_edges(\"generate_report_plan\", initiate_section_writing, [\"build_section_with_web_research\"])\n",
"graph.add_edge(\"build_section_with_web_research\", \"gather_completed_sections\")\n",
"graph.add_conditional_edges(\"gather_completed_sections\", initiate_final_section_writing, [\"write_final_sections\"])\n",
"graph.add_edge(\"write_final_sections\", \"compile_final_report\")\n",
"graph.add_edge(\"compile_final_report\", END)\n",
"\n",
"# Compile the graph\n",
"compiled_graph = graph.compile()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Step 5: Run the report generation process\n",
"\n",
"Run the state graph to generate the report."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# Run the report generation process\n",
"final_report = compiled_graph.run()\n",
"print(final_report)"
]
}
]
}
80 changes: 80 additions & 0 deletions report_examples/reports/business_strategy_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Creating Successful Developer Marketplaces: Key Considerations

Software developer-focused marketplaces face unique challenges in building thriving ecosystems. These platforms must balance the needs of developers, clients, and the broader tech community while fostering innovation and collaboration. Success hinges on solving real pain points, leveraging network effects, and continuously adapting to evolving technologies. This report examines key strategies employed by leading platforms like GitHub, Stack Overflow, and Upwork to create value, build trust, and scale their developer-centric business models.

## GitHub's Developer Ecosystem Success

**GitHub's meteoric rise stems from its focus on solving real developer pain points.** The platform's core innovation was bringing Git version control to the cloud, making collaboration seamless. This addressed a critical need for distributed teams and open-source projects.

GitHub's network effects drove rapid adoption. As more developers joined, the platform became increasingly valuable for finding collaborators, showcasing work, and discovering projects. By 2018, GitHub had over 31 million developers and 96 million repositories.

The company's freemium model proved highly effective. Free accounts for public repositories encouraged widespread adoption, while paid private repositories monetized business users. This strategy helped GitHub reach $200 million in annual recurring revenue by 2018.

GitHub continuously expanded its feature set to entrench its position. Key additions included:

- GitHub Actions (2018): Automated workflows
- Codespaces (2020): Cloud development environments
- Copilot (2021): AI pair programming

Microsoft's $7.5 billion acquisition in 2018 provided resources to accelerate growth while maintaining GitHub's developer-centric culture. This combination of solving core needs, network effects, and continuous innovation established GitHub as the dominant platform for software development collaboration.

### Sources
- GitHub Octoverse 2018: https://octoverse.github.com/2018/
- GitHub Blog - Microsoft acquisition: https://github.blog/2018-06-04-github-microsoft/

## Stack Overflow's Journey to Q&A Success

**Stack Overflow's unique value proposition of community-driven knowledge sharing has been key to its dominance in the developer Q&A space.** Since its founding in 2008, Stack Overflow has grown to become the largest and most trusted online community for developers to learn and share knowledge. The platform's success stems from its focus on high-quality, curated content created by a global network of over 65,000 developers from 185 countries.

Stack Overflow's community-building strategies include:

- Gamification elements like reputation points and badges
- Strict moderation policies to maintain content quality
- A voting system to surface the best answers
- Tools for collaborative editing and improvement of posts

The company has successfully monetized its platform through job listings, advertising, and enterprise knowledge management solutions like Stack Overflow for Teams. In 2023, Stack Overflow expanded into AI-powered features with the launch of OverflowAI, which aims to enhance the developer experience while preserving human-generated knowledge.

A key challenge moving forward is balancing AI integration with community trust. The 2024 Developer Survey revealed that while 76% of developers use or plan to use AI tools, only 43% trust their accuracy. Stack Overflow's commitment to responsible AI use and attribution to human contributors will be crucial for maintaining its position as the go-to resource for developer knowledge.

### Sources
- Community products: Reflections and looking ahead - Stack Overflow: https://stackoverflow.blog/2024/03/27/community-products-reflections-and-looking-ahead/
- Stack Overflow's 2024 Developer Survey Shows the Gap Between AI Use and ...: https://stackoverflow.co/company/press/archive/stack-overflow-2024-developer-survey-gap-between-ai-use-trust
- 2024 Stack Overflow Developer Survey: https://survey.stackoverflow.co/2024/

## Upwork's Matching Algorithm

**Upwork's matching algorithm aims to connect clients with the most suitable freelancers, but its effectiveness is debated.** The algorithm considers multiple factors when recommending "Best Match" freelancers, including skills, job requirements, freelancer ratings, and past performance. For example, if a client posts an entry-level job, the algorithm will prioritize freelancers with matching experience levels.

However, some clients report mismatches between their needs and the algorithm's recommendations. Issues include:

- Recommended freelancers with rates far above the client's budget
- Skill mismatches (e.g. full-stack developers for front-end jobs)
- Low-quality proposals receiving "Best Match" status

Upwork continues to refine its algorithm, incorporating machine learning to improve matches over time. The platform encourages users to provide feedback and use filters to further narrow results. Despite imperfections, the matching system remains a core feature in Upwork's efforts to streamline the hiring process for both clients and freelancers in the growing gig economy.

### Sources
- Best Matched Algorithm for "Recently posted" Jobs - Upwork Community: https://community.upwork.com/t5/Freelancers/Best-Matched-Algorithm-for-quot-Recently-posted-quot-Jobs/m-p/1511756
- Who can explain how "best match" works - Upwork Community: https://community.upwork.com/t5/Clients/Who-can-explain-how-quot-best-match-quot-works/m-p/1582911
- Upwork Updates Fall 2024: AI Innovation and New Solutions: https://www.upwork.com/blog/updates-fall-2024

## Comparative Analysis and Recommendations

GitHub, Stack Overflow, and Upwork have each carved out successful niches in the developer ecosystem. Their success stems from addressing specific pain points and leveraging network effects. GitHub revolutionized code collaboration, Stack Overflow created a knowledge marketplace, and Upwork connected developers with clients. Common success factors include:

| Factor | GitHub | Stack Overflow | Upwork |
|--------|--------|----------------|--------|
| Core Innovation | Cloud-based Git | Community-driven Q&A | Freelance marketplace |
| Network Effects | Strong | Strong | Moderate |
| Monetization | Freemium | Ads, job listings, enterprise solutions | Transaction fees |
| AI Integration | Copilot | OverflowAI | Matching algorithm |

Recommendations for new developer marketplaces:
1. Solve a specific, critical developer need
2. Build strong network effects through community engagement
3. Implement a sustainable monetization strategy
4. Carefully integrate AI to enhance user experience without compromising trust
5. Continuously innovate and expand features to entrench market position

The future of developer marketplaces lies in balancing technological innovation with community trust and engagement.
Loading