[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73975":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},73975,"gemini-fullstack-langgraph-quickstart","google-gemini\u002Fgemini-fullstack-langgraph-quickstart","google-gemini","Get started with building Fullstack Agents using Gemini 2.5 and LangGraph","https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fgoogle-search",null,"Jupyter Notebook",18207,3080,113,29,0,10,23,51,30,106.6,"Apache License 2.0",false,"main",true,[27,28],"gemini","gemini-api","2026-06-12 04:01:12","# Gemini Fullstack LangGraph Quickstart\n\nThis project demonstrates a fullstack application using a React frontend and a LangGraph-powered backend agent. The agent is designed to perform comprehensive research on a user's query by dynamically generating search terms, querying the web using Google Search, reflecting on the results to identify knowledge gaps, and iteratively refining its search until it can provide a well-supported answer with citations. This application serves as an example of building research-augmented conversational AI using LangGraph and Google's Gemini models.\n\n\u003Cimg src=\".\u002Fapp.png\" title=\"Gemini Fullstack LangGraph\" alt=\"Gemini Fullstack LangGraph\" width=\"90%\">\n\n## Features\n\n- 💬 Fullstack application with a React frontend and LangGraph backend.\n- 🧠 Powered by a LangGraph agent for advanced research and conversational AI.\n- 🔍 Dynamic search query generation using Google Gemini models.\n- 🌐 Integrated web research via Google Search API.\n- 🤔 Reflective reasoning to identify knowledge gaps and refine searches.\n- 📄 Generates answers with citations from gathered sources.\n- 🔄 Hot-reloading for both frontend and backend during development.\n\n## Project Structure\n\nThe project is divided into two main directories:\n\n-   `frontend\u002F`: Contains the React application built with Vite.\n-   `backend\u002F`: Contains the LangGraph\u002FFastAPI application, including the research agent logic.\n\n## Getting Started: Development and Local Testing\n\nFollow these steps to get the application running locally for development and testing.\n\n**1. Prerequisites:**\n\n-   Node.js and npm (or yarn\u002Fpnpm)\n-   Python 3.11+\n-   **`GEMINI_API_KEY`**: The backend agent requires a Google Gemini API key.\n    1.  Navigate to the `backend\u002F` directory.\n    2.  Create a file named `.env` by copying the `backend\u002F.env.example` file.\n    3.  Open the `.env` file and add your Gemini API key: `GEMINI_API_KEY=\"YOUR_ACTUAL_API_KEY\"`\n\n**2. Install Dependencies:**\n\n**Backend:**\n\n```bash\ncd backend\npip install .\n```\n\n**Frontend:**\n\n```bash\ncd frontend\nnpm install\n```\n\n**3. Run Development Servers:**\n\n**Backend & Frontend:**\n\n```bash\nmake dev\n```\nThis will run the backend and frontend development servers.    Open your browser and navigate to the frontend development server URL (e.g., `http:\u002F\u002Flocalhost:5173\u002Fapp`).\n\n_Alternatively, you can run the backend and frontend development servers separately. For the backend, open a terminal in the `backend\u002F` directory and run `langgraph dev`. The backend API will be available at `http:\u002F\u002F127.0.0.1:2024`. It will also open a browser window to the LangGraph UI. For the frontend, open a terminal in the `frontend\u002F` directory and run `npm run dev`. The frontend will be available at `http:\u002F\u002Flocalhost:5173`._\n\n## How the Backend Agent Works (High-Level)\n\nThe core of the backend is a LangGraph agent defined in `backend\u002Fsrc\u002Fagent\u002Fgraph.py`. It follows these steps:\n\n\u003Cimg src=\".\u002Fagent.png\" title=\"Agent Flow\" alt=\"Agent Flow\" width=\"50%\">\n\n1.  **Generate Initial Queries:** Based on your input, it generates a set of initial search queries using a Gemini model.\n2.  **Web Research:** For each query, it uses the Gemini model with the Google Search API to find relevant web pages.\n3.  **Reflection & Knowledge Gap Analysis:** The agent analyzes the search results to determine if the information is sufficient or if there are knowledge gaps. It uses a Gemini model for this reflection process.\n4.  **Iterative Refinement:** If gaps are found or the information is insufficient, it generates follow-up queries and repeats the web research and reflection steps (up to a configured maximum number of loops).\n5.  **Finalize Answer:** Once the research is deemed sufficient, the agent synthesizes the gathered information into a coherent answer, including citations from the web sources, using a Gemini model.\n\n## CLI Example\n\nFor quick one-off questions you can execute the agent from the command line. The\nscript `backend\u002Fexamples\u002Fcli_research.py` runs the LangGraph agent and prints the\nfinal answer:\n\n```bash\ncd backend\npython examples\u002Fcli_research.py \"What are the latest trends in renewable energy?\"\n```\n\n\n## Deployment\n\nIn production, the backend server serves the optimized static frontend build. LangGraph requires a Redis instance and a Postgres database. Redis is used as a pub-sub broker to enable streaming real time output from background runs. Postgres is used to store assistants, threads, runs, persist thread state and long term memory, and to manage the state of the background task queue with 'exactly once' semantics. For more details on how to deploy the backend server, take a look at the [LangGraph Documentation](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Fconcepts\u002Fdeployment_options\u002F). Below is an example of how to build a Docker image that includes the optimized frontend build and the backend server and run it via `docker-compose`.\n\n_Note: For the docker-compose.yml example you need a LangSmith API key, you can get one from [LangSmith](https:\u002F\u002Fsmith.langchain.com\u002Fsettings)._\n\n_Note: If you are not running the docker-compose.yml example or exposing the backend server to the public internet, you should update the `apiUrl` in the `frontend\u002Fsrc\u002FApp.tsx` file to your host. Currently the `apiUrl` is set to `http:\u002F\u002Flocalhost:8123` for docker-compose or `http:\u002F\u002Flocalhost:2024` for development._\n\n**1. Build the Docker Image:**\n\n   Run the following command from the **project root directory**:\n   ```bash\n   docker build -t gemini-fullstack-langgraph -f Dockerfile .\n   ```\n**2. Run the Production Server:**\n\n   ```bash\n   GEMINI_API_KEY=\u003Cyour_gemini_api_key> LANGSMITH_API_KEY=\u003Cyour_langsmith_api_key> docker-compose up\n   ```\n\nOpen your browser and navigate to `http:\u002F\u002Flocalhost:8123\u002Fapp\u002F` to see the application. The API will be available at `http:\u002F\u002Flocalhost:8123`.\n\n## Technologies Used\n\n- [React](https:\u002F\u002Freactjs.org\u002F) (with [Vite](https:\u002F\u002Fvitejs.dev\u002F)) - For the frontend user interface.\n- [Tailwind CSS](https:\u002F\u002Ftailwindcss.com\u002F) - For styling.\n- [Shadcn UI](https:\u002F\u002Fui.shadcn.com\u002F) - For components.\n- [LangGraph](https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Flanggraph) - For building the backend research agent.\n- [Google Gemini](https:\u002F\u002Fai.google.dev\u002Fmodels\u002Fgemini) - LLM for query generation, reflection, and answer synthesis.\n\n## License\n\nThis project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details. \n","该项目展示了如何使用Gemini 2.5和LangGraph构建全栈代理应用程序，结合React前端和LangGraph后端。核心功能包括动态生成搜索词、利用Google搜索API进行网络查询、反思结果以识别知识缺口并迭代优化搜索，直至提供带有引用的详实答案。技术特点涵盖基于LangGraph的高级研究与对话AI能力、集成Google Gemini模型的智能搜索及热重载开发环境。适合用于需要增强研究功能的对话式AI场景，如学术研究助手或复杂问题解答系统。",2,"2026-06-11 03:48:12","high_star"]