{"id":30799304,"url":"https://github.com/provos/planai","last_synced_at":"2026-03-11T20:01:33.698Z","repository":{"id":255435879,"uuid":"847818605","full_name":"provos/planai","owner":"provos","description":"PlanAI: A graph-based framework for complex task automation integrating traditional compute and LLM capabilities","archived":false,"fork":false,"pushed_at":"2026-02-13T03:09:01.000Z","size":2443,"stargazers_count":41,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-13T11:50:17.659Z","etag":null,"topics":["ai","automation","graph-based","llm","python","task-management","workflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/provos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-26T15:52:29.000Z","updated_at":"2026-02-13T03:09:04.000Z","dependencies_parsed_at":"2024-08-30T11:31:04.406Z","dependency_job_id":"0f0b4270-c632-4e6e-aced-00a75d85306a","html_url":"https://github.com/provos/planai","commit_stats":null,"previous_names":["provos/planai"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/provos/planai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provos%2Fplanai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provos%2Fplanai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provos%2Fplanai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provos%2Fplanai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/provos","download_url":"https://codeload.github.com/provos/planai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/provos%2Fplanai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30398163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T18:46:22.935Z","status":"ssl_error","status_checked_at":"2026-03-11T18:46:17.045Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","automation","graph-based","llm","python","task-management","workflow"],"created_at":"2025-09-05T19:11:05.648Z","updated_at":"2026-03-11T20:01:33.680Z","avatar_url":"https://github.com/provos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlanAI\n\n[![PyPI version](https://badge.fury.io/py/planai.svg)](https://badge.fury.io/py/planai)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Python Versions](https://img.shields.io/pypi/pyversions/planai.svg)](https://pypi.org/project/planai/)\n[![Documentation Status](https://readthedocs.org/projects/planai/badge/?version=latest)](https://docs.getplanai.com/en/latest/?badge=latest)\n[![codecov](https://codecov.io/gh/provos/planai/graph/badge.svg?token=7RU082HEPN)](https://codecov.io/gh/provos/planai)\n\n**PlanAI** is an innovative system designed for complex task automation through a sophisticated graph-based architecture. It integrates traditional computations and cutting-edge AI technologies to enable versatile and efficient workflow management.\n\n## Table of Contents\n- [Key Features](#key-features)\n- [PlanAIEditor](#planaieditor)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Example: Textbook Q\u0026A Generation](#example-textbook-qa-generation)\n- [Example: Deep Research](#example-deep-research)\n- [Monitoring Dashboard](#monitoring-dashboard)\n- [Advanced Features](#advanced-features)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Key Features\n\n- **Graph-Based Architecture**: Construct dynamic workflows comprising interconnected TaskWorkers for highly customizable automation.\n- **Hybrid TaskWorkers**: Combine conventional computations (e.g., API calls) with powerful LLM-driven operations, leveraging Retrieval-Augmented Generation (RAG) capabilities.\n- **Type Safety with Pydantic**: Ensure data integrity and type consistency across workflows with Pydantic-validated input and output.\n- **Intelligent Data Routing**: Utilize type-aware routing to efficiently manage data flow between nodes, adapting to multiple downstream consumers.\n- **Input Provenance Tracking**: Trace the lineage and origin of each Task as it flows through the workflow, enabling detailed analysis and debugging of complex processes.\n- **Automatic Prompt Optimization**: Improve your LLM prompts using data and AI-driven optimization\n\n## PlanAIEditor\n\nPlanAIEditor is a graphical user interface (GUI) for visually building and managing AI workflows using the PlanAI framework. It provides a node-based interface built with Svelte 5 and svelte-flow, allowing users to:\n\n- Visually construct PlanAI graphs by creating and connecting Task, TaskWorker, LLMTaskWorker, and JoinedTaskWorker nodes\n- Configure the properties of each node\n- Export the designed graph into a Python module compatible with PlanAI\n- Import existing PlanAI Python modules into the visual editor for modification\n- Execute a PlanAI graph within the UI and see its output\n\nThe editor is available as a separate package and can be installed via pip:\n```bash\npip install planaieditor\n```\n\nFor more information about PlanAIEditor, visit [https://github.com/provos/planaieditor](https://github.com/provos/planaieditor).\n\n## Requirements\n\n- Python 3.10+\n- Poetry (for development)\n\n## Installation\n\nYou can install PlanAI using pip:\n\n```bash\npip install planai\n```\n\nFor development, clone the repository and install dependencies:\n\n```bash\ngit clone https://github.com/provos/planai.git\ncd planai\npoetry install\n```\n\n## Usage\n\nPlanAI allows you to create complex, AI-enhanced workflows using a graph-based architecture. Here's a basic example:\n\n```python\nfrom planai import Graph, TaskWorker, Task, LLMTaskWorker, llm_from_config\n\n# Define custom TaskWorkers\nclass CustomDataProcessor(TaskWorker):\n    output_types: List[Type[Task]] = [ProcessedData]\n\n    def consume_work(self, task: RawData):\n        processed_data = self.process(task.data)\n        self.publish_work(ProcessedData(data=processed_data), input_task=task)\n\n# Define an LLM-powered task\nclass AIAnalyzer(LLMTaskWorker):\n    prompt: str =\"Analyze the provided data and derive insights\"\n    llm_input_type: Type[Task] = ProcessedData\n    output_types: List[Type[Task]] = [AnalysisResult]\n\n\n# Create and run the workflow\ngraph = Graph(name=\"Data Analysis Workflow\")\ndata_processor = CustomDataProcessor()\nai_analyzer = AIAnalyzer(\n   llm=llm_from_config(provider=\"openai\", model_name=\"gpt-4\"))\n\ngraph.add_workers(data_processor, ai_analyzer)\ngraph.set_dependency(data_processor, ai_analyzer)\n\ninitial_data = RawData(data=\"Some raw data\")\ngraph.run(initial_tasks=[(data_processor, initial_data)])\n```\n\n## Example: Textbook Q\u0026A Generation\n\nPlanAI has been used to create a system for generating high-quality question and answer pairs from textbook content. This example demonstrates PlanAI's capability to manage complex, multi-step workflows involving AI-powered text processing and content generation. The application processes textbook content through a series of steps including text cleaning, relevance filtering, question generation and evaluation, and answer generation and selection. For a detailed walkthrough of this example, including code and explanation, please see the [examples/textbook](examples/textbook) directory. The resulting dataset, generated from \"World History Since 1500: An Open and Free Textbook,\" is available in our [World History 1500 Q\u0026A repository](https://github.com/provos/world-history-1500-qa), showcasing the practical application of PlanAI in educational content processing and dataset creation.\n\n## Example: Deep Research\nA Deep Research tech demo built on top of PlanAI that allows in-depth research using public web sources. It can run locally using Ollama leading to better privacy than cloud\nservices.\n\nTo try DeepSearch, save the following configuration as ```docker-compose.yml``` and run ```docker-compose up```:\n```yml\nservices:\n  deepsearch:\n    image: nielsprovos/deepsearch-container:latest\n    ports:\n      - \"3000:3000\"\n      - \"5050:5050\"\n      - \"8080:8080\"\n    extra_hosts:\n      - \"host.docker.internal:host-gateway\"\n```\n\nOnce started, open [http://localhost:3000](http://localhost:3000) in your browser.\n\n## Monitoring Dashboard\n\nPlanAI includes a built-in web-based monitoring dashboard that provides real-time insights into your graph execution. This feature can be enabled by setting `run_dashboard=True` when calling the `graph.run()` method.\n\nKey features of the monitoring dashboard:\n\n- **Real-time Updates**: The dashboard uses server-sent events (SSE) to provide live updates on task statuses without requiring page refreshes.\n- **Task Categories**: Tasks are organized into three categories: Queued, Active, and Completed, allowing for easy tracking of workflow progress.\n- **Detailed Task Information**: Each task displays its ID, type, and assigned worker. Users can click on a task to view additional details such as provenance and input provenance.\n\nTo enable the dashboard:\n\n```python\ngraph.run(initial_tasks, run_dashboard=True)\n```\n\nWhen enabled, the dashboard will be accessible at `http://localhost:5000` by default. The application will continue running until manually terminated, allowing for ongoing monitoring of long-running workflows.\n\nNote: Enabling the dashboard will block the main thread, so it's recommended for development and debugging purposes. For production use, consider implementing a separate monitoring solution.\n\n## Advanced Features\n\nPlanAI supports advanced features like:\n\n- Caching results with `CachedTaskWorker`\n- Joining multiple task results with `JoinedTaskWorker`\n- Integrating with various LLM providers (OpenAI, Ollama, etc.)\n- Function calling for supported models\n- **Automatic Prompt Optimization**: Improve your LLMTaskWorker prompts using AI-driven optimization. [Learn more](PROMPT_OPTIMIZATION.md)\n\n\nFor more detailed examples and advanced usage, please refer to the `examples/` directory in the repository.\n\n## Documentation\n\nFull documentation for PlanAI is available at [https://docs.getplanai.com/](https://docs.getplanai.com/)\n\n## Contributing\n\nWe welcome contributions to PlanAI! Please see our [Contributing Guide](CONTRIBUTING.md) for more details on how to get started.\n\n## Licensing\n\nThe PlanAI framework is licensed under the **Apache License 2.0**. See the [LICENSE](LICENSE) file for the full license text.\n\n**Example Applications:**\n\nThe `examples/` directory contains standalone applications that demonstrate the use of the PlanAI framework. These applications have their own independent licenses:\n\n*   `examples/deepsearch`: Licensed under **CC BY-NC-SA 4.0** ([LICENSE](examples/deepsearch/LICENSE))\n*   `examples/social`, `examples/textbook` and `examples/releasenotes`: Licensed under **Apache License 2.0** ([LICENSE](LICENSE))\n\n**Understanding the Licensing Structure:**\n\n*   The PlanAI framework (Apache 2.0) can be used in both commercial and non-commercial applications, can be modified, and can be distributed, providing significant flexibility for developers.\n*   Example applications are independent implementations that use PlanAI as a dependency.\n*   Each example application's license applies only to that specific implementation and does not affect the core framework.\n*   You can create your own applications using PlanAI under any license compatible with Apache 2.0.\n\nFor any questions or support, please open an issue on our [GitHub issue tracker](https://github.com/provos/planai/issues).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprovos%2Fplanai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprovos%2Fplanai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprovos%2Fplanai/lists"}