PraisonAI is a framework and SDK for building AI agents and teams that research, generate code or content, analyze data, support users, and automate workflows. Developers use it to create autonomous task-running agents with memory, retrieval-augmented generation, and support for many language models.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/MervinPraison/PraisonAIWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/mervinpraison/praisonai/windsurfrules)<a href="https://agentmods.dev/rules/mervinpraison/praisonai/windsurfrules"><img src="https://agentmods.dev/badge/rules/mervinpraison/praisonai/windsurfrules.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04722 | $0.04722 |
| Opus 5 | $0.02361 | $0.02361 |
| Sonnet 5 | $0.00944 | $0.00944 |
| Haiku 4.5 | $0.00472 | $0.00472 |
Grade A, and why
windsurfrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 360 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Below is an example TypeScript/Node.js folder structure replicating the Python package's layout. Each subfolder matches the Python counterpart (agent, agents, knowledge, etc.). All "LLM" or "litellm" references are replaced by aisdk usage.
Feel free to rename or restructure to suit your project's Node.js conventions.
Folder Structure
praisonai-ts/
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts
│ ├── main.ts
│ ├── agent/
│ │ └── agent.ts
│ ├── agents/
│ │ ├── agents.ts
│ │ └── autoagents.ts
│ ├── knowledge/
│ │ ├── chunking.ts
│ │ └── knowledge.ts
│ ├── llm/
│ │ └── llm.ts
│ ├── memory/
│ │ └── memory.ts
│ ├── process/
│ │ └── process.ts
│ ├── task/
│ │ └── task.ts
│ └── tools/
│ ├── README.md
│ ├── index.ts
│ ├── test.ts
│ ├── arxivTools.ts
│ ├── calculatorTools.ts
│ ├── csvTools.ts
│ ├── duckdbTools.ts
│ ├── duckduckgoTools.ts
│ ├── excelTools.ts
│ ├── fileTools.ts
│ ├── jsonTools.ts
│ ├── newspaperTools.ts
│ ├── pandasTools.ts
│ ├── pythonTools.ts
│ ├── shellTools.ts
│ ├── spiderTools.ts
│ ├── tools.ts
│ ├── wikipediaTools.ts
│ ├── xmlTools.ts
│ ├── yamlTools.ts
│ └── yfinanceTools.ts
└── ...
Below is a high-level table describing the main files/folders, the classes or functions inside them, their parameters, and return values.
| File / Folder | Contents | Functions / Classes | Parameters | Return | Purpose |
|---|---|---|---|---|---|
| src/index.ts | Main entry point that re-exports key classes/functions | - Typically re-exports Agent, Agents, Task, etc. |
- | - | Provides a simple import path for consumers. |
| src/main.ts | Equivalent of main.py, sets up logging, callbacks, registers display callbacks, and integrates with aisdk if needed |
- registerDisplayCallback(type: string, callbackFn, isAsync: boolean): void- executeCallback(type: string, ...args): Promise<void>- displayInteraction(...), displayError(...), etc. - Possibly some global logs array or error logs. |
Depending on the function, e.g. registerDisplayCallback → (type, fn, isAsync) |
Varies by function type. Typically void or Promise<void> |
Central place for logging and "display callbacks," mirroring the Python approach (prints, error logs, etc.). Uses or references aisdk for generating text if needed. |
| src/agent/agent.ts | Contains Agent class, mirroring agent.py. Handles single-agent logic, possible references to LLM calls via aisdk. |
- class Agent - constructor(name: string, role: string, goal: string, ...) - chat(...): main method for handling "chat" or LLM calls - achat(...): async method, if needed |
constructor: (name, role, goal, tools, ... ) etc. chat: (prompt: string, ...) achat: (prompt: string, ...) |
Promise<string> or string for the chat methods. |
Encapsulates a single agent's role, name, and the methods for calling the LLM using aisdk. Also may manage context, tools, roles, etc. |
| src/agents/agents.ts | Contains PraisonAIAgents (like agents.py). Manages multiple agents, tasks, memory, process type, etc. |
- class PraisonAIAgents - constructor(agents: Agent[], tasks?: Task[], ...) - addTask(task: Task): number - executeTask(taskId: number): TaskOutput - runTask(taskId: number): void - runAllTasks(): void - start(...): starts them all - getTaskResult(...) |
The constructor takes arrays of Agent, optional tasks, manager config, memory config, etc. Other methods take Task IDs. |
Most methods return void, or a Promise<void>, or a custom object. |
Coordinates multiple agents and tasks in a "manager" style. The top-level orchestrator for tasks and agent interactions. |
| src/agents/autoagents.ts | The AutoAgents class, an advanced manager that can auto-create tasks/agents from instructions. Uses aisdk to parse config. |
- class AutoAgents extends PraisonAIAgents - constructor(instructions: string, tools?: any[], ...) - _generateConfig(...) - _createAgentsAndTasks(...) - start(): overrides the parent to handle auto generation - etc. |
Takes user instructions, tools, config (like memory usage, manager LLM, etc.). | Typically Promise<object> or void for the start() method. |
High-level convenience for automatically generating agent/task configuration from user instructions. |
| src/knowledge/chunking.ts | Chunking class for text chunking. Similar logic to the Python version. |
- class Chunking - constructor(chunkerType: string, ... ) - `chunk(text: string |
string[], addContext: boolean, contextParams: any): Chunk[]<br/> - Possibly _get_overlap_refinery(...)`, etc. |
Similar to Python (chunkerType, chunkSize, etc.). | Returns an array of chunked text or objects describing the chunk. |
| src/knowledge/knowledge.ts | Knowledge class for storing & retrieving data from memory, chunking, vector DB, etc. |
- class Knowledge - constructor(config: any, verbose?: number) - store(content: string, userId?: string, ...): any - search(query: string, ...): any - deleteAll(...): etc. |
Takes a config object for local or external DB. Methods get or store docs, do RAG searching, etc. | Return types typically objects or arrays. | Central interface to handle knowledge storage, chunking, retrieval, e.g. vector store, RAG. |
| src/llm/llm.ts | LLM class referencing aisdk instead of litellm. Basic usage of generateText or streamText. |
- class LLM - constructor(options: { model: string, apiKey?: string, ... }) - response(prompt: string, ...): Promise<string> (calls aisdk.generateText) - possibly streamResponse(...) if needed |
model, prompt, temperature, ... |
Promise<string> for final text. |
The bridging layer between your code and aisdk, so Agent can call LLM.response(...). |
| src/memory/memory.ts | Memory class for short-term or long-term memory references, entity memory, user memory, etc. |
- class Memory - constructor(config: MemoryConfig, verbose?: number) - storeShortTerm(...), storeLongTerm(...), searchShortTerm(...), etc. - buildContextForTask(...) |
Varies, e.g. (text: string, metadata?: any) |
Typically void or some object referencing stored docs. |
Takes a config describing how/where memory is stored: local DB, RAG, or aisdk embeddings. |
| src/process/process.ts | Process class that handles sequential or workflow processes between tasks. |
- class Process - constructor(tasks: Map<number, Task>, agents: Agent[], ... ) - sequential(), workflow(), hierarchical(), etc. |
Receives tasks, agents, process type. | Returns an iterator or array describing the next tasks to run. | Logic for ordering tasks in "sequential", "hierarchical", or "workflow" modes. |
| src/task/task.ts | Task class for describing a single piece of work, the agent assigned, context, etc. |
- class Task - constructor(description: string, expectedOutput?: string, ... ) - executeCallback(taskOutput: TaskOutput), storeInMemory(...), etc. |
The constructor has many options: (description, expectedOutput, agent, tools, ...). |
Methods return void, or custom objects. |
Encapsulates a single unit of work, references an agent, has optional callback, memory usage, etc. |
| src/tools/README.md | Short README describing how to write "tools" in JS/TS. | - | - | - | Provides docs for tool developers. |
| src/tools/index.ts | Entry point that re-exports tool functions (like internetSearch, getArxivPaper, etc.) |
- Possibly a map of functionName -> import - import * as calculatorTools from './calculatorTools', etc. |
- | - | Simplifies import of tools (e.g. import { getArticle } from "praisonai/tools"). |
| src/tools/test.ts | Script for running each tool's internal test or example. | - Typically a script that import ... from './someTool.ts' then tries them. |
- | - | Quick local tests. |
| src/tools/arxivTools.ts | Example "arxiv_tools.py" logic in TS. Searching arXiv, returning results. | - function searchArxiv(query: string, ...): Promise<any[]> - function getArxivPaper(id: string): Promise<any> etc. |
(query, maxResults=10, ... ) |
Promise<ArxivPaper[]> or something like that. |
Tools for searching and retrieving from arXiv. |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 360 lines · 4,722 tokens per session scan A 21888aa34134
windsurfrules is a cursor rule published in the GitHub repository MervinPraison/PraisonAI (9,028 stars, last pushed today), licensed MIT. It adds 4,722 tokens to every session, about $0.0236 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-06.
Other cursor rules, from other repositories
llamaindex-js
Definitive guidelines for writing robust, performant, and maintainable llamaindex-js applications using modern TypeScript best practices.
rules.general
A project rule set for a Next.js application using TypeScript, React, Tailwind CSS, shadcn/ui, Radix UI, and Lucide icons.
igniter-patterns
This guide provides a COMPLETE, ACCURATE, and MANDATORY reference for creating controllers and actions in Igniter.js. It incorporates established architectural patterns, coding best practices, and lessons learned from real-world implementations, ensuring strict adherence for all future development.
hatch3r-typescript-patterns
TypeScript and JavaScript typing mechanics — satisfies over as, discriminated unions, branded types, strict utility types, barrel exports, and import ordering.
google-genai-typescript
Comprehensive guide for integrating the Google Gen AI SDK (@google/genai) into TypeScript applications, covering installation, initialization, and core capabilities like content generation, streaming, function calling, and structured output.
naming-cheatsheet
Naming things is hard. This cheatsheet makes it easier. The codebase is primarily Python, so all examples use Python / PEP 8 conventions unless noted otherwise.