# rag **Repository Path**: crazy_dog/rag ## Basic Information - **Project Name**: rag - **Description**: 一个支持知识库的rag智能体。基于langgraph - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-25 - **Last Updated**: 2026-05-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # New LangGraph Project [![CI](https://github.com/langchain-ai/new-langgraph-project/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/langchain-ai/new-langgraph-project/actions/workflows/unit-tests.yml) [![Integration Tests](https://github.com/langchain-ai/new-langgraph-project/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/langchain-ai/new-langgraph-project/actions/workflows/integration-tests.yml) This project demonstrates a LangGraph application for extracting schedules from natural language, asking follow-up questions for missing required fields, and returning a normalized schedule response. It can still be debugged with [LangGraph Studio](https://langchain-ai.github.io/langgraph/concepts/langgraph_studio/) and run as a standalone HTTP service.
Graph view in LangGraph studio UI
The core logic in `src/agent/graph.py` now implements a schedule extraction workflow with clarification and completion steps. You can extend this graph to orchestrate more complex agentic workflows that can be visualized and debugged in LangGraph Studio. ## Getting Started 1. Install dependencies, along with the [LangGraph CLI](https://langchain-ai.github.io/langgraph/concepts/langgraph_cli/), which will be used to run the server. ```bash cd path/to/your/app pip install -e . "langgraph-cli[inmem]" ``` 2. (Optional) Customize the code and project as needed. Create a `.env` file if you need to use secrets. ```bash cp .env.example .env ``` If you want to enable LangSmith tracing, add your LangSmith API key to the `.env` file. ```text # .env LANGSMITH_API_KEY=lsv2... ``` 3. Start the LangGraph Server for debugging. ```shell langgraph dev ``` ## Production HTTP API If you want to expose the graph through your own HTTP interface, run the FastAPI app directly: ```bash uvicorn agent.api:app --host 0.0.0.0 --port 8000 ``` Use `langgraph dev` for debugging and LangGraph Studio, and use FastAPI for the production HTTP entrypoint. ## Schedule Extraction Mode The graph accepts natural-language schedule text and returns either a clarification question or a normalized schedule object. Required fields: - `title` - `start_time` - `end_time` Optional fields: - `location` - `participants` - `notes` When required fields are missing, the graph asks in this order: 1. `start_time` 2. `end_time` 3. `title` The HTTP API returns: - `{"type": "clarification", "question": "..."}` when it needs more information - `{"type": "schedule", "schedule": {...}}` when the schedule is complete For more information on getting started with LangGraph Server, [see here](https://langchain-ai.github.io/langgraph/tutorials/langgraph-platform/local-server/). ## How to customize 1. **Define runtime context**: Modify the `Context` class in the `graph.py` file to expose the arguments you want to configure per assistant. For example, in a chatbot application you may want to define a dynamic system prompt or LLM to use. For more information on runtime context in LangGraph, [see here](https://langchain-ai.github.io/langgraph/agents/context/?h=context#static-runtime-context). 2. **Extend the graph**: The core logic of the application is defined in [graph.py](./src/agent/graph.py). You can modify this file to add new nodes, edges, or change the flow of information. ## Development While iterating on your graph in LangGraph Studio, you can edit past state and rerun your app from previous states to debug specific nodes. Local changes will be automatically applied via hot reload. Follow-up requests extend the same thread. You can create an entirely new thread, clearing previous history, using the `+` button in the top right. For more advanced features and examples, refer to the [LangGraph documentation](https://langchain-ai.github.io/langgraph/). These resources can help you adapt this template for your specific use case and build more sophisticated conversational agents. LangGraph Studio also integrates with [LangSmith](https://smith.langchain.com/) for more in-depth tracing and collaboration with teammates, allowing you to analyze and optimize your chatbot's performance.