Compare commits

...
117 Commits
Author SHA1 Message Date
Mervin Praison 6d7cc9c3ba Release v2.3.2 2025-12-15 13:34:15 +00:00
Mervin Praison 690e4497cc feat: add --save support for direct prompts
- Save output to output/prompts/ folder with timestamped filename
- Works with all flags: --web-search, --expand-prompt, etc.

Usage:
  praisonai 'latest AI trends' --web-search --save
  praisonai 'write a poem' --expand-prompt --save
2025-12-15 13:33:28 +00:00
Mervin Praison 041f5f0b08 fix: add current date to PromptExpanderAgent for time-sensitive context
- Add datetime import and current_date to all expansion prompts
- Ensures expanded prompts reference the correct current date (e.g., December 15, 2025)
- Fixes issue where prompts defaulted to outdated year references
2025-12-15 13:26:13 +00:00
Mervin Praison bc0d9a6213 feat: add CLI flags for web-search, web-fetch, and prompt-caching
- Add --web-search flag for native web search (OpenAI, Gemini, Anthropic, xAI, Perplexity)
- Add --web-fetch flag for URL content retrieval (Anthropic only)
- Add --prompt-caching flag to reduce costs (OpenAI, Anthropic, Bedrock, Deepseek)
- Update README with CLI and programmatic usage examples

Usage:
  praisonai 'latest AI news' --web-search --llm openai/gpt-4o-search-preview
  praisonai 'summarize https://example.com' --web-fetch --llm anthropic/claude-sonnet-4-20250514
  praisonai 'analyze...' --prompt-caching --llm anthropic/claude-sonnet-4-20250514
2025-12-15 12:56:02 +00:00
Mervin Praison a4427fa135 Release v2.3.1 2025-12-15 12:45:22 +00:00
Mervin Praison 51e8c65c8c feat: refactor model capabilities to use LiteLLM helper functions
- Replace static model lists with LiteLLM's built-in capability checks (supports_response_schema, supports_function_calling, supports_parallel_function_calling, supports_web_search)
- Add supports_function_calling() and supports_parallel_function_calling() functions
- Keep static list for web_fetch (no LiteLLM helper available yet)
- Update documentation to reference LiteLLM as primary source
- Add Web Fetch feature to README features
2025-12-15 12:32:09 +00:00
Mervin Praison 285ed672c5 feat: add native web search and web fetch documentation to README
- Add Native Web Search section with supported providers (OpenAI, Anthropic, Gemini, xAI, Perplexity)
- Add Web Fetch section for Anthropic models with configuration options
- Add code examples for web_search and web_fetch parameters
- Document web_fetch options (max_uses, allowed_domains, citations)
2025-12-15 12:20:41 +00:00
Mervin Praison c03e51e337 feat: add native web fetch support for Anthropic Claude models
- Add web_fetch parameter to Agent and LLM classes
- Add model_capabilities.py with MODELS_SUPPORTING_WEB_FETCH list (Claude 3.5+, 4+)
- Add supports_web_fetch() function to check model capabilities
- Add web_fetch tool definition with configurable options (max_uses, allowed_domains, blocked_domains, citations, max_content_tokens)
- Add _model_supports_web_fetch() method to Agent class
- Add warning log for unsupported models when web_
2025-12-15 12:18:08 +00:00
Mervin Praison f3ba05f6aa feat: expand structured outputs support for OpenAI, Anthropic, and Gemini models
- Add comprehensive list of OpenAI models with structured outputs (gpt-4o-2024-08-06+, gpt-4.1+, gpt-5+, o-series)
- Add Anthropic Claude 4+ models with structured outputs support (Sonnet 4.5, Opus 4.1/4.5, Haiku 4.5)
- Add all Google Gemini models (2.5-pro, 2.5-flash, 2.0-flash, 1.5-pro/flash)
- Add auto-detection for newer model versions (gpt-4.1+, gpt-5+, o-series, Claude 4+, all Gemini)
- Add azure/ prefix support
2025-12-15 12:07:46 +00:00
Mervin Praison 9cea3edcd6 feat: add native web search support for OpenAI, Gemini, Anthropic, xAI, and Perplexity models
- Add web_search parameter to Agent and LLM classes
- Add model_capabilities.py with MODELS_SUPPORTING_WEB_SEARCH list
- Add supports_web_search() function to check model capabilities
- Add automatic DuckDuckGo fallback for unsupported models
- Add web_search_options to LiteLLM completion params
- Remove incompatible parameters (temperature, top_p, etc.) for web search models
- Update README with Native
2025-12-15 11:59:19 +00:00
Mervin Praison 02a3bd3597 chore: add uv cache clean before uv lock in release.py 2025-12-15 11:26:08 +00:00
Mervin Praison 128c77926d chore: add uv cache clean before uv lock in bump_and_release.py 2025-12-15 11:25:42 +00:00
Mervin Praison 3aa1b825e4 Release v2.3.0 2025-12-15 11:24:46 +00:00
Mervin Praison b4ee30d837 chore: bump praisonaiagents version to 0.0.170 2025-12-15 11:11:46 +00:00
Mervin Praison 825648aead docs: add PromptExpanderAgent to README 2025-12-15 11:11:04 +00:00
Mervin Praison 1532c31e72 feat: add PromptExpanderAgent for detailed prompt expansion
- Add PromptExpanderAgent class with expansion strategies (BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO)
- Add ExpandStrategy enum and ExpandResult dataclass
- Add CLI flags --expand-prompt and --expand-tools
- Add 20 unit tests for PromptExpanderAgent
- Export from praisonaiagents package

Usage:
  praisonai 'write a movie script' --expand-prompt
  praisonai 'AI blog' --expand-prompt --expand-tools tools.py
2025-12-15 11:09:25 +00:00
Mervin Praison b313fefd86 fix: QueryRewriterAgent preserves task intent instead of converting to questions 2025-12-15 10:57:53 +00:00
Mervin Praison 435e1afb55 test: add OPENAI_API_KEY environment variable to comprehensive test workflow and verify its presence 2025-12-15 10:47:29 +00:00
Mervin Praison 4cb3c0565a test: add skipif decorator for OPENAI_API_KEY check in CrewAI environment test 2025-12-15 10:42:00 +00:00
Mervin Praison a7634b66dc Release v2.2.99 2025-12-15 10:36:34 +00:00
Mervin Praison 3f0eaccbcb Release v2.2.98 2025-12-15 10:28:42 +00:00
Mervin Praison 47713d933a test: convert test assertions to pytest format and add TaskOutput descriptions
- Replace return True/False with pytest assertions in test_context_agent.py
- Add pytest.mark.skip decorators for unimplemented ContextAgent methods
- Add missing description parameter to TaskOutput instances in test_validation_feedback.py
2025-12-15 10:25:23 +00:00
Mervin Praison c82bfccd1d docs: add custom tools documentation with decorator, BaseTool class, and pip installable package examples 2025-12-15 10:20:11 +00:00
Mervin Praison ef7d1264e2 feat: add plugin system with tool registry and BaseTool support for external tool packages 2025-12-15 10:10:06 +00:00
Mervin Praison 2799304270 Release v2.2.97 2025-12-15 08:25:56 +00:00
Mervin Praison 4a85c135a6 Release v2.2.96 2025-12-15 07:57:25 +00:00
Mervin Praison cdb42a3f08 feat: add custom tools support to research command with file and built-in tool loading 2025-12-15 07:33:52 +00:00
Mervin Praison c8378118e7 docs: add query rewrite flag to research command and bump version to 2.2.94 2025-12-13 12:49:38 +00:00
Mervin Praison 0213764057 feat: add Query Rewriter Agent with multiple rewrite strategies and bump version to 0.0.166 2025-12-13 12:44:21 +00:00
Mervin Praison 2220114809 feat: add --save flag to research command for markdown output and bump version to 2.2.93 2025-12-13 11:58:36 +00:00
Mervin Praison 9fe4dbc172 chore: bump version to 2.2.92 and update praisonaiagents dependency to 0.0.165 2025-12-13 02:19:22 +00:00
Mervin Praison 180503fcd5 feat: add default research instructions to DeepResearchAgent and bump version to 0.0.165 2025-12-13 02:18:42 +00:00
Mervin Praison 0d8f936b19 chore: bump version to 2.2.91 and update praisonaiagents dependency to 0.0.164 2025-12-13 02:09:12 +00:00
Mervin Praison 8b53ebf5e3 docs: add Deep Research CLI documentation and bump version to 2.2.90 2025-12-13 01:44:52 +00:00
Mervin Praison 504c5a9759 chore: bump version to 2.2.89 and update praisonaiagents dependency to 0.0.163 2025-12-13 01:17:52 +00:00
Mervin Praison 8fef42fc03 feat: add Deep Research Agent support with OpenAI and Gemini integration 2025-12-13 01:15:07 +00:00
Mervin Praison 2f18cc1ea2 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-12-13 01:13:29 +00:00
Mervin Praison ff7969cdbf docs: rewrite README from MCP SSE implementation to comprehensive PraisonAI Agents documentation 2025-12-13 01:13:28 +00:00
Mervin Praison 5fa84dc3eb Merge pull request #1084 from Dhivya-Bharathy/feature/agentic-rag
feat: Add Agentic RAG Example to Cookbooks
2025-11-03 14:14:46 +00:00
Mervin Praison 4bf8b980ed Merge pull request #1085 from Dhivya-Bharathy/feat/agentic-rag-tools
feat: Add Agentic RAG Tools Implementation
2025-11-03 14:14:24 +00:00
Mervin Praison 53e0fd19ab feat: add async run support and example scripts for multi-turn conversations 2025-08-30 11:54:59 +01:00
Dhivya-Bharathy 0cb6307d3c Add agentic_rag_gpt5 example with GPT-5 integration 2025-08-29 13:11:08 +05:30
Dhivya adce94410b Add files via upload 2025-08-29 13:01:08 +05:30
Dhivya-Bharathy 42aec561b1 Add agentic RAG Python implementation to tools 2025-08-28 14:09:09 +05:30
Dhivya acc805768d Update PraisonAI_RecipeAgent.ipynb 2025-08-28 13:00:50 +05:30
Dhivya-Bharathy 6d9fa167e3 Add agentic_rag example to cookbooks 2025-08-28 06:43:41 +00:00
Mervin Praison 9e178b70e6 chore: bump PraisonAI to v2.2.88 and update dependencies across Dockerfiles and project files 2025-08-08 19:24:43 +01:00
Mervin Praison ed406973cd refactor: optimise ChatOpenAI instantiation by using a dictionary for parameters and enforce temperature for gpt-5 models 2025-08-08 19:17:45 +01:00
Mervin Praison f91918f4f6 chore: bump PraisonAI to v2.2.87, PraisonAI Agents to v0.0.161 and increase default temperature to 1.0 2025-08-08 13:44:29 +01:00
Mervin Praison ee21df9a6a chore: bump praisonai to v2.2.86 and praisonaiagents to v0.0.160 2025-08-08 12:18:30 +01:00
Mervin Praison c9159337fa refactor: replace all instances of gpt-5-mini with gpt-5-nano across codebase 2025-08-08 12:17:18 +01:00
Mervin Praison 2258685c32 chore: bump PraisonAI to v2.2.85 and PraisonAI Agents to v0.0.159 2025-08-08 08:20:25 +01:00
Mervin Praison 7210788135 refactor: replace gpt-4o model references with gpt-5-mini across codebase 2025-08-08 08:17:23 +01:00
Mervin Praison 3f58e3b1ad chore: bump PraisonAI to v2.2.84 and PraisonAI Agents to v0.0.158 across all files 2025-08-08 07:54:22 +01:00
Mervin Praison 561c32ddd5 refactor: update model name from gpt-4o-mini to gpt-5-nano across all files 2025-08-08 07:52:37 +01:00
Mervin Praison 79d934eec4 feat: bump praisonai to 2.2.83 and add xml-toolcall-agent implementation 2025-08-05 07:44:47 +01:00
Mervin Praison 144c7edc4a Merge pull request #1079 from MervinPraison/claude/issue-1077-20250805-0109
feat: make XML tool call parsing dynamic and configurable
2025-08-05 02:31:08 +01:00
Mervin Praison 4425e2b743 Merge branch 'main' of https://github.com/MervinPraison/PraisonAI 2025-08-05 02:28:00 +01:00
Mervin Praison eb8dfc02cd feat: optimize OpenAIClient with lazy loading and tool caching 2025-08-05 02:27:59 +01:00
github-actions[bot]andMervin Praison 27b6193b90 fix: improve XML tool call parsing robustness and type handling
- Fix type inconsistency in xml_tool_format handling (now supports True/''true''/''True'')
- Simplify _is_qwen_provider() by removing redundant logic
- Add proper XML parsing with ElementTree as primary method
- Improve regex fallback pattern for nested JSON in XML tags
- Add graceful error handling for malformed XML
- Import xml.etree.ElementTree at module level for better performance

Co-authored-by: Mervin Praison <[email protected]>
2025-08-05 01:26:48 +00:00
github-actions[bot]andMervin Praison b0aa9dfe58 feat: make XML tool call parsing dynamic and configurable
- Add xml_tool_format configuration parameter (auto/true/false)
- Replace static Qwen detection with dynamic _supports_xml_tool_format() method
- Add fallback XML detection for any model outputting <tool_call> tags
- Maintain backward compatibility with existing Qwen auto-detection
- Support manual XML format enabling for any model

Fixes #1077

Co-authored-by: Mervin Praison <[email protected]>
2025-08-05 01:13:22 +00:00
Mervin Praison 89d4f52327 Merge pull request #1075 from MervinPraison/claude/issue-1074-20250731-1148
fix: Fix RAG integration tests to respect lazy loading pattern
2025-07-31 13:05:47 +01:00
github-actions[bot]andMervin Praison da545f2e49 fix: Fix RAG integration tests to respect lazy loading pattern
- Fixed test_agent_with_knowledge_config and test_ollama_rag_integration
- Tests now properly check for lazy loading behavior instead of expecting immediate knowledge availability
- Verifies knowledge sources are stored and manually triggers processing before checking knowledge availability
- Preserves performance optimization of lazy loading while ensuring correct test behavior
- All RAG integration tests now pass (11/11)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-31 11:53:01 +00:00
Mervin Praison e794992d7b feat: optimize LLM performance with caching and lazy loading 2025-07-31 12:39:37 +01:00
Mervin Praison a958162704 perf: optimize agent performance with lazy loading and caching strategies 2025-07-31 12:19:17 +01:00
Mervin Praison 3b47f7be7f chore: update MongoDB connection strings from localhost to remote cluster 2025-07-31 07:59:51 +01:00
Mervin Praison 0b8da8b4c4 Merge pull request #1072 from MervinPraison/claude/issue-1071-20250729-0039
fix: resolve MongoDB SearchIndexModel missing definition argument
2025-07-29 08:07:23 +01:00
github-actions[bot]andMervinPraison 092ea67732 fix: apply SearchIndexModel compatibility fix to memory.py and mongodb_tools.py
Extends the PyMongo 4.6+ compatibility fix from knowledge.py to other files
that also use create_search_index(). Applies the same backward-compatible
pattern using SearchIndexModel with graceful fallback for older PyMongo versions.

- memory.py: Fix _create_vector_search_indexes() method
- mongodb_tools.py: Fix create_vector_index() method

Maintains zero performance overhead and full backward compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: MervinPraison <[email protected]>
2025-07-29 00:54:57 +00:00
github-actions[bot]andMervin Praison 5931ad00be fix: resolve MongoDB SearchIndexModel missing definition argument
- Import SearchIndexModel from pymongo.operations for PyMongo 4.6+ compatibility
- Use SearchIndexModel with definition parameter in _create_vector_index()
- Add backward compatibility fallback for older PyMongo versions
- Maintains zero performance overhead and preserves existing functionality

Fixes #1071

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-29 00:44:36 +00:00
Mervin Praison b7676cf6c3 update github actions 2025-07-29 01:38:33 +01:00
Mervin Praison 8ec4f5efa2 Merge pull request #1070 from MervinPraison/claude/issue-1069-20250728-2326
fix: resolve MongoDB vector search index creation error (missing embedding_model_name)
2025-07-29 01:33:58 +01:00
github-actions[bot]andMervin Praison f459c192d6 fix: initialize embedding model before MongoDB to resolve missing embedding_model_name attribute
Fixed initialization order in MongoDBMemory class where _create_vector_index()
was trying to access self.embedding_model_name before it was initialized.

- Moved _init_embedding_model() before _init_mongodb() in __init__
- Added explanatory comment for the dependency order
- Resolves AttributeError: ''MongoDBMemory'' object has no attribute ''embedding_model_name''
- Maintains full backward compatibility

Fixes #1069

Co-authored-by: Mervin Praison <[email protected]>
2025-07-28 23:31:01 +00:00
Mervin Praison 18b85aada0 chore: bump package versions and reorganize test files 2025-07-28 18:43:53 +01:00
Mervin Praison a3c77692fd Merge pull request #1068 from MervinPraison/claude/aiohttp-session-fix-v2
fix: comprehensive aiohttp session cleanup to resolve persistent warnings
2025-07-28 18:31:47 +01:00
github-actions[bot]andMervin Praison 4a06ee3626 perf: eliminate blocking timeout in close() method to restore zero-overhead cleanup
- Remove blocking future.result(timeout=2.0) that could block execution
- Restore non-blocking behavior with callback-based fallback cleanup
- Maintain reliability with async cleanup + force cleanup fallback
- Ensure zero performance impact on normal execution paths

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 20:05:52 +00:00
Mervin Praison 776e83100e Merge pull request #1067 from MervinPraison/claude/fix-token-tracking-metrics-20250726
fix: enable token tracking by passing metrics parameter from Agent to LLM
2025-07-26 21:00:43 +01:00
github-actions[bot]andMervin Praison f718d89ba4 test: add verification test for performance optimization
- Confirms zero method calls when metrics=False
- Verifies method still called when metrics=True
- Demonstrates performance benefit of optimization

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:40:17 +00:00
github-actions[bot]andMervin Praison 3469335d02 perf: optimize token tracking to eliminate overhead when metrics disabled
- Move metrics check to call sites instead of inside _track_token_usage()
- Eliminates function call overhead when metrics=False (default)
- Add performance test to verify zero overhead implementation
- Maintains full functionality when metrics=True

Performance impact:
- metrics=False (default): zero function call overhead
- metrics=True: unchanged functionality

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:39:46 +00:00
Mervin Praison 929a6e733d chore: bump praisonai to v2.2.79 and praisonaiagents to v0.0.153 across all files 2025-07-26 20:38:11 +01:00
github-actions[bot]andMervin Praison 6caa825706 fix: comprehensive aiohttp session cleanup in MCP HTTP client
- Add global client registry with weakref tracking for reliable cleanup
- Implement multi-layer cleanup strategy: immediate, force, finalizer, and exit
- Add atexit handler to ensure session cleanup on program termination
- Implement direct connector closing for emergency cleanup scenarios
- Maintain zero performance impact with non-blocking operations
- Fix persistent ''Unclosed client session'' warnings in praisonaiagents

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:38:03 +00:00
Mervin Praison 4baf6288ed Merge pull request #1066 from MervinPraison/claude/issue-1065-20250726-1904
fix: properly close aiohttp sessions in MCP HTTP stream transport
2025-07-26 20:33:27 +01:00
github-actions[bot]andMervin Praison 65a23df7a2 fix: enable token tracking by passing metrics parameter from Agent to LLM
Fixes the persistent issue where Agent(metrics=True) showed 0 tokens
despite the LLM instance access fix in PR #1064.

Root Cause:
- Agent.metrics=True was stored but never passed to LLM constructor
- LLM class had token tracking capability but no way to enable it
- Token collector received no data because LLM didn''t track tokens

Solution:
- Pass metrics=self.metrics to all 4 LLM constructor calls in agent.py
- Add self.metrics property to LLM class from extra_settings
- Only track tokens when self.metrics=True in _track_token_usage()

Verified:
- All LLM creation patterns (string, dict, provider/model) work
- Agent(metrics=True) properly enables LLM token tracking
- Zero performance impact when metrics=False (default)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:25:50 +00:00
github-actions[bot]andMervin Praison ea0cb8b59a perf: optimize aiohttp session cleanup to eliminate execution overhead
- Remove flawed weakref finalizer that couldn''t run async code properly
- Make synchronous close() non-blocking to prevent 5-second delays
- Simplify __del__ methods to reduce garbage collection overhead
- Focus cleanup on proper async context manager usage
- Maintain backward compatibility while eliminating performance impact

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:23:09 +00:00
Mervin Praison d0d2e60618 feat: add API key validation and improved error handling for Tavily search integration 2025-07-26 20:21:34 +01:00
Mervin Praison 8eca3359cf Merge pull request #1064 from MervinPraison/claude/pr-1063-20250726-1818
fix: resolve zero token metrics by fixing agent LLM instance access
2025-07-26 20:17:56 +01:00
github-actions[bot]andMervin Praison 41272ddd24 fix: properly close aiohttp sessions in MCP HTTP stream transport
- Add weakref.finalize for reliable session cleanup during garbage collection
- Add explicit close() and aclose() methods for manual resource cleanup
- Add __del__ methods with proper error handling for both HTTPStreamTransport and HTTPStreamMCPClient
- Add double-close protection to prevent cleanup errors
- Preserve backward compatibility - no API changes, only additions

Fixes #1065

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:11:35 +00:00
Mervin Praison 47d8e54fa5 feat: add token tracking and langtrace integration modules with demo scripts 2025-07-26 20:09:18 +01:00
github-actions[bot]andMervin Praison 0d42787a86 perf: eliminate redundant getattr calls in token metrics collection
- Remove duplicate llm variable definitions in aexecute_task and execute_task
- Reuse existing llm variable instead of redefining with getattr calls
- Reduces function call overhead without changing functionality
- Addresses code duplication identified in PR review

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 19:08:58 +00:00
Mervin Praison 99a4b84e6a Merge pull request #1062 from MervinPraison/claude/issue-1059-20250726-1321
perf: optimize telemetry performance with thread pools and queue-based processing
2025-07-26 19:57:49 +01:00
github-actions[bot]andMervin Praison 1b70e295b4 feat: enable PostHog telemetry by default with actual event posting
- Change default behavior from performance_mode=True to performance_mode=False
- PostHog events are now actually posted by default instead of zero overhead mode
- Add PRAISONAI_PERFORMANCE_MODE=true environment variable for minimal overhead
- Create comprehensive PERFORMANCE_IMPACT.md documentation
- Performance impact: ~0.5-1.5ms per operation with async, non-blocking PostHog calls
- Memory overhead: +756KB one-time PostHog client initialization
- Maintains full backward compatibility with existing disable options

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 18:46:25 +00:00
github-actions[bot]andMervin Praison abc8d63b75 feat: enable PostHog telemetry by default with minimal performance impact
- Enable PostHog by default using performance_mode=True for zero overhead
- Add granular environment variable controls:
  - PRAISONAI_DISABLE_TELEMETRY=true (disable completely)
  - PRAISONAI_FULL_TELEMETRY=true (enable detailed tracking)
  - DO_NOT_TRACK=true (respects privacy standard)
- Maintain backward compatibility with existing disable flags
- Performance impact: <0.05ms overhead in default mode
- Preserves existing PRAISONAI_AUTO_INSTRUMENT behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 18:29:22 +00:00
github-actions[bot]andMervin Praison 10e58e033a fix: resolve zero token metrics by fixing agent LLM instance access
- Fixed 4 locations in agents.py where token tracking failed due to incorrect attribute access
- Use getattr pattern to check both ''llm'' and ''llm_instance'' attributes on agents
- Ensures proper agent name attribution for token tracking
- Zero performance impact - maintains existing execution flow
- Fixes issue where agents.run() with metrics=True showed 0 tokens

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 18:28:30 +00:00
Mervin Praison e36feed53e Merge pull request #1061 from MervinPraison/claude/performance-monitoring-disabled-by-default-20250726-1324
feat: make performance monitoring disabled by default
2025-07-26 15:22:42 +01:00
github-actions[bot]andMervin Praison f01b3f4251 optimize: achieve true zero overhead when performance monitoring is disabled
Key optimizations implemented:
- Extract environment checking into shared cached function
- Make PostHog imports lazy to eliminate import overhead
- Optimize constructors for immediate exit when disabled
- Reduce code duplication from 4x to single implementation
- Add caching for environment variable checks

Performance improvements:
- Zero PostHog import overhead when disabled
- ~50% reduction in constructor overhead via fast-path
- Eliminates repeated environment variable lookups
- Reduces memory footprint when monitoring disabled

All telemetry modules now achieve true zero overhead when
performance monitoring is disabled by default.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:21:56 +00:00
github-actions[bot]andMervin Praison e2ca69327c fix: critical performance issues - ensure zero overhead for existing users
### Critical Fixes Applied:

1. **Remove Auto-Instrumentation Overhead** (__init__.py)
   - Auto-instrumentation now opt-in only via PRAISONAI_AUTO_INSTRUMENT=true
   - Prevents telemetry overhead being added to ALL existing users by default
   - Ensures zero performance impact for existing code paths

2. **Fix NameError Bug** (integration.py:22)
   - Move _performance_mode_enabled definition before function definitions
   - Fixes enable_performance_mode() and disable_performance_mode() functions
   - Resolves critical runtime error identified by Cursor bot

3. **Enhanced Error Handling** (integration.py:82-86, 123-127)
   - Replace silent exception handling with structured logging
   - Use logging.debug() for non-disruptive debugging support
   - Maintains application stability while enabling troubleshooting

4. **Implement Performance Context Manager** (integration.py:129-142)
   - Complete previously incomplete _performance_mode_context() function
   - Provides temporary performance mode switching capability
   - Removes dead code identified in review

5. **Configurable Resource Cleanup** (integration.py:600-610)
   - Make shutdown timeout configurable via PRAISONAI_TELEMETRY_SHUTDOWN_TIMEOUT
   - Enhanced error logging for resource cleanup issues
   - Improves reliability across different deployment environments

### Performance Guarantee:
✅ Zero overhead for existing users (no auto-instrumentation)
✅ Telemetry is now truly opt-in only
✅ All existing APIs work identically
✅ No breaking changes to function signatures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:20:17 +00:00
Mervin Praison cc8994f19c Merge pull request #1063 from MervinPraison/claude/issue-1060-20250726-1321
fix: add run() method alias to PraisonAIAgents for consistent API
2025-07-26 15:18:43 +01:00
github-actions[bot]andMervin Praison 89277d14c4 clean: remove test files from repository
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:17:29 +00:00
github-actions[bot]andMervin Praison 9513173837 fix: remove redundant run() alias to prevent code duplication
- Remove line 1535 that created redundant run = start alias
- Keep proper run() method implementation with correct parameter handling
- Maintain full backward compatibility
- Zero performance overhead

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 14:17:18 +00:00
Mervin Praison 5b83af82db Merge branch 'main' into claude/issue-1059-20250726-1321 2025-07-26 15:12:51 +01:00
github-actions[bot]andMervin Praison 0539c337ab perf: optimize telemetry performance with thread pools and queue-based processing
- Replace per-call thread creation with shared ThreadPoolExecutor (2 workers)
- Implement queue-based batch processing for telemetry events
- Add performance_mode parameter for zero-overhead operation in critical scenarios
- Add non-blocking event queuing with overflow protection (drops events vs blocking)
- Use async PostHog mode by default in batch processing
- Add resource cleanup functions for proper shutdown
- Maintain 100% backward compatibility with existing APIs

Performance benefits:
- ~90% reduction in thread creation overhead under load
- Eliminates blocking on network calls during normal operation
- Memory-bounded telemetry storage prevents resource leaks
- Graceful degradation under high load
- Zero impact when performance_mode=True

Fixes #1059

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:29:41 +00:00
github-actions[bot]andMervin Praison c6977cf541 feat: make performance monitoring disabled by default
- NEW BEHAVIOR: Performance monitoring now DISABLED BY DEFAULT
- Requires explicit opt-in via PRAISONAI_PERFORMANCE_ENABLED=true
- Maintains backward compatibility with legacy disable flags
- Zero performance overhead when disabled (unchanged)

Environment Variables:
- PRAISONAI_PERFORMANCE_ENABLED=true (new: enables monitoring)
- PRAISONAI_TELEMETRY_ENABLED=true (new: enables telemetry)
- Legacy disable flags still work for backward compatibility

Files updated:
- telemetry.py: Modified _is_monitoring_disabled() logic
- performance_monitor.py: Updated fallback logic
- performance_utils.py: Updated fallback logic
- integration.py: Updated fallback logic
- README.md: Updated documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:27:33 +00:00
github-actions[bot]andMervin Praison b0e9eec33b fix: add run() method alias to PraisonAIAgents for consistent API
- Add run() method to PraisonAIAgents that delegates to start()
- Ensures token metrics display works when users call agents.run()
- Provides API consistency with Agent class which already has run() alias
- Fixes issue where metrics=True wasn''t showing token usage summary
- Backward compatible change, no existing functionality affected

Fixes #1060

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:27:20 +00:00
Mervin Praison 2cb61ce529 Merge pull request #1058 from MervinPraison/claude/issue-1057-20250726-1242
fix: reduce monitoring overhead with performance optimizations
2025-07-26 14:22:17 +01:00
github-actions[bot]andMervin Praison 4055c9c983 fix: resolve critical performance monitoring bugs and ensure zero overhead
Critical fixes:
- Fixed ThreadPoolExecutor.shutdown() invalid timeout parameter (telemetry.py:396)
- Added consistent disable checks in get_function_performance() and get_api_call_performance()
- Fixed thread safety issue by creating copy instead of modifying input data
- Extracted environment variable checking to shared utility function
- Ensured true zero overhead when PRAISONAI_PERFORMANCE_DISABLED=true

Performance guarantees:
✅ Zero overhead when monitoring disabled - decorators return original functions
✅ No impact on existing feature execution speed - early exits prevent processing
✅ Backward compatibility maintained - all existing APIs preserved
✅ Thread safety improved - no input parameter modification

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 13:20:37 +00:00
github-actions[bot]andClaude 376b4d95f1 feat: reduce monitoring overhead with performance optimizations
- Add PRAISONAI_PERFORMANCE_DISABLED environment variable to disable all performance monitoring overhead
- Make expensive flow analysis opt-in only via PRAISONAI_FLOW_ANALYSIS_ENABLED
- Add export_metrics_for_external_apm() method for DataDog/New Relic integration
- Function decorators return original functions when disabled (zero overhead)
- Maintain full backward compatibility with existing monitoring features

Addresses performance overhead issues by allowing users to completely disable
monitoring when not needed, while providing lightweight external APM export
for production monitoring without expensive flow analysis operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-26 12:54:06 +00:00
github-actions[bot]andClaude 2ae47e4208 optimize: reduce telemetry monitoring overhead for production use
Address performance bottlenecks identified in issue #1057:

1. **Early exit optimizations**: Add environment variable checks at the start of
   instrumentation functions to avoid all overhead when telemetry is disabled

2. **Thread pool optimization**: Replace individual thread creation with a
   reusable ThreadPoolExecutor to reduce thread creation overhead (5-10ms per call)

3. **Flow analysis optimization**: Limit analysis to 1000 most recent events
   instead of processing up to 10,000 events to avoid O(n²) complexity

4. **Performance monitoring controls**: Add PRAISONAI_PERFORMANCE_DISABLED
   environment variable to disable performance monitoring separately from telemetry

5. **No-op optimizations**: Make monitoring decorators and context managers
   return unmodified functions/no-op when disabled to eliminate runtime overhead

Key changes:
- Zero instrumentation overhead when DO_NOT_TRACK=true or PRAISONAI_TELEMETRY_DISABLED=true
- Thread pool reuse reduces background thread creation by 90%
- Flow analysis processes max 1000 events instead of unlimited
- Maintains full backward compatibility
- No impact on existing functionality when telemetry is enabled

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-07-26 12:50:10 +00:00
Mervin Praison 6b2814eb26 Merge pull request #1056 from MervinPraison/claude/simplified-metrics-20250726
feat: Simplify token metrics to Agent(metrics=True)
2025-07-26 13:19:15 +01:00
github-actions[bot]andMervin Praison 852765412a fix: clean up debug files and improve exception handling
- Remove temporary debugging scripts (check_*.py, test_*.py)
- Improve exception handling in metrics display with specific error types
- Fix unused variable in cost estimation example
- Maintain zero performance overhead for existing features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 12:15:19 +00:00
github-actions[bot]andMervin Praison b4db6421f7 feat: Simplify token metrics to Agent(metrics=True)
- Add metrics parameter to Agent class with auto-display capability
- Fix missing run() method in PraisonAIAgents (add alias to start)
- Auto-display token usage when any agent has metrics=True
- Simplify all examples to use single parameter approach
- Maintain zero performance impact with O(1) operations
- Keep backward compatibility with existing methods

BREAKING: Massively simplified API - just Agent(metrics=True)!

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 12:00:54 +00:00
Mervin Praison 22ecf6963f Merge pull request #1055 from MervinPraison/claude/issue-1054-20250725-1714
feat: Add comprehensive token metrics tracking for PraisonAI agents
2025-07-26 08:32:11 +01:00
github-actions[bot]andMervin Praison 5cea1f5702 feat: add comprehensive token metrics usage examples
Add 5 detailed examples demonstrating token tracking features:
- Basic token tracking for simple workflows
- Session metrics across multiple agents
- Cost estimation and budget management
- Telemetry integration for enterprise monitoring
- Advanced agent integration with real-time analysis

Each example includes documentation and best practices
for production usage. Examples are self-contained and
demonstrate zero-performance-impact implementation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 07:24:17 +00:00
Mervin Praison 36d7a2b489 feat: add performance impact check requirement to GitHub workflow comments 2025-07-26 08:17:46 +01:00
github-actions[bot]andMervin Praison 2c9ae32e13 fix: add missing token tracking call and provider metadata
- Add missing token tracking call after reasoning response (line 957)
- Add provider metadata to token tracking as per original requirements
- Ensures all LLM completion calls are properly tracked

Co-authored-by: Mervin Praison <[email protected]>
2025-07-26 06:38:39 +00:00
github-actions[bot]andMervin Praison d2d7fab0e0 feat: add comprehensive token metrics tracking system
- Add TokenMetrics dataclass for tracking individual interactions
- Add SessionTokenMetrics for aggregated session data
- Add TokenCollector for thread-safe global collection
- Add TokenTelemetryBridge for existing telemetry integration
- Integrate token tracking into LLM responses
- Add token_metrics field to TaskOutput class
- Add agent name setting for proper token attribution
- Add token usage methods to PraisonAIAgents class
- Maintain backward compatibility with graceful fallbacks
- Keep core application performance unchanged
- Support all token types: input/output/cached/reasoning/audio

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Mervin Praison <[email protected]>
2025-07-25 17:23:07 +00:00
Mervin Praison f4ef434610 fix: reset interaction_displayed flag to ensure final summary is shown in LLM responses 2025-07-25 18:09:39 +01:00
Mervin Praison d63b437eca feat: add workflow visualization with FlowDisplay and bump version to 2.2.77 2025-07-25 12:05:41 +01:00
Mervin Praison 04aac1c2d5 fix: skip display output for empty Gemini responses and bump version to 0.0.150 2025-07-25 09:51:56 +01:00
416 changed files with 17387 additions and 1369 deletions

No files matched your search

+1 -1
View File
@@ -22,5 +22,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude review this issue and do a detailed analysis and fix this if the existing code doesn\'t have the solution implemented. Making sure it has backward compatibility, no existing features removed. After making those changes, again review the applied changes. Use @web to search if you dont know any information or to find the latest documentation or to find the latest version. Run the code if you think you need to run it to test it. Minimal code change to start with if required any changes. **Please create a PR using gh tool with your changes**.'
body: '@claude review this issue and do a detailed analysis and fix this if the existing code doesn\'t have the solution implemented. Making sure it has backward compatibility, no existing features removed. After making those changes, again review the applied changes. Use @web to search if you dont know any information or to find the latest documentation or to find the latest version. Run the code if you think you need to run it to test it. Minimal code change to start with if required any changes. MAINLY IT SHOULD NOT IMPACT ON THE CURRENT SPEED OF EXECUTION of existing features, not increasing the overhead. **Please create a PR using gh tool with your changes**.'
})
+1 -1
View File
@@ -19,5 +19,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude review this pull request and do a detailed analysis and fix this if the existing code doesn\'t have the solution implemented. Making sure it has backward compatibility, no existing features removed. After making those changes, again review the applied changes. Use @web to search if you dont know any information or to find the latest documentation or to find the latest version. Run the code if you think you need to run it to test it. Minimal code change to start with if required any changes.'
body: '@claude review this pull request and do a detailed analysis and fix this if the existing code doesn\'t have the solution implemented. Making sure it has backward compatibility, no existing features removed. After making those changes, again review the applied changes. Use @web to search if you dont know any information or to find the latest documentation or to find the latest version. Run the code if you think you need to run it to test it. Minimal code change to start with if required any changes. MAINLY IT SHOULD NOT IMPACT ON THE CURRENT SPEED OF EXECUTION of existing features, not increasing the overhead.'
})
+4 -5
View File
@@ -12,13 +12,12 @@ on:
jobs:
claude-response:
# Prevent bots from triggering this action
# Prevent certain bots from triggering this action (but allow github-actions[bot] for auto-comments)
if: |
github.actor != 'dependabot[bot]' &&
github.actor != 'github-actions[bot]' &&
github.actor != 'cursor[bot]' &&
!contains(github.actor, '[bot]') &&
github.actor != 'renovate[bot]'
github.actor != 'renovate[bot]' &&
!(contains(github.actor, '[bot]') && github.actor != 'github-actions[bot]')
runs-on: ubuntu-latest
permissions:
contents: write
@@ -154,7 +153,7 @@ jobs:
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: '@claude review if the changes made in the above branch are as per the requirements and make changes to the above branch if issues still exist.'
body: '@claude review if the changes made in the above branch are as per the requirements and make changes to the above branch if issues still exist. MAINLY IT SHOULD NOT IMPACT ON THE CURRENT SPEED OF EXECUTION of existing features, not increasing the overhead.'
});
} else {
console.log(`Skipping review comment for regular issue #${issueNumber}`);
+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
+1 -1
View File
@@ -29,7 +29,7 @@ jobs:
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
- name: Install dependencies
+9 -4
View File
@@ -27,6 +27,9 @@ jobs:
comprehensive-test:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL_NAME: gpt-4o-mini
strategy:
matrix:
python-version: ["3.11"]
@@ -55,11 +58,13 @@ jobs:
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
- name: Set environment variables
- name: Verify environment variables
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
if [ -n "$OPENAI_API_KEY" ]; then
echo "✅ OPENAI_API_KEY is set (length: ${#OPENAI_API_KEY})"
else
echo "⚠️ OPENAI_API_KEY is NOT set"
fi
- name: Run Comprehensive Test Suite
run: |
+7 -7
View File
@@ -34,7 +34,7 @@ jobs:
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
uv pip install --system pytest pytest-asyncio pytest-cov
uv pip install --system pytest pytest-asyncio pytest-cov pytest-timeout
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
@@ -42,13 +42,13 @@ jobs:
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
# Also export to current shell session for immediate availability
export OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}"
export OPENAI_API_BASE="${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}"
export OPENAI_MODEL_NAME="${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}"
export OPENAI_MODEL_NAME="${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}"
export LOGLEVEL=DEBUG
# Verify immediate availability
echo "🔧 Immediate verification in same step:"
@@ -126,7 +126,7 @@ jobs:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}
OPENAI_MODEL_NAME: ${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}
OPENAI_MODEL_NAME: ${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}
LOGLEVEL: DEBUG
run: |
echo "🔍 Testing PraisonAI API key usage directly..."
@@ -166,7 +166,7 @@ jobs:
print('\\n🧪 Testing PraisonAIModel with explicit API key (CrewAI method):')
model_with_explicit_key = PraisonAIModel(
model='openai/gpt-4o-mini',
model='openai/gpt-5-nano',
base_url=praisonai.config_list[0].get('base_url'),
api_key=api_key_from_config # This will be a string from praisonai.config_list
)
@@ -251,7 +251,7 @@ jobs:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}
OPENAI_MODEL_NAME: ${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}
OPENAI_MODEL_NAME: ${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}
LOGLEVEL: DEBUG
run: |
echo "🧪 Running legacy tests with real API key..."
@@ -262,7 +262,7 @@ jobs:
export OPENAI_API_KEY="$OPENAI_API_KEY"
export OPENAI_API_BASE="$OPENAI_API_BASE"
export OPENAI_MODEL_NAME="$OPENAI_MODEL_NAME"
cd src/praisonai && python -m pytest tests/test.py -v --tb=short --disable-warnings
cd src/praisonai && python -m pytest tests/test.py -v --tb=short --disable-warnings -m "not real" --timeout=60
- name: Upload coverage reports to Codecov
if: matrix.python-version == '3.11'
+1 -1
View File
@@ -42,7 +42,7 @@ jobs:
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
echo "PRAISONAI_TELEMETRY_DISABLED=true" >> $GITHUB_ENV
echo "PRAISONAI_DISABLE_TELEMETRY=true" >> $GITHUB_ENV
+1 -1
View File
@@ -56,7 +56,7 @@ jobs:
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
- name: Test ${{ matrix.framework }} Framework
run: |
+5 -5
View File
@@ -27,7 +27,7 @@ jobs:
cd src/praisonai
uv pip install --system ."[ui,gradio,api,agentops,google,openai,anthropic,cohere,chat,code,realtime,call,crewai,autogen]"
uv pip install --system duckduckgo_search
uv pip install --system pytest pytest-asyncio pytest-cov
uv pip install --system pytest pytest-asyncio pytest-cov pytest-timeout
# Install knowledge dependencies from praisonai-agents
uv pip install --system "praisonaiagents[knowledge]"
@@ -35,7 +35,7 @@ jobs:
run: |
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY || 'sk-test-key-for-github-actions-testing-only-not-real' }}" >> $GITHUB_ENV
echo "OPENAI_API_BASE=${{ secrets.OPENAI_API_BASE || 'https://api.openai.com/v1' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-4o-mini' }}" >> $GITHUB_ENV
echo "OPENAI_MODEL_NAME=${{ secrets.OPENAI_MODEL_NAME || 'gpt-5-nano' }}" >> $GITHUB_ENV
echo "LOGLEVEL=DEBUG" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/src/praisonai-agents:$PYTHONPATH" >> $GITHUB_ENV
@@ -316,8 +316,8 @@ jobs:
try:
from praisonai.inc.models import PraisonAIModel
# Test PraisonAIModel with openai/gpt-4o-mini (from YAML)
model = PraisonAIModel(model='openai/gpt-4o-mini')
# Test PraisonAIModel with openai/gpt-5-nano (from YAML)
model = PraisonAIModel(model='openai/gpt-5-nano')
print('🤖 PraisonAIModel Configuration:')
print(f' model: {model.model}')
@@ -489,7 +489,7 @@ jobs:
- name: Run Legacy Example Tests
run: |
cd src/praisonai && python -m pytest tests/test.py -v --tb=short --disable-warnings
cd src/praisonai && python -m pytest tests/test.py -v --tb=short --disable-warnings -m "not real" --timeout=60
continue-on-error: true
- name: Upload coverage reports to Codecov
+302
View File
@@ -53,6 +53,11 @@ PraisonAI is a production-ready Multi-AI Agents framework with self-reflection,
- 🛠️ 100+ Custom Tools
- 📄 YAML Configuration
- 💯 100+ LLM Support
- 🔬 **Deep Research Agents** (OpenAI & Gemini)
- 🔄 **Query Rewriter Agent** (HyDE, Step-back, Multi-query)
- 🌐 **Native Web Search** (OpenAI, Gemini, Anthropic, xAI, Perplexity)
- 📥 **Web Fetch** (Retrieve full content from URLs - Anthropic)
- 💾 **Prompt Caching** (Reduce costs & latency - OpenAI, Anthropic, Bedrock, Deepseek)
## Using Python Code
@@ -96,6 +101,79 @@ Run:
python app.py
```
### 3. Deep Research Agent
Automated research with real-time streaming, web search, and citations using OpenAI or Gemini Deep Research APIs.
```python
from praisonaiagents import DeepResearchAgent
# OpenAI Deep Research
agent = DeepResearchAgent(
model="o4-mini-deep-research", # or "o3-deep-research"
verbose=True
)
result = agent.research("What are the latest AI trends in 2025?")
print(result.report)
print(f"Citations: {len(result.citations)}")
```
```python
# Gemini Deep Research
from praisonaiagents import DeepResearchAgent
agent = DeepResearchAgent(
model="deep-research-pro", # Auto-detected as Gemini
verbose=True
)
result = agent.research("Research quantum computing advances")
print(result.report)
```
**Features:**
- 🔍 Multi-provider support (OpenAI, Gemini, LiteLLM)
- 📡 Real-time streaming with reasoning summaries
- 📚 Structured citations with URLs
- 🛠️ Built-in tools: web search, code interpreter, MCP, file search
- 🔄 Automatic provider detection from model name
### 4. Query Rewriter Agent
Transform user queries to improve RAG retrieval quality using multiple strategies.
```python
from praisonaiagents import QueryRewriterAgent, RewriteStrategy
agent = QueryRewriterAgent(model="gpt-4o-mini")
# Basic - expands abbreviations, adds context
result = agent.rewrite("AI trends")
print(result.primary_query) # "What are the current trends in Artificial Intelligence?"
# HyDE - generates hypothetical document for semantic matching
result = agent.rewrite("What is quantum computing?", strategy=RewriteStrategy.HYDE)
# Step-back - generates broader context question
result = agent.rewrite("GPT-4 vs Claude 3?", strategy=RewriteStrategy.STEP_BACK)
# Sub-queries - decomposes complex questions
result = agent.rewrite("RAG setup and best embedding models?", strategy=RewriteStrategy.SUB_QUERIES)
# Contextual - resolves references using chat history
result = agent.rewrite("What about cost?", chat_history=[...])
```
**Strategies:**
- **BASIC**: Expand abbreviations, fix typos, add context
- **HYDE**: Generate hypothetical document for semantic matching
- **STEP_BACK**: Generate higher-level concept questions
- **SUB_QUERIES**: Decompose multi-part questions
- **MULTI_QUERY**: Generate multiple paraphrased versions
- **CONTEXTUAL**: Resolve references using conversation history
- **AUTO**: Automatically detect best strategy
## Using No Code
### Auto Mode:
@@ -105,6 +183,51 @@ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
praisonai --auto create a movie script about Robots in Mars
```
### Query Rewriting (works with any command):
```bash
# Rewrite query for better results (uses QueryRewriterAgent)
praisonai "AI trends" --query-rewrite
# Rewrite with search tools (agent decides when to search)
praisonai "latest developments" --query-rewrite --rewrite-tools "internet_search"
# Works with any prompt
praisonai "explain quantum computing" --query-rewrite -v
```
### Deep Research CLI:
```bash
# Default: OpenAI (o4-mini-deep-research)
praisonai research "What are the latest AI trends in 2025?"
# Use Gemini
praisonai research --model deep-research-pro "Your research query"
# Rewrite query before research
praisonai research --query-rewrite "AI trends"
# Rewrite with search tools
praisonai research --query-rewrite --rewrite-tools "internet_search" "AI trends"
# Use custom tools from file (gathers context before deep research)
praisonai research --tools tools.py "Your research query"
praisonai research -t my_tools.py "Your research query"
# Use built-in tools by name (comma-separated)
praisonai research --tools "internet_search,wiki_search" "Your query"
praisonai research -t "yfinance,calculator_tools" "Stock analysis query"
# Save output to file (output/research/{query}.md)
praisonai research --save "Your research query"
praisonai research -s "Your research query"
# Combine options
praisonai research --query-rewrite --tools tools.py --save "Your research query"
# Verbose mode (show debug logs)
praisonai research -v "Your research query"
```
## Using JavaScript Code
```bash
@@ -523,6 +646,172 @@ praisonai agents.yaml
</a>
</div>
## Custom Tools
### Using `@tool` Decorator
```python
from praisonaiagents import Agent, tool
@tool
def search(query: str) -> str:
"""Search the web for information."""
return f"Results for: {query}"
@tool
def calculate(expression: str) -> float:
"""Evaluate a math expression."""
return eval(expression)
agent = Agent(
instructions="You are a helpful assistant",
tools=[search, calculate]
)
agent.start("Search for AI news and calculate 15*4")
```
### Using `BaseTool` Class
```python
from praisonaiagents import Agent, BaseTool
class WeatherTool(BaseTool):
name = "weather"
description = "Get current weather for a location"
def run(self, location: str) -> str:
return f"Weather in {location}: 72°F, Sunny"
agent = Agent(
instructions="You are a weather assistant",
tools=[WeatherTool()]
)
agent.start("What's the weather in Paris?")
```
### Creating a Tool Package (pip installable)
```toml
# pyproject.toml
[project]
name = "my-praisonai-tools"
version = "1.0.0"
dependencies = ["praisonaiagents"]
[project.entry-points."praisonaiagents.tools"]
my_tool = "my_package:MyTool"
```
```python
# my_package/__init__.py
from praisonaiagents import BaseTool
class MyTool(BaseTool):
name = "my_tool"
description = "My custom tool"
def run(self, param: str) -> str:
return f"Result: {param}"
```
After `pip install`, tools are auto-discovered:
```python
agent = Agent(tools=["my_tool"]) # Works automatically!
```
## Prompt Expansion
Expand short prompts into detailed, actionable prompts:
### CLI Usage
```bash
# Expand a short prompt into detailed prompt
praisonai "write a movie script in 3 lines" --expand-prompt
# With verbose output
praisonai "blog about AI" --expand-prompt -v
# With tools for context gathering
praisonai "latest AI trends" --expand-prompt --expand-tools tools.py
# Combine with query rewrite
praisonai "AI news" --query-rewrite --expand-prompt
```
### Programmatic Usage
```python
from praisonaiagents import PromptExpanderAgent, ExpandStrategy
# Basic usage
agent = PromptExpanderAgent()
result = agent.expand("write a movie script in 3 lines")
print(result.expanded_prompt)
# With specific strategy
result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
# Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO
```
**Key Difference:**
- `--query-rewrite`: Optimizes queries for **search/retrieval** (RAG)
- `--expand-prompt`: Expands prompts for **detailed task execution**
## Web Search, Web Fetch & Prompt Caching
### CLI Usage
```bash
# Web Search - Get real-time information
praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview
# Web Fetch - Retrieve and analyze URL content (Anthropic only)
praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
# Prompt Caching - Reduce costs for repeated prompts
praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514
```
### Programmatic Usage
```python
from praisonaiagents import Agent
# Web Search
agent = Agent(
instructions="You are a research assistant",
llm="openai/gpt-4o-search-preview",
web_search=True
)
# Web Fetch (Anthropic only)
agent = Agent(
instructions="You are a content analyzer",
llm="anthropic/claude-sonnet-4-20250514",
web_fetch=True
)
# Prompt Caching
agent = Agent(
instructions="You are an AI assistant..." * 50, # Long system prompt
llm="anthropic/claude-sonnet-4-20250514",
prompt_caching=True
)
```
**Supported Providers:**
| Feature | Providers |
|---------|-----------|
| Web Search | OpenAI, Gemini, Anthropic, xAI, Perplexity |
| Web Fetch | Anthropic |
| Prompt Caching | OpenAI (auto), Anthropic, Bedrock, Deepseek |
## Development:
Below is used for development only.
@@ -540,6 +829,19 @@ uv pip install -r pyproject.toml --extra code
uv pip install -r pyproject.toml --extra "crewai,autogen"
```
### Bump and Release
```bash
# From project root - bumps version and releases in one command
python src/praisonai/scripts/bump_and_release.py 2.2.99
# With praisonaiagents dependency
python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169
# Then publish
cd src/praisonai && uv publish
```
## Contributing
- Fork on GitHub: Use the "Fork" button on the repository page.
+1 -1
View File
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
flask \
"praisonai>=2.2.76" \
"praisonai>=2.3.2" \
"praisonai[api]" \
gunicorn \
markdown
+1 -1
View File
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=2.2.76" \
"praisonai>=2.3.2" \
"praisonai[chat]" \
"embedchain[github,youtube]"
+1 -1
View File
@@ -20,7 +20,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=2.2.76" \
"praisonai>=2.3.2" \
"praisonai[ui]" \
"praisonai[chat]" \
"praisonai[realtime]" \
+1 -1
View File
@@ -16,7 +16,7 @@ RUN mkdir -p /root/.praison
# Install Python packages (using latest versions)
RUN pip install --no-cache-dir \
praisonai_tools \
"praisonai>=2.2.76" \
"praisonai>=2.3.2" \
"praisonai[ui]" \
"praisonai[crewai]"
+2 -2
View File
@@ -121,7 +121,7 @@ healthcheck:
## 📦 Package Versions
All Docker images use consistent, up-to-date versions:
- PraisonAI: `>=2.2.76`
- PraisonAI: `>=2.2.95`
- PraisonAI Agents: `>=0.0.92`
- Python: `3.11-slim`
@@ -218,7 +218,7 @@ docker-compose up -d
### Version Pinning
To use specific versions, update the Dockerfile:
```dockerfile
RUN pip install "praisonai==2.2.76" "praisonaiagents==0.0.92"
RUN pip install "praisonai==2.2.95" "praisonaiagents==0.0.92"
```
## 🌐 Production Deployment
@@ -26,14 +26,14 @@
"\n",
"### ✨ Key Benefits:\n",
"- 🚀 **Scalable & Customizable** – Industry-agnostic design \n",
"- 💰 **Cost-Effective** – Runs on GPT-4o-mini \n",
"- 💰 **Cost-Effective** – Runs on gpt-5-nano \n",
"- 🛠️ **Production-Ready** – Realistic automation framework \n",
"- 🔄 **Complete Pipeline** – End-to-end flow\n",
"\n",
"---\n",
"\n",
"### 🔧 Technologies:\n",
"**PraisonAI** • **OpenAI GPT-4o-mini** • **Python** • **SQLite** \n",
"**PraisonAI** • **OpenAI gpt-5-nano** • **Python** • **SQLite** \n",
"**Multi-Agent Architecture**\n",
"\n",
"---\n",
@@ -100,7 +100,7 @@
"text": [
"📦 Dependencies installed!\n",
"🔄 Using PraisonAI Multi-Agent Framework\n",
"🤖 Powered by OpenAI GPT-4o-mini\n"
"🤖 Powered by OpenAI gpt-5-nano\n"
]
}
],
@@ -116,7 +116,7 @@
"\n",
"print(\"📦 Dependencies installed!\")\n",
"print(\"🔄 Using PraisonAI Multi-Agent Framework\")\n",
"print(\"🤖 Powered by OpenAI GPT-4o-mini\")"
"print(\"🤖 Powered by OpenAI gpt-5-nano\")"
]
},
{
@@ -5102,7 +5102,7 @@
"\n",
"🎊 BLENDER PRODUCTION STUDIO COMPLETE!\n",
"🎬 17-Agent AI System Successfully Executed\n",
"🤖 Powered by PraisonAI + OpenAI GPT-4o-mini\n"
"🤖 Powered by PraisonAI + OpenAI gpt-5-nano\n"
]
}
],
@@ -5149,7 +5149,7 @@
"\n",
"print(\"\\n🎊 BLENDER PRODUCTION STUDIO COMPLETE!\")\n",
"print(\"🎬 17-Agent AI System Successfully Executed\")\n",
"print(\"🤖 Powered by PraisonAI + OpenAI GPT-4o-mini\")"
"print(\"🤖 Powered by PraisonAI + OpenAI gpt-5-nano\")"
]
}
],
@@ -182,7 +182,7 @@
" ]\n",
" for turn in range(max_turns):\n",
" response = client.chat.completions.create(\n",
" model=\"gpt-4o-mini\",\n",
" model=\"gpt-5-nano\",\n",
" messages=history,\n",
" max_tokens=500\n",
" )\n",
@@ -2642,7 +2642,7 @@
"\n",
"\ud83c\udf8a SEMANTIC NETWORK ANALYSIS COMPLETE!\n",
"\ud83c\udf10 Cross-platform profile discovery and analysis\n",
"\ud83e\udd16 Powered by PraisonAI + OpenAI GPT-4o-mini\n"
"\ud83e\udd16 Powered by PraisonAI + OpenAI gpt-5-nano\n"
]
}
],
@@ -2687,7 +2687,7 @@
"\n",
"print(\"\\n\ud83c\udf8a SEMANTIC NETWORK ANALYSIS COMPLETE!\")\n",
"print(\"\ud83c\udf10 Cross-platform profile discovery and analysis\")\n",
"print(\"\ud83e\udd16 Powered by PraisonAI + OpenAI GPT-4o-mini\")"
"print(\"\ud83e\udd16 Powered by PraisonAI + OpenAI gpt-5-nano\")"
]
},
{
@@ -1262,7 +1262,7 @@
"\n",
"🎊 AI SHOPPING ASSISTANT ACTIVE!\n",
"🛒 Ready to help customers with natural language shopping\n",
"🤖 Powered by PraisonAI + OpenAI GPT-4o-mini\n"
"🤖 Powered by PraisonAI + OpenAI gpt-5-nano\n"
]
}
],
@@ -1305,7 +1305,7 @@
"\n",
"print(\"\\n🎊 AI SHOPPING ASSISTANT ACTIVE!\")\n",
"print(\"🛒 Ready to help customers with natural language shopping\")\n",
"print(\"🤖 Powered by PraisonAI + OpenAI GPT-4o-mini\")"
"print(\"🤖 Powered by PraisonAI + OpenAI gpt-5-nano\")"
]
},
{
@@ -156,7 +156,7 @@
" - Property comparison\n",
" - Cost of living and taxes\n",
" - First-time homebuyer guidance\n",
"llm: gpt-4o\n",
"llm: gpt-5-nano\n",
"verbosity: true\n",
"format: markdown\n",
"\"\"\"\n"
@@ -188,7 +188,7 @@
"Help users evaluate neighborhoods, estimate mortgage payments, compare homes, and understand homeownership costs.\n",
"Explain clearly, format in markdown, and be friendly but professional.\n",
"\"\"\",\n",
" llm=\"gpt-4o\",\n",
" llm=\"gpt-5-nano\",\n",
" verbose=True,\n",
" markdown=True\n",
")\n"
@@ -311,7 +311,7 @@
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You are an expert health advisor using the GPT-4o Mini model. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You are an expert health advisor using the gpt-5-nano Mini model. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"background-color: #272822\"> </span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"background-color: #272822\"> </span><span style=\"color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822\">Based on the following air quality conditions in Mumbai, Maharashtra, India:</span><span style=\"background-color: #272822\"> </span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
@@ -340,7 +340,7 @@
],
"text/plain": [
"\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
"\u001b[36m│\u001b[0m You are an expert health advisor using the GPT-4o Mini model. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m You are an expert health advisor using the gpt-5-nano Mini model. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[48;2;39;40;34m \u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mBased on the following air quality conditions in Mumbai, Maharashtra, India:\u001b[0m\u001b[48;2;39;40;34m \u001b[0m\u001b[48;2;39;40;34m \u001b[0m \u001b[36m│\u001b[0m\n",
@@ -519,7 +519,7 @@
" aqi_data = aqi_data.data # Convert to dict\n",
"\n",
" prompt = f\"\"\"\n",
" You are an expert health advisor using the GPT-4o Mini model.\n",
" You are an expert health advisor using the gpt-5-nano Mini model.\n",
"\n",
" Based on the following air quality conditions in {user_city}, {user_state}, {user_country}:\n",
" - Overall AQI: {aqi_data.get('aqi', 'N/A')}\n",
@@ -193,7 +193,7 @@
" goal=\"Evaluate hackathon projects through video demonstrations\",\n",
" backstory=\"\"\"You are an expert hackathon judge. You give fair scores and detailed feedback\n",
" on technical complexity, innovation, presentation, and UX.\"\"\",\n",
" llm=\"gpt-4o-mini\",\n",
" llm=\"gpt-5-nano\",\n",
" self_reflect=False\n",
")"
],
@@ -65,7 +65,7 @@
"source": [
"from llama_index.llms.openai import OpenAI\n",
"\n",
"llm = OpenAI(model=\"gpt-4o-mini\", api_key=\"Enter your api key here\") # Replace with your OpenAI API key\n"
"llm = OpenAI(model=\"gpt-5-nano\", api_key=\"Enter your api key here\") # Replace with your OpenAI API key\n"
]
},
{
@@ -129,7 +129,7 @@
"judge = Agent(\n",
" name=\"Judge\",\n",
" role=\"Preside over court proceedings\",\n",
" llm=\"gpt-4o-mini\",\n",
" llm=\"gpt-5-nano\",\n",
" instructions=[\n",
" \"You are an impartial judge\",\n",
" \"Make fair decisions based on evidence\",\n",
@@ -142,7 +142,7 @@
"prosecutor = Agent(\n",
" name=\"Prosecutor\",\n",
" role=\"Present case against defendant\",\n",
" llm=\"gpt-4o-mini\",\n",
" llm=\"gpt-5-nano\",\n",
" instructions=[\n",
" \"You are a prosecutor seeking conviction\",\n",
" \"Present evidence methodically\",\n",
@@ -155,7 +155,7 @@
"defense = Agent(\n",
" name=\"Defense\",\n",
" role=\"Defend the accused\",\n",
" llm=\"gpt-4o-mini\",\n",
" llm=\"gpt-5-nano\",\n",
" instructions=[\n",
" \"You are a defense attorney\",\n",
" \"Create reasonable doubt\",\n",
@@ -168,7 +168,7 @@
"witness = Agent(\n",
" name=\"Witness\",\n",
" role=\"Provide testimony\",\n",
" llm=\"gpt-4o-mini\",\n",
" llm=\"gpt-5-nano\",\n",
" instructions=[\n",
" \"You are a witness testifying\",\n",
" \"Provide factual testimony\",\n",
@@ -76,7 +76,7 @@
"output_type": "stream",
"text": [
"✅ API key configured!\n",
"✅ Using model: gpt-4o-mini\n"
"✅ Using model: gpt-5-nano\n"
]
}
],
@@ -85,7 +85,7 @@
"openai_key = \"sk-..\"\n",
"\n",
"os.environ[\"OPENAI_API_KEY\"] = openai_key\n",
"model_choice = \"gpt-4o-mini\"\n",
"model_choice = \"gpt-5-nano\"\n",
"\n",
"print(\"✅ API key configured!\")\n",
"print(f\"✅ Using model: {model_choice}\")"
@@ -336,7 +336,7 @@
"\n",
"temperature: 0.3\n",
"max_tokens: 4000\n",
"model: \"gpt-4o-mini\"\n",
"model: \"gpt-5-nano\"\n",
"\"\"\"\n",
"\n",
"print(\"✅ YAML Prompt configured!\")"
@@ -8,7 +8,7 @@
"source": [
"# 🤖 Add AI Documentation Processor: Multi-Agent Content Analysis & Code Generation System\n",
"\n",
"This PR adds a comprehensive AI-powered documentation processing system using PraisonAI and OpenAI GPT-4o-mini. Features 3 specialized agents for content analysis, code generation, and example creation, perfect for automated documentation processing and code generation workflows.\n",
"This PR adds a comprehensive AI-powered documentation processing system using PraisonAI and OpenAI gpt-5-nano. Features 3 specialized agents for content analysis, code generation, and example creation, perfect for automated documentation processing and code generation workflows.\n",
"\n",
"**Key Features:** Multi-agent document analysis, automated code generation, usage example creation, content validation, and scalable processing workflows for various document formats."
]
@@ -152,7 +152,7 @@
" - Evaluate risk factors\n",
" - Identify scams or red flags\n",
" - Summarize project fundamentals\n",
"llm: gpt-4o\n",
"llm: gpt-5-nano\n",
"verbosity: true\n",
"format: markdown\n",
"\"\"\"\n"
@@ -184,7 +184,7 @@
"and market trends. Provide critical insight into legitimacy, potential growth, and associated risks.\n",
"Use markdown formatting and structure your research clearly.\n",
"\"\"\",\n",
" llm=\"gpt-4o\",\n",
" llm=\"gpt-5-nano\",\n",
" verbose=True,\n",
" markdown=True\n",
")\n"
@@ -491,7 +491,7 @@
"\n",
"temperature: 0.7\n",
"max_tokens: 3000\n",
"model: \"gpt-4o-mini\"\n",
"model: \"gpt-5-nano\"\n",
"\"\"\"\n",
"\n",
"print(\"✅ YAML Prompt configured!\")"
@@ -627,7 +627,7 @@
" )\n",
" else: # OpenAI\n",
" llm = ChatOpenAI(\n",
" model=\"gpt-4o\",\n",
" model=\"gpt-5-nano\",\n",
" api_key=api_key,\n",
" temperature=0.0\n",
" )\n",
@@ -120,7 +120,7 @@
"\n",
" def run(self, message: str):\n",
" response = client.chat.completions.create(\n",
" model=\"gpt-4o-mini\",\n",
" model=\"gpt-5-nano\",\n",
" messages=[\n",
" {\"role\": \"system\", \"content\": self.prompt},\n",
" {\"role\": \"user\", \"content\": message}\n",
@@ -153,7 +153,7 @@
" - Spot content patterns and trends\n",
" - Recommend growth strategies\n",
" - Detect potential monetization methods\n",
"llm: gpt-4o\n",
"llm: gpt-5-nano\n",
"verbosity: true\n",
"format: markdown\n",
"\"\"\"\n"
@@ -184,7 +184,7 @@
"You are a YouTube intelligence analyst. Your job is to research a specific channel, niche, or influencer topic.\n",
"Provide growth recommendations, engagement analysis, trending strategies, and monetization tips. Format in markdown.\n",
"\"\"\",\n",
" llm=\"gpt-4o\",\n",
" llm=\"gpt-5-nano\",\n",
" verbose=True,\n",
" markdown=True\n",
")\n"
@@ -136,7 +136,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{'name': 'Travel Research Agent', 'description': 'A world-class travel researcher that searches for destinations, activities, and accommodations', 'instructions': ['Given a travel destination and number of days, generate 3 relevant search terms', 'Search the web for each term using web_search tool', 'Analyze results and return 10 most relevant findings', 'Focus on activities, accommodations, attractions, and local insights', 'Ensure high-quality, accurate information', 'Use travel_budget_calculator to estimate costs'], 'tools': ['web_search', 'travel_budget_calculator'], 'model': 'gpt-4o', 'temperature': 0.7}\n"
"{'name': 'Travel Research Agent', 'description': 'A world-class travel researcher that searches for destinations, activities, and accommodations', 'instructions': ['Given a travel destination and number of days, generate 3 relevant search terms', 'Search the web for each term using web_search tool', 'Analyze results and return 10 most relevant findings', 'Focus on activities, accommodations, attractions, and local insights', 'Ensure high-quality, accurate information', 'Use travel_budget_calculator to estimate costs'], 'tools': ['web_search', 'travel_budget_calculator'], 'model': 'gpt-5-nano', 'temperature': 0.7}\n"
]
}
],
@@ -156,7 +156,7 @@
"tools:\n",
" - web_search\n",
" - travel_budget_calculator\n",
"model: gpt-4o\n",
"model: gpt-5-nano\n",
"temperature: 0.7\n",
"\"\"\"\n",
"\n",
@@ -17,7 +17,7 @@
"id": "Y9FkDzt1lF47"
},
"source": [
"This notebook implements a conversational restaurant booking assistant using the Praison AI Agent framework. It handles natural interruptions such as modifying guest count or changing time mid-conversation. Built for Google Colab Free Tier, it uses OpenAI's GPT-4o model and follows a YAML-based agent design for clarity and modularity."
"This notebook implements a conversational restaurant booking assistant using the Praison AI Agent framework. It handles natural interruptions such as modifying guest count or changing time mid-conversation. Built for Google Colab Free Tier, it uses OpenAI's gpt-5-nano model and follows a YAML-based agent design for clarity and modularity."
]
},
{
@@ -135,7 +135,7 @@
" - Context management\n",
" - Handling mid-conversation changes\n",
" - Summarizing confirmed reservations\n",
"llm: gpt-4o\n",
"llm: gpt-5-nano\n",
"verbosity: true\n",
"format: markdown\n",
"\"\"\"\n"
@@ -167,7 +167,7 @@
"manage corrections like “change to 3 guests” or “move to 8 PM,”\n",
"confirm the details once the user is satisfied. Respond in markdown.\n",
"\"\"\",\n",
" llm=\"gpt-4o\",\n",
" llm=\"gpt-5-nano\",\n",
" verbose=True,\n",
" markdown=True\n",
")\n"
@@ -0,0 +1,481 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "LJRJRQtFTagH"
},
"source": [
"# AI RAG Agent with Web Access using PraisonAI"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Ph4RVTBCTcmB"
},
"source": [
"This notebook demonstrates how to build a Retrieval-Augmented Generation (RAG) agent with web access using GPT-4o and PraisonAI. The agent specializes in Thai recipes and can search the web for additional information."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "tMxfwPPATy_o"
},
"source": [
"This RAG agent:\n",
"* Creates an AI assistant specialized in Thai recipes and cooking\n",
"* Has access to a PDF knowledge base about Thai recipes\n",
"* Can search the web using DuckDuckGo for additional information\n",
"* Provides comprehensive answers about Thai cuisine\n",
"* Uses PraisonAI framework for agent management"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "h68oMaCITmqt"
},
"source": [
"[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Dhivya-Bharathy/PraisonAI/blob/main/examples/cookbooks/rag_examples/agentic_rag/PraisonAI_RecipeAgent.ipynb)\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "cAdzoWXJUMfF"
},
"source": [
"# Dependencies"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "9D-2TlOrUNcu"
},
"outputs": [],
"source": [
"!pip install praisonaiagents openai requests"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "yY-4-kEIUW40"
},
"source": [
"# Set Up API Key"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "f5bhQ05yUX6J",
"outputId": "dcf9d0d9-332e-4136-9289-4c39d898005c"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter your OpenAI API key: ··········\n",
"✅ API key set successfully!\n"
]
}
],
"source": [
"import os\n",
"\n",
"# Set your OpenAI API key here\n",
"os.environ['OPENAI_API_KEY'] = 'Enter your api key here'\n",
"\n",
"# Or use this method to input it securely\n",
"from getpass import getpass\n",
"api_key = getpass('Enter your OpenAI API key: ')\n",
"os.environ['OPENAI_API_KEY'] = api_key\n",
"\n",
"print(\"✅ API key set successfully!\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Eh0j-SegUi13"
},
"source": [
"# Tools"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Z1A9oifIUkQN",
"outputId": "9be78226-36fa-43c4-865d-2f7e6e2ba9de"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Tools imported successfully!\n"
]
}
],
"source": [
"from praisonaiagents import Agent\n",
"import requests\n",
"import tempfile\n",
"from pathlib import Path\n",
"\n",
"print(\"✅ Tools imported successfully!\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "efnnREHXUnYA"
},
"source": [
"# YAML Prompt"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "kcM14-yQUqG-",
"outputId": "c5b6288d-a789-4a93-e20c-1d285370b667"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Agent instructions configured!\n"
]
}
],
"source": [
"# Agent configuration and instructions\n",
"AGENT_INSTRUCTIONS = \"\"\"\n",
"You are a helpful AI assistant specialized in Thai recipes and cooking.\n",
"\n",
"You have access to a PDF knowledge base about Thai recipes from: https://phi-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf\n",
"\n",
"You can also search the web for additional information about Thai cooking, ingredients, and techniques.\n",
"\n",
"When answering questions:\n",
"1. Use your knowledge about Thai cuisine to provide helpful information\n",
"2. If needed, search the web for additional details, current information, or clarification\n",
"3. Provide comprehensive, helpful answers about Thai cuisine\n",
"4. Always be informative and helpful about Thai cooking!\n",
"\n",
"You can use the internet_search function to search the web when needed.\n",
"\n",
"Focus on providing practical cooking advice, ingredient information, and authentic Thai recipe guidance.\n",
"\"\"\"\n",
"\n",
"print(\"✅ Agent instructions configured!\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "MCBRcXFJUulY"
},
"source": [
"# Main"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "YaRLbgMmUvXv",
"outputId": "8ed8d9f8-85a7-48de-ccc6-f617cd672a85"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"🤖 Thai Recipe RAG Agent created successfully!\n",
"The agent is ready to answer questions about Thai cooking.\n"
]
}
],
"source": [
"# Create the RAG agent\n",
"rag_agent = Agent(\n",
" instructions=AGENT_INSTRUCTIONS,\n",
" llm=\"gpt-4o\",\n",
" markdown=True,\n",
" verbose=True\n",
")\n",
"\n",
"print(\"🤖 Thai Recipe RAG Agent created successfully!\")\n",
"print(\"The agent is ready to answer questions about Thai cooking.\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "QvZM94pGU0IX"
},
"source": [
"# Test the Agent"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000,
"referenced_widgets": [
"47739975c9f04ee5b4e69e8f445cbeda",
"08888d583cba4c01b3fdf8f30b06ca4f"
]
},
"id": "QPdrleKxU1VN",
"outputId": "a71a86cd-eff8-4309-9b50-173a30066c90"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"🤔 Question: What are the essential ingredients for Thai cooking?\n"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Agent</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Assistant</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mAgent\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mAssistant\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "47739975c9f04ee5b4e69e8f445cbeda",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
],
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
"</pre>\n"
],
"text/plain": [
"\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 8.4s</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[2mResponse generated in 8.4s\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> What are the essential ingredients for Thai cooking? <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
"\u001b[36m│\u001b[0m What are the essential ingredients for Thai cooking? \u001b[36m│\u001b[0m\n",
"\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Thai cooking is known for its balance of five fundamental taste senses in each dish or the overall meal: sour, <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> sweet, salty, bitter, and spicy. Essential ingredients that help achieve this balance include: <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 1 </span><span style=\"font-weight: bold\">Fish Sauce (Nam Pla)</span>: A salty, savory sauce made from fermented fish. It's a cornerstone of Thai cooking, <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>used to add depth of flavor. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 2 </span><span style=\"font-weight: bold\">Lime Juice</span>: Used to add a fresh, tangy citrus flavor to dishes, especially in salads and some curries. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 3 </span><span style=\"font-weight: bold\">Chilies</span>: Thai cuisine often features fresh Thai bird's eye chilies for heat, as well as dried chilies for <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>certain recipes. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 4 </span><span style=\"font-weight: bold\">Lemongrass</span>: A citrusy, fragrant herb that is often used in soups, curries, and teas. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 5 </span><span style=\"font-weight: bold\">Galangal</span>: Similar to ginger, galangal has a sharp, peppery flavor and is used in soups and curries. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 6 </span><span style=\"font-weight: bold\">Kaffir Lime Leaves</span>: They add a distinct, zesty citrus aroma and flavor to Thai dishes. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 7 </span><span style=\"font-weight: bold\">Coconut Milk</span>: Adds richness and creaminess, commonly used in curries and desserts. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 8 </span><span style=\"font-weight: bold\">Palm Sugar</span>: Used as a sweetener, palm sugar has a nuanced flavor, unlike regular sugar. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 9 </span><span style=\"font-weight: bold\">Tamarind Paste</span>: Provides a sour element to many dishes, particularly pad Thai and some sauces. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 10 </span><span style=\"font-weight: bold\">Thai Basil</span>: Adds a spicy, peppery flavor, different from the sweet basil used in Western cooking. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 11 </span><span style=\"font-weight: bold\">Coriander (Cilantro)</span>: Used as a garnish and for its fresh, citrusy leaves and roots, which add depth to <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>sauces and stocks. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> 12 </span><span style=\"font-weight: bold\">Shrimp Paste</span>: A very pungent paste made from fermented shrimp, used sparingly to enrich the flavor of <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>dishes. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> These ingredients are commonly used in combination to create the complex and rich flavors characteristic of <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Thai cuisine. Fresh and high-quality versions of these ingredients contribute significantly to the authenticity <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> of Thai dishes. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
"\u001b[36m│\u001b[0m Thai cooking is known for its balance of five fundamental taste senses in each dish or the overall meal: sour, \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m sweet, salty, bitter, and spicy. Essential ingredients that help achieve this balance include: \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 1 \u001b[0m\u001b[1mFish Sauce (Nam Pla)\u001b[0m: A salty, savory sauce made from fermented fish. It's a cornerstone of Thai cooking, \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mused to add depth of flavor. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 2 \u001b[0m\u001b[1mLime Juice\u001b[0m: Used to add a fresh, tangy citrus flavor to dishes, especially in salads and some curries. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 3 \u001b[0m\u001b[1mChilies\u001b[0m: Thai cuisine often features fresh Thai bird's eye chilies for heat, as well as dried chilies for \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mcertain recipes. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 4 \u001b[0m\u001b[1mLemongrass\u001b[0m: A citrusy, fragrant herb that is often used in soups, curries, and teas. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 5 \u001b[0m\u001b[1mGalangal\u001b[0m: Similar to ginger, galangal has a sharp, peppery flavor and is used in soups and curries. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 6 \u001b[0m\u001b[1mKaffir Lime Leaves\u001b[0m: They add a distinct, zesty citrus aroma and flavor to Thai dishes. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 7 \u001b[0m\u001b[1mCoconut Milk\u001b[0m: Adds richness and creaminess, commonly used in curries and desserts. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 8 \u001b[0m\u001b[1mPalm Sugar\u001b[0m: Used as a sweetener, palm sugar has a nuanced flavor, unlike regular sugar. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 9 \u001b[0m\u001b[1mTamarind Paste\u001b[0m: Provides a sour element to many dishes, particularly pad Thai and some sauces. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 10 \u001b[0m\u001b[1mThai Basil\u001b[0m: Adds a spicy, peppery flavor, different from the sweet basil used in Western cooking. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 11 \u001b[0m\u001b[1mCoriander (Cilantro)\u001b[0m: Used as a garnish and for its fresh, citrusy leaves and roots, which add depth to \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0msauces and stocks. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m 12 \u001b[0m\u001b[1mShrimp Paste\u001b[0m: A very pungent paste made from fermented shrimp, used sparingly to enrich the flavor of \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mdishes. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m These ingredients are commonly used in combination to create the complex and rich flavors characteristic of \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m Thai cuisine. Fresh and high-quality versions of these ingredients contribute significantly to the authenticity \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m of Thai dishes. \u001b[36m│\u001b[0m\n",
"\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"�� Answer: Thai cooking is known for its balance of five fundamental taste senses in each dish or the overall meal: sour, sweet, salty, bitter, and spicy. Essential ingredients that help achieve this balance include:\n",
"\n",
"1. **Fish Sauce (Nam Pla)**: A salty, savory sauce made from fermented fish. It's a cornerstone of Thai cooking, used to add depth of flavor.\n",
"\n",
"2. **Lime Juice**: Used to add a fresh, tangy citrus flavor to dishes, especially in salads and some curries.\n",
"\n",
"3. **Chilies**: Thai cuisine often features fresh Thai bird's eye chilies for heat, as well as dried chilies for certain recipes.\n",
"\n",
"4. **Lemongrass**: A citrusy, fragrant herb that is often used in soups, curries, and teas.\n",
"\n",
"5. **Galangal**: Similar to ginger, galangal has a sharp, peppery flavor and is used in soups and curries.\n",
"\n",
"6. **Kaffir Lime Leaves**: They add a distinct, zesty citrus aroma and flavor to Thai dishes.\n",
"\n",
"7. **Coconut Milk**: Adds richness and creaminess, commonly used in curries and desserts.\n",
"\n",
"8. **Palm Sugar**: Used as a sweetener, palm sugar has a nuanced flavor, unlike regular sugar.\n",
"\n",
"9. **Tamarind Paste**: Provides a sour element to many dishes, particularly pad Thai and some sauces.\n",
"\n",
"10. **Thai Basil**: Adds a spicy, peppery flavor, different from the sweet basil used in Western cooking.\n",
"\n",
"11. **Coriander (Cilantro)**: Used as a garnish and for its fresh, citrusy leaves and roots, which add depth to sauces and stocks.\n",
"\n",
"12. **Shrimp Paste**: A very pungent paste made from fermented shrimp, used sparingly to enrich the flavor of dishes.\n",
"\n",
"These ingredients are commonly used in combination to create the complex and rich flavors characteristic of Thai cuisine. Fresh and high-quality versions of these ingredients contribute significantly to the authenticity of Thai dishes.\n"
]
}
],
"source": [
"# Test question 1: Basic Thai cooking\n",
"question1 = \"What are the essential ingredients for Thai cooking?\"\n",
"print(f\"🤔 Question: {question1}\")\n",
"\n",
"try:\n",
" response1 = rag_agent.start(question1)\n",
" print(f\"�� Answer: {response1}\")\n",
"except Exception as e:\n",
" print(f\"❌ Error: {e}\")"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
@@ -0,0 +1,556 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "EA8l4cSVl3Lx"
},
"source": [
"# Agentic RAG with GPT-5 - Colab Notebook"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "I-8nOxJ2l7nO"
},
"source": [
"This Colab notebook sets up a Streamlit app using PraisonAI Agents framework.\n",
"It allows you to interact with an AI agent powered by GPT-5 for Q&A.\n",
"Currently, the knowledge base functionality is disabled due to compatibility issues."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "g5I1tMkxmDQe"
},
"source": [
"- GPT-5 Integration (via OpenAI API)\n",
"- Streamlit Web App\n",
"- Agent Framework: PraisonAI Agents\n",
"- Markdown-formatted responses"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "yeEno7U0q2U_"
},
"source": [
"[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Dhivya-Bharathy/PraisonAI/blob/main/examples/cookbooks/Qwen2.5_InstructionAgent.ipynb)\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "WV2GnzZCmGBR"
},
"source": [
"# Dependencies"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "20wAadXemJ0k"
},
"outputs": [],
"source": [
"!pip install praisonaiagents python-dotenv streamlit"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "l71uCRarndvy"
},
"source": [
"# Set API Key"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"id": "brfc-ZZKnfre"
},
"outputs": [],
"source": [
"import os\n",
"from dotenv import load_dotenv\n",
"\n",
"load_dotenv()\n",
"\n",
"OPENAI_API_KEY = \"Enter your api key here\"\n",
"\n",
"os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "d1fGzyQCn1aQ"
},
"source": [
"# Tools and Imports"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"id": "GcNPLkZXntIS"
},
"outputs": [],
"source": [
"import streamlit as st\n",
"from praisonaiagents import Agent\n",
"\n",
"# YAML Prompt Configuration\n",
"agent_config = {\n",
" \"name\": \"Knowledge Agent\",\n",
" \"instructions\": [\n",
" \"You are a helpful AI assistant. Answer questions based on your general knowledge.\",\n",
" \"Provide clear, well-structured answers in markdown format.\",\n",
" \"Use proper markdown formatting with headers, lists, and emphasis where appropriate.\",\n",
" \"Structure your response with clear sections and bullet points when helpful.\",\n",
" ],\n",
" \"llm\": \"gpt-5-nano\",\n",
" \"markdown\": True,\n",
" \"verbose\": True\n",
"}\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "jkmrh0gIn_4a"
},
"source": [
"# Initialize Agent"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"id": "qaJvf8RyoAsB"
},
"outputs": [],
"source": [
"def create_agent():\n",
" \"\"\"Create an agent with reasoning capabilities\"\"\"\n",
" return Agent(\n",
" name=agent_config[\"name\"],\n",
" instructions=agent_config[\"instructions\"],\n",
" llm=agent_config[\"llm\"],\n",
" markdown=agent_config[\"markdown\"],\n",
" verbose=agent_config[\"verbose\"]\n",
" )"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "kvGJh3bbqTmh"
},
"source": [
"# Main Function"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000,
"referenced_widgets": [
"ad296d97510246de8eb0138ce8a8a166",
"f6e502b3dca442f0ae6c5739f5a6d159"
]
},
"id": "_QyxzqKKqUrW",
"outputId": "97be7e02-b034-4004-e9e3-56337e3f2887"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"�� Initializing Agentic RAG with GPT-5...\n",
"📚 Loading agent...\n",
"✅ Agent loaded successfully!\n",
"\n",
"🎯 Example queries you can try:\n",
"1. What is PraisonAI and how do Agents work?\n",
"2. What are Teams in PraisonAI and how do they work?\n",
"3. Give me a step-by-step guide to building a RAG system.\n",
"4. What are AI Agents?\n",
"\n",
"============================================================\n",
"\n",
"🤔 Enter your question (or 'quit' to exit):\n",
"> What is PraisonAI and how do Agents work?\n",
"🔍 Processing your question...\n"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Knowledge Agent</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Assistant</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mKnowledge Agent\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mAssistant\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m│\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n",
"\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ad296d97510246de8eb0138ce8a8a166",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
],
"text/plain": []
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
"</pre>\n"
],
"text/plain": [
"\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 9.4s</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[2mResponse generated in 9.4s\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> What is PraisonAI and how do Agents work? <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
"\u001b[36m│\u001b[0m What is PraisonAI and how do Agents work? \u001b[36m│\u001b[0m\n",
"\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> ┃ <span style=\"font-weight: bold\">What is PraisonAI?</span> ┃ <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> PraisonAI is a platform designed to leverage artificial intelligence to enhance personal and business <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> productivity. It typically involves developing AI models that can assist in various tasks, automate processes, <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> and provide insights based on data analysis. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"font-weight: bold; text-decoration: underline\">Key Features of PraisonAI</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Task Automation</span>: Automates repetitive tasks, allowing users to focus on more strategic activities. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Data Insights</span>: Analyzes large sets of data to provide actionable insights. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Natural Language Processing</span>: Enables users to interact with the AI through natural language, making it <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>user-friendly. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Customizable Solutions</span>: Tailors AI applications to meet specific user needs across various industries. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> ┃ <span style=\"font-weight: bold\">How Do Agents Work in PraisonAI?</span> ┃ <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Agents in PraisonAI refer to autonomous or semi-autonomous AI systems that perform designated tasks or <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> functions. Here’s how they typically operate: <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"font-weight: bold; text-decoration: underline\">1. Types of Agents</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Reactive Agents</span>: Respond to the current environment without internal memory. They act solely based on <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>current inputs. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Deliberative Agents</span>: Have a model of their environment, plan their actions, and retain memories of past <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>interactions. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Learning Agents</span>: Improve their performance over time through experience, adapting to new information. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"font-weight: bold; text-decoration: underline\">2. Functionality of Agents</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Task Execution</span>: Agents can carry out specific tasks as programmed, such as scheduling, data entry, or <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>customer support. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Interaction</span>: They often interact with users through chat interfaces or APIs, providing a seamless user <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>experience. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Integration</span>: Can be integrated with other systems or software to enhance functionality, such as CRM systems, <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>databases, or other AI tools. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Continuous Learning</span>: Agents may utilize machine learning algorithms to adapt and evolve based on user <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> </span>interactions and data received. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"font-weight: bold; text-decoration: underline\">3. Benefits of Using Agents</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Increased Efficiency</span>: Automate routine tasks to reduce workload. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">24/7 Availability</span>: Provide consistent support and functionality without downtime. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Scalability</span>: Easily scale operations by deploying more agents as needed. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\"> • </span><span style=\"font-weight: bold\">Data-Driven Decisions</span>: Use data insights to inform strategy and operations. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"font-weight: bold; text-decoration: underline\">Conclusion</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> PraisonAI represents a robust platform for enhancing productivity through AI, with agents serving as the heart <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> of this solution, performing various tasks and supporting users in achieving their goals efficiently. Whether <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> they are simple reactive agents or complex learning entities, their design focuses on making operations <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> smoother and more effective. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
"<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
"\u001b[36m│\u001b[0m ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m ┃ \u001b[1mWhat is PraisonAI?\u001b[0m ┃ \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m PraisonAI is a platform designed to leverage artificial intelligence to enhance personal and business \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m productivity. It typically involves developing AI models that can assist in various tasks, automate processes, \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m and provide insights based on data analysis. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;4mKey Features of PraisonAI\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mTask Automation\u001b[0m: Automates repetitive tasks, allowing users to focus on more strategic activities. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mData Insights\u001b[0m: Analyzes large sets of data to provide actionable insights. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mNatural Language Processing\u001b[0m: Enables users to interact with the AI through natural language, making it \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0muser-friendly. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mCustomizable Solutions\u001b[0m: Tailors AI applications to meet specific user needs across various industries. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m ┃ \u001b[1mHow Do Agents Work in PraisonAI?\u001b[0m ┃ \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m Agents in PraisonAI refer to autonomous or semi-autonomous AI systems that perform designated tasks or \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m functions. Here’s how they typically operate: \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;4m1. \u001b[0m\u001b[1;4mTypes of Agents\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mReactive Agents\u001b[0m: Respond to the current environment without internal memory. They act solely based on \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mcurrent inputs. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mDeliberative Agents\u001b[0m: Have a model of their environment, plan their actions, and retain memories of past \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0minteractions. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mLearning Agents\u001b[0m: Improve their performance over time through experience, adapting to new information. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;4m2. \u001b[0m\u001b[1;4mFunctionality of Agents\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mTask Execution\u001b[0m: Agents can carry out specific tasks as programmed, such as scheduling, data entry, or \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mcustomer support. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mInteraction\u001b[0m: They often interact with users through chat interfaces or APIs, providing a seamless user \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mexperience. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mIntegration\u001b[0m: Can be integrated with other systems or software to enhance functionality, such as CRM systems, \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mdatabases, or other AI tools. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mContinuous Learning\u001b[0m: Agents may utilize machine learning algorithms to adapt and evolve based on user \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0minteractions and data received. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;4m3. \u001b[0m\u001b[1;4mBenefits of Using Agents\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mIncreased Efficiency\u001b[0m: Automate routine tasks to reduce workload. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1m24/7 Availability\u001b[0m: Provide consistent support and functionality without downtime. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mScalability\u001b[0m: Easily scale operations by deploying more agents as needed. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;33m • \u001b[0m\u001b[1mData-Driven Decisions\u001b[0m: Use data insights to inform strategy and operations. \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[1;4mConclusion\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m PraisonAI represents a robust platform for enhancing productivity through AI, with agents serving as the heart \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m of this solution, performing various tasks and supporting users in achieving their goals efficiently. Whether \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m they are simple reactive agents or complex learning entities, their design focuses on making operations \u001b[36m│\u001b[0m\n",
"\u001b[36m│\u001b[0m smoother and more effective. \u001b[36m│\u001b[0m\n",
"\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"💡 Answer:\n",
"========================================\n",
"# What is PraisonAI?\n",
"\n",
"PraisonAI is a platform designed to leverage artificial intelligence to enhance personal and business productivity. It typically involves developing AI models that can assist in various tasks, automate processes, and provide insights based on data analysis.\n",
"\n",
"## Key Features of PraisonAI\n",
"\n",
"- **Task Automation**: Automates repetitive tasks, allowing users to focus on more strategic activities.\n",
"- **Data Insights**: Analyzes large sets of data to provide actionable insights.\n",
"- **Natural Language Processing**: Enables users to interact with the AI through natural language, making it user-friendly.\n",
"- **Customizable Solutions**: Tailors AI applications to meet specific user needs across various industries.\n",
"\n",
"# How Do Agents Work in PraisonAI?\n",
"\n",
"Agents in PraisonAI refer to autonomous or semi-autonomous AI systems that perform designated tasks or functions. Here’s how they typically operate:\n",
"\n",
"## 1. **Types of Agents**\n",
"\n",
"- **Reactive Agents**: Respond to the current environment without internal memory. They act solely based on current inputs.\n",
"- **Deliberative Agents**: Have a model of their environment, plan their actions, and retain memories of past interactions.\n",
"- **Learning Agents**: Improve their performance over time through experience, adapting to new information.\n",
"\n",
"## 2. **Functionality of Agents**\n",
"\n",
"- **Task Execution**: Agents can carry out specific tasks as programmed, such as scheduling, data entry, or customer support.\n",
"- **Interaction**: They often interact with users through chat interfaces or APIs, providing a seamless user experience.\n",
"- **Integration**: Can be integrated with other systems or software to enhance functionality, such as CRM systems, databases, or other AI tools.\n",
"- **Continuous Learning**: Agents may utilize machine learning algorithms to adapt and evolve based on user interactions and data received.\n",
"\n",
"## 3. **Benefits of Using Agents**\n",
"\n",
"- **Increased Efficiency**: Automate routine tasks to reduce workload.\n",
"- **24/7 Availability**: Provide consistent support and functionality without downtime.\n",
"- **Scalability**: Easily scale operations by deploying more agents as needed.\n",
"- **Data-Driven Decisions**: Use data insights to inform strategy and operations.\n",
"\n",
"## Conclusion\n",
"\n",
"PraisonAI represents a robust platform for enhancing productivity through AI, with agents serving as the heart of this solution, performing various tasks and supporting users in achieving their goals efficiently. Whether they are simple reactive agents or complex learning entities, their design focuses on making operations smoother and more effective.\n",
"========================================\n",
"\n",
"🤔 Enter your question (or 'quit' to exit):\n",
"> quit\n",
"👋 Goodbye!\n"
]
}
],
"source": [
"def main():\n",
" print(\"�� Initializing Agentic RAG with GPT-5...\")\n",
"\n",
" # Check if API key is set\n",
" if not OPENAI_API_KEY or OPENAI_API_KEY == \"your_openai_api_key_here\":\n",
" print(\"❌ Please set your OpenAI API key first!\")\n",
" print(\"�� Get your key from: https://platform.openai.com/\")\n",
" return\n",
"\n",
" try:\n",
" # Create agent\n",
" print(\"📚 Loading agent...\")\n",
" agent = create_agent()\n",
" print(\"✅ Agent loaded successfully!\")\n",
"\n",
" # Example queries\n",
" example_queries = [\n",
" \"What is PraisonAI and how do Agents work?\",\n",
" \"What are Teams in PraisonAI and how do they work?\",\n",
" \"Give me a step-by-step guide to building a RAG system.\",\n",
" \"What are AI Agents?\"\n",
" ]\n",
"\n",
" print(\"\\n🎯 Example queries you can try:\")\n",
" for i, query in enumerate(example_queries, 1):\n",
" print(f\"{i}. {query}\")\n",
"\n",
" print(\"\\n\" + \"=\"*60)\n",
"\n",
" # Interactive query loop\n",
" while True:\n",
" print(\"\\n🤔 Enter your question (or 'quit' to exit):\")\n",
" user_query = input(\"> \")\n",
"\n",
" if user_query.lower() in ['quit', 'exit', 'q']:\n",
" print(\"👋 Goodbye!\")\n",
" break\n",
"\n",
" if user_query.strip():\n",
" print(\"🔍 Processing your question...\")\n",
" try:\n",
" response = agent.start(user_query)\n",
" print(\"\\n💡 Answer:\")\n",
" print(\"=\"*40)\n",
" print(response)\n",
" print(\"=\"*40)\n",
" except Exception as e:\n",
" print(f\"❌ Error: {str(e)}\")\n",
" print(f\"🔍 Error type: {type(e).__name__}\")\n",
" print(\"💡 This might be due to API issues or model access problems.\")\n",
" else:\n",
" print(\"❌ Please enter a valid question.\")\n",
"\n",
" except Exception as e:\n",
" print(f\"❌ Failed to initialize agent: {str(e)}\")\n",
" print(\"�� Make sure your API key is correct and you have sufficient credits.\")\n",
"\n",
"# Run the main function\n",
"if __name__ == \"__main__\":\n",
" main()"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
@@ -585,7 +585,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -1090,7 +1090,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -2077,7 +2077,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -151,7 +151,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -533,7 +533,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -235,7 +235,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -1250,7 +1250,7 @@
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"TAVILY_API_KEY\"] = userdata.get('TAVILY_API_KEY') or \"ENTER TAVILY_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -1559,7 +1559,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -2159,7 +2159,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -698,7 +698,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -592,7 +592,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -572,7 +572,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -580,7 +580,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -252,7 +252,7 @@
"text": [
"\u001b[95m \n",
"\n",
"[{'title': 'CrewAI uses third-party models to automate business tasks', 'href': 'https://techcrunch.com/2024/10/22/crewai-uses-third-party-models-to-automate-business-tasks/', 'body': 'CrewAI, a startup developing a hub where companies can build automations using third-party AI models, has raised $18 million from investors including Andrew Ng. ... 4:00 AM PDT · October 22, 2024 ...'}, {'title': 'CrewAI Launches Multi-Agentic Platform to Deliver on the Promise of ...', 'href': 'https://markets.businessinsider.com/news/stocks/crewai-launches-multi-agentic-platform-to-deliver-on-the-promise-of-generative-ai-for-enterprise-1033870246?op=1', 'body': 'SAN FRANCISCO and SÃO PAULO, Oct. 22, 2024 (GLOBE NEWSWIRE) -- CrewAI, a leading multi-agent platform, today announced $18 million in total funding that included an inception round led by ...'}, {'title': 'Agentic AI startup CrewAI closes $18M funding round', 'href': 'https://siliconangle.com/2024/10/22/agentic-ai-startup-crewai-closes-18m-funding-round/', 'body': \"An e-commerce company, for example, could create an agent that uses GPT-4o to generate shopping advice based on customers' past purchases. CrewAI has created an open-source framework of the same ...\"}, {'title': 'CrewAI Company Profile 2024: Valuation, Funding & Investors - PitchBook', 'href': 'https://pitchbook.com/profiles/company/590845-78', 'body': \"Explore institutional-grade private market research from our team of analysts. ... Artificial Intelligence & Machine Learning; Artificial Intelligence & Machine Learning Report. September 19, 2024. CrewAI Executive Team (2) Update this profile Name ... CrewAI's primary industry is Business/Productivity Software. Is CrewAI a private or public ...\"}, {'title': 'CrewAI - Autonomous AI Agents in action for a market ... - LinkedIn', 'href': 'https://www.linkedin.com/pulse/crewai-autonomous-ai-agents-action-market-research-task-kithion-ovnrc', 'body': 'The will provide a detailed market trends report, the will generate a comprehensive analysis of top competitors, and the will develop a thorough marketing plan. Conclusion. CrewAI, combined with ...'}]\n",
"[{'title': 'CrewAI uses third-party models to automate business tasks', 'href': 'https://techcrunch.com/2024/10/22/crewai-uses-third-party-models-to-automate-business-tasks/', 'body': 'CrewAI, a startup developing a hub where companies can build automations using third-party AI models, has raised $18 million from investors including Andrew Ng. ... 4:00 AM PDT · October 22, 2024 ...'}, {'title': 'CrewAI Launches Multi-Agentic Platform to Deliver on the Promise of ...', 'href': 'https://markets.businessinsider.com/news/stocks/crewai-launches-multi-agentic-platform-to-deliver-on-the-promise-of-generative-ai-for-enterprise-1033870246?op=1', 'body': 'SAN FRANCISCO and SÃO PAULO, Oct. 22, 2024 (GLOBE NEWSWIRE) -- CrewAI, a leading multi-agent platform, today announced $18 million in total funding that included an inception round led by ...'}, {'title': 'Agentic AI startup CrewAI closes $18M funding round', 'href': 'https://siliconangle.com/2024/10/22/agentic-ai-startup-crewai-closes-18m-funding-round/', 'body': \"An e-commerce company, for example, could create an agent that uses gpt-5-nano to generate shopping advice based on customers' past purchases. CrewAI has created an open-source framework of the same ...\"}, {'title': 'CrewAI Company Profile 2024: Valuation, Funding & Investors - PitchBook', 'href': 'https://pitchbook.com/profiles/company/590845-78', 'body': \"Explore institutional-grade private market research from our team of analysts. ... Artificial Intelligence & Machine Learning; Artificial Intelligence & Machine Learning Report. September 19, 2024. CrewAI Executive Team (2) Update this profile Name ... CrewAI's primary industry is Business/Productivity Software. Is CrewAI a private or public ...\"}, {'title': 'CrewAI - Autonomous AI Agents in action for a market ... - LinkedIn', 'href': 'https://www.linkedin.com/pulse/crewai-autonomous-ai-agents-action-market-research-task-kithion-ovnrc', 'body': 'The will provide a detailed market trends report, the will generate a comprehensive analysis of top competitors, and the will develop a thorough marketing plan. Conclusion. CrewAI, combined with ...'}]\n",
"\u001b[00m\n",
"\u001b[32;1m\u001b[1;3mThought: I have found more information about CrewAI's target customers and market positioning. CrewAI is a startup that has developed a hub where companies can build automations using third-party AI models, and it has recently raised $18 million in funding. Their target customers are likely businesses looking to automate complex tasks and improve efficiency using AI. They are positioned as a platform for deploying and managing AI agents to automate a variety of tasks.\n",
"\n",
@@ -1075,7 +1075,7 @@
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"EXA_API_KEY\"] = userdata.get('EXA_API_KEY') or \"ENTER EXA_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -667,7 +667,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -1947,7 +1947,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -73,7 +73,7 @@
" url=url,\n",
" word_count_threshold=1,\n",
" extraction_strategy= LLMExtractionStrategy(\n",
" provider=\"openai/gpt-4o\",\n",
" provider=\"openai/gpt-5-nano\",\n",
" api_token=os.getenv('OPENAI_API_KEY'),\n",
" schema=ModelFee.schema(),\n",
" extraction_type=\"schema\",\n",
@@ -666,7 +666,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -475,7 +475,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -2130,7 +2130,7 @@
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"SERPER_API_KEY\"] = userdata.get('SERPER_API_KEY') or \"ENTER SERPER_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -635,7 +635,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -564,7 +564,7 @@
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"TAVILY_API_KEY\"] = userdata.get('TAVILY_API_KEY') or \"ENTER TAVILY_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -564,7 +564,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -614,7 +614,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -66,7 +66,7 @@
"\n",
"# Set up OpenAI API key (add to Google Colab secrets)\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\""
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\""
]
},
{
@@ -22,7 +22,7 @@ roles:
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -76,7 +76,7 @@ roles:
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -130,7 +130,7 @@ roles:
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -185,7 +185,7 @@ roles:
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.4
tools:
- "InternetSearchTool"
@@ -239,7 +239,7 @@ roles:
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tools:
- "InternetSearchTool"
@@ -299,7 +299,7 @@ roles:
verbose: true
allow_delegation: false
llm:
model: "gpt-4o-mini"
model: "gpt-5-nano"
temperature: 0.3
tasks:
report_synthesis:
@@ -462,7 +462,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -380,7 +380,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -540,7 +540,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -2639,7 +2639,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -1835,7 +1835,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -623,7 +623,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -635,7 +635,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -582,7 +582,7 @@
"\n",
"# Add OPENAI_API_KEY Secrets to Google Colab on the Left Hand Side 🔑 or Enter Manually Below\n",
"os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY') or \"ENTER OPENAI_API_KEY HERE\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-4o-mini\"\n",
"os.environ[\"OPENAI_MODEL_NAME\"] = \"gpt-5-nano\"\n",
"\n",
"# Run PraisonAI\n",
"result = praisonai.run()\n",
@@ -10,7 +10,7 @@ PraisonAI now supports intelligent multi-provider and multi-model capabilities,
- Supports fallback mechanisms for reliability
### 2. **Cost Optimization**
- Routes simple tasks to cheaper models (e.g., GPT-4o-mini, Gemini Flash)
- Routes simple tasks to cheaper models (e.g., gpt-5-nano, Gemini Flash)
- Reserves expensive models for complex tasks
- Tracks usage and provides cost estimates
@@ -46,7 +46,7 @@ agent = RouterAgent(
name="Smart Assistant",
role="Adaptive AI Assistant",
goal="Complete tasks using the most appropriate model",
models=["gpt-4o-mini", "gpt-4o", "claude-3-5-sonnet-20241022"],
models=["gpt-5-nano", "gpt-5-nano", "claude-3-5-sonnet-20241022"],
routing_strategy="auto" # Automatic model selection
)
@@ -90,7 +90,7 @@ analyzer = RouterAgent(
goal="Analyze data efficiently",
models={
"gemini/gemini-1.5-flash": {},
"gpt-4o-mini": {},
"gpt-5-nano": {},
"claude-3-haiku-20240307": {}
},
model_router=router,
@@ -130,10 +130,10 @@ The system includes pre-configured profiles for popular models:
| Model | Provider | Best For | Cost/1k tokens |
|-------|----------|----------|----------------|
| gpt-4o-mini | OpenAI | Simple tasks, speed | $0.00075 |
| gpt-5-nano | OpenAI | Simple tasks, speed | $0.00075 |
| gemini-1.5-flash | Google | Cost-effective, multimodal | $0.000125 |
| claude-3-haiku | Anthropic | Fast responses | $0.0008 |
| gpt-4o | OpenAI | General purpose | $0.0075 |
| gpt-5-nano | OpenAI | General purpose | $0.0075 |
| claude-3-5-sonnet-20241022 | Anthropic | Complex reasoning | $0.009 |
| deepseek-chat | DeepSeek | Code & math | $0.0014 |
@@ -160,8 +160,8 @@ print(report)
'agent_name': 'Smart Assistant',
'routing_strategy': 'auto',
'model_usage': {
'gpt-4o-mini': {'calls': 5, 'tokens': 1500, 'cost': 0.0011},
'gpt-4o': {'calls': 2, 'tokens': 3000, 'cost': 0.0225}
'gpt-5-nano': {'calls': 5, 'tokens': 1500, 'cost': 0.0011},
'gpt-5-nano': {'calls': 2, 'tokens': 3000, 'cost': 0.0225}
},
'total_cost_estimate': 0.0236,
'total_calls': 7
@@ -207,7 +207,7 @@ for i, agent in enumerate(auto.agents):
name=agent.name,
role=agent.role,
goal=agent.goal,
models=["gpt-4o-mini", "gpt-4o", "claude-3-5-sonnet"],
models=["gpt-5-nano", "gpt-5-nano", "claude-3-5-sonnet"],
routing_strategy="auto"
)
+3 -3
View File
@@ -31,7 +31,7 @@ def demonstrate_basic_context_generation():
# Create a ContextAgent using the factory function
context_agent = create_context_agent(
llm="gpt-4o-mini",
llm="gpt-5-nano",
name="Basic Context Engineer",
verbose=True
)
@@ -133,7 +133,7 @@ def demonstrate_context_agent_as_tool():
print("=" * 60)
# Create ContextAgent
context_agent = create_context_agent(llm="gpt-4o-mini")
context_agent = create_context_agent(llm="gpt-5-nano")
# Example scenario: Product planning workflow
project_path = str(project_root)
@@ -186,7 +186,7 @@ def show_context_engineering_benefits():
# Context Engineering approach
print("\n✅ Context Engineering Approach:")
context_agent = create_context_agent(llm="gpt-4o-mini")
context_agent = create_context_agent(llm="gpt-5-nano")
# Generate comprehensive context
analysis = context_agent.analyze_codebase_patterns(str(project_root))
+1 -1
View File
@@ -13,7 +13,7 @@ image_agent = Agent(
goal="Analyze images and videos to extract meaningful information",
backstory="""You are an expert in computer vision and image analysis.
You excel at describing images, detecting objects, and understanding visual content.""",
llm="gpt-4o-mini",
llm="gpt-5-nano",
self_reflect=False
)
@@ -13,7 +13,7 @@ image_agent = Agent(
goal="Analyze images and videos to extract meaningful information",
backstory="""You are an expert in computer vision and image analysis.
You excel at describing images, detecting objects, and understanding visual content.""",
llm="gpt-4o-mini",
llm="gpt-5-nano",
self_reflect=False
)
@@ -21,7 +21,7 @@ def example_auto_routing():
role="Adaptive Research Assistant",
goal="Research topics using the most appropriate AI model",
backstory="I analyze task complexity and route to the best model",
models=["gpt-4o-mini", "gpt-4o", "claude-3-5-sonnet-20241022"],
models=["gpt-5-nano", "gpt-5-nano", "claude-3-5-sonnet-20241022"],
routing_strategy="auto", # Automatic model selection
verbose=True
)
@@ -81,7 +81,7 @@ def example_cost_optimized_workflow():
goal="Analyze data efficiently while minimizing costs",
models={
"gemini/gemini-1.5-flash": {},
"gpt-4o-mini": {},
"gpt-5-nano": {},
"deepseek-chat": {}
},
model_router=cost_router,
@@ -95,7 +95,7 @@ def example_cost_optimized_workflow():
goal="Create high-quality content",
models={
"claude-3-5-sonnet-20241022": {},
"gpt-4o": {}
"gpt-5-nano": {}
},
routing_strategy="performance-optimized", # Prefer better models
verbose=True
@@ -144,7 +144,7 @@ def example_auto_agents_multi_provider():
auto_agents = AutoAgents(
instructions="Create a market research report on electric vehicles. Include data analysis, competitor analysis, and future projections.",
max_agents=3,
llm="gpt-4o-mini", # Default model for agent generation
llm="gpt-5-nano", # Default model for agent generation
verbose=True
)
@@ -158,7 +158,7 @@ def example_auto_agents_multi_provider():
goal=agent.goal,
backstory=agent.backstory,
tools=agent.tools,
models=["gpt-4o-mini", "gemini/gemini-1.5-flash", "claude-3-haiku-20240307", "gpt-4o"],
models=["gpt-5-nano", "gemini/gemini-1.5-flash", "claude-3-haiku-20240307", "gpt-5-nano"],
routing_strategy="auto",
verbose=True
)
@@ -192,7 +192,7 @@ def example_custom_routing():
# Create custom model profiles for specific use cases
custom_models = [
ModelProfile(
name="gpt-4o",
name="gpt-5-nano",
provider="openai",
complexity_range=(TaskComplexity.SIMPLE, TaskComplexity.VERY_COMPLEX),
cost_per_1k_tokens=0.0075,
@@ -18,8 +18,8 @@ from praisonaiagents.tools import duckduckgo
# Define model options with cost considerations
# Using different models for different complexity levels
cheap_model = "gpt-4o-mini" # For simple tasks
balanced_model = "gpt-4o" # For moderate complexity
cheap_model = "gpt-5-nano" # For simple tasks
balanced_model = "gpt-5-nano" # For moderate complexity
premium_model = "claude-3-5-sonnet-20241022" # For complex tasks
# Create RouterAgent with cost optimization strategy
@@ -76,7 +76,7 @@ print("\n" + "="*80)
print("COST OPTIMIZATION ROUTER DEMONSTRATION COMPLETED")
print("="*80)
print("The RouterAgent automatically selected appropriate models based on task complexity:")
print("- Simple factual questions → Cheaper model (gpt-4o-mini)")
print("- Moderate analysis tasks → Balanced model (gpt-4o)")
print("- Simple factual questions → Cheaper model (gpt-5-nano)")
print("- Moderate analysis tasks → Balanced model (gpt-5-nano)")
print("- Complex strategic analysis → Premium model (claude-3-5-sonnet)")
print("- This approach optimizes costs while maintaining quality for each task type")
+1 -1
View File
@@ -7,7 +7,7 @@ video_agent = Agent(
goal="Analyze images and videos to extract meaningful information",
backstory="""You are an expert in computer vision and image analysis.
You excel at describing images, detecting objects, and understanding visual content.""",
llm="gpt-4o-mini",
llm="gpt-5-nano",
self_reflect=False
)
+1 -1
View File
@@ -2,7 +2,7 @@ from praisonaiagents import Agent, MCP
qa_agent = Agent(
instructions="""You are a Question Answering Agent.""",
llm="openai/gpt-4o-mini",
llm="openai/gpt-5-nano",
tools=MCP("http://localhost:8080/agents/sse")
)
+3 -3
View File
@@ -2,17 +2,17 @@ from praisonaiagents import Agent
weather_agent = Agent(
instructions="""You are a weather agent that can provide weather information for a given city.""",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
stock_agent = Agent(
instructions="""You are a stock market agent that can provide information about stock prices and market trends.""",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
travel_agent = Agent(
instructions="""You are a travel agent that can provide recommendations for destinations, hotels, and activities.""",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
weather_agent.launch(path="/weather", port=3030)
+1 -1
View File
@@ -2,7 +2,7 @@ from praisonaiagents import Agent, MCP
search_agent = Agent(
instructions="""You are a weather agent that can provide weather information for a given city.""",
llm="openai/gpt-4o-mini",
llm="openai/gpt-5-nano",
tools=MCP("http://localhost:8080/sse")
)
search_agent.launch(path="/weather", port=3030)
+1 -1
View File
@@ -1,4 +1,4 @@
from praisonaiagents import Agent
agent = Agent(instructions="""You are a helpful assistant.""", llm="gpt-4o-mini")
agent = Agent(instructions="""You are a helpful assistant.""", llm="gpt-5-nano")
agent.launch(path="/ask", port=3030)
+1 -1
View File
@@ -28,7 +28,7 @@ def capture_and_analyze():
role="Camera Feed Analyzer",
goal="Analyze camera captures in real-time",
backstory="Expert in real-time visual analysis with computer vision skills",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Initialize camera (0 for default camera)
+1 -1
View File
@@ -42,7 +42,7 @@ class ContinuousCameraMonitor:
role="Security Camera Analyst",
goal="Monitor camera feeds for activities and security events",
backstory="Expert security analyst with computer vision skills specialized in real-time monitoring",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
def capture_frame(self, cap):
+3 -3
View File
@@ -57,7 +57,7 @@ def analyze_with_multiple_agents():
role="Security Specialist",
goal="Identify security threats and suspicious activities",
backstory="Expert security analyst with years of experience in surveillance and threat detection",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
object_detector = Agent(
@@ -65,7 +65,7 @@ def analyze_with_multiple_agents():
role="Object Recognition Specialist",
goal="Identify and catalog all objects in the scene",
backstory="Computer vision expert specializing in object detection and classification",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
scene_analyst = Agent(
@@ -73,7 +73,7 @@ def analyze_with_multiple_agents():
role="Scene Understanding Expert",
goal="Provide comprehensive scene analysis and context",
backstory="Environmental analyst expert in understanding spatial relationships and scene context",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Create specialized tasks
@@ -39,7 +39,7 @@ class CameraVideoAnalyzer:
role="Video Content Analyzer",
goal="Analyze video content for activities, objects, and events",
backstory="Expert in video analysis and temporal event detection with computer vision expertise",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
def record_video_segment(self, duration_seconds=10):
@@ -34,7 +34,7 @@ class ContextEngineeringWorkflow:
to achieve higher success rates in AI-driven development tasks.
"""
def __init__(self, project_path: str, llm: str = "gpt-4o-mini"):
def __init__(self, project_path: str, llm: str = "gpt-5-nano"):
self.project_path = project_path
self.llm = llm
self.context_data = {}
@@ -382,7 +382,7 @@ def run_example_workflow():
project_path = str(project_root)
workflow = ContextEngineeringWorkflow(
project_path=project_path,
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Example feature request
@@ -446,7 +446,7 @@ if __name__ == "__main__":
print("(Note: Full execution requires complete environment setup)")
project_path = str(project_root)
workflow = ContextEngineeringWorkflow(project_path, "gpt-4o-mini")
workflow = ContextEngineeringWorkflow(project_path, "gpt-5-nano")
print(f"\n✅ Workflow Setup Complete:")
print(f" • Project path: {project_path}")
@@ -68,7 +68,7 @@ def method_1_simple_loop():
goal="Process each task from the CSV file efficiently",
backstory="Expert at handling repetitive tasks from CSV data",
instructions="Process each task thoroughly and provide detailed output",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Create a loop task that will automatically process each CSV row
@@ -127,7 +127,7 @@ def method_2_manual_csv():
4. Create a summary of the processing results
5. Save results to a new CSV file if needed
""",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Create a task for manual CSV processing
@@ -187,7 +187,7 @@ def method_3_url_processing():
4. Create a detailed analysis report
5. Save results with analysis data
""",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Create the URL processing task
@@ -264,7 +264,7 @@ def method_4_advanced_processing():
4. Create separate files for valid and invalid data
5. Provide detailed validation reports
""",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Create a processing agent
@@ -281,7 +281,7 @@ def method_4_advanced_processing():
3. Generate comprehensive results
4. Create detailed output reports
""",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Create validation task
@@ -140,7 +140,7 @@ def main():
instructions="You are an AI research assistant. Use your knowledge base to answer questions about artificial intelligence topics.",
knowledge=sample_documents, # Will use default knowledge config
knowledge_config=rerank_config, # Use reranking config
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
print("7. Agent with reranking knowledge:")
+1 -1
View File
@@ -16,7 +16,7 @@ rag_agent = Agent(
name="RAG Agent",
role="Information Specialist",
goal="Retrieve knowledge efficiently",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Define a task for the agent
@@ -2,7 +2,7 @@ from praisonaiagents import Agent, Task, PraisonAIAgents
agent = Agent(
instructions="You are a loop agent that creating a loop of tasks.",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
task = Task(
@@ -20,7 +20,7 @@ reflection_agent = Agent(
self_reflect=True,
min_reflect=2,
max_reflect=4,
reflect_llm="gpt-4o-mini",
reflect_llm="gpt-5-nano",
verbose=True
)
@@ -46,7 +46,7 @@ def main():
goal="Analyze each URL from the CSV list",
backstory="Expert at analyzing websites and URLs",
instructions="Analyze each URL and provide insights about the website",
llm="gpt-4o-mini" # You can change this to any supported model
llm="gpt-5-nano" # You can change this to any supported model
)
# Step 3: Create a task that will loop through the CSV
@@ -27,7 +27,7 @@ def example_with_tool():
role="Information Researcher",
goal="Research and provide information",
tools=[latency_tracking_tool], # Add our custom tool
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Start tracking manually
@@ -60,7 +60,7 @@ def example_with_wrappers():
name="Analyst",
role="Data Analyst",
goal="Analyze data and provide insights",
llm="gpt-4o-mini",
llm="gpt-5-nano",
request_id="request_2" # Unique request ID
)
@@ -83,7 +83,7 @@ def example_with_context_manager():
name="Calculator",
role="Math Expert",
goal="Solve mathematical problems",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
request_id = "request_3"
@@ -126,7 +126,7 @@ def example_mcp_tracking():
name="Assistant",
role="MCP Assistant",
goal="Handle MCP requests",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
plan = agent.chat("Plan: Search for Python documentation")
@@ -166,7 +166,7 @@ def example_concurrent_tracking():
name=f"Agent_{i}",
role="Concurrent Worker",
goal="Process requests concurrently",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
with tracker.track("processing", request_id):
@@ -56,7 +56,7 @@ def create_mcp_agent_with_tracking(request_id: str = "mcp_request"):
name="MCPAssistant",
role="MCP Request Handler",
goal="Handle MCP requests with latency tracking",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
return agent
@@ -23,7 +23,7 @@ def handle_mcp_request(query: str, request_id: str = "mcp_1"):
name="Assistant",
role="MCP Handler",
goal="Process requests",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
plan = f"I will search for information about {query}"
time.sleep(0.1) # Simulate planning time
+4 -4
View File
@@ -29,7 +29,7 @@ qa_generator = Agent(
role="Question Creator",
goal="Create challenging math and logic questions",
backstory="Expert in educational content creation",
llm="gpt-4o-mini",
llm="gpt-5-nano",
tools=[write_csv, count_questions]
)
@@ -38,7 +38,7 @@ total_questions_evaluator = Agent(
role="Total Questions Evaluator",
goal="Evaluate the total number of questions in qa_pairs.csv file",
backstory="Expert in evaluating the total number of questions in a file",
llm="gpt-4o-mini",
llm="gpt-5-nano",
tools=[count_questions],
verbose=False
)
@@ -49,7 +49,7 @@ cot_generator = Agent(
goal="Generate and manage chain of thought solutions for Q&A pairs",
backstory="Expert in breaking down problems and generating detailed solution steps",
tools=[cot_save],
llm="gpt-4o-mini",
llm="gpt-5-nano",
verbose=False
)
@@ -59,7 +59,7 @@ upload_to_huggingface = Agent(
goal="Upload the generated chain of thought solutions to a Huggingface dataset",
backstory="Expert in saving data to Huggingface",
tools=[cot_upload_to_huggingface],
llm="gpt-4o-mini",
llm="gpt-5-nano",
verbose=False
)
@@ -23,13 +23,13 @@ def code_interpreter(code: str):
code_agent = Agent(
name="code_agent",
llm="gpt-4o-mini",
llm="gpt-5-nano",
backstory="Expert in writing Python scripts",
self_reflect=False
)
execution_agent = Agent(
name="execution_agent",
llm="gpt-4o-mini",
llm="gpt-5-nano",
backstory="Expert in executing Python scripts",
self_reflect=False,
tools=[code_interpreter]
+4 -4
View File
@@ -127,9 +127,9 @@ def main():
verbose=True,
allow_delegation=False,
tools=[internet_search_tool],
llm="gpt-4o",
llm="gpt-5-nano",
markdown=True,
reflect_llm="gpt-4o",
reflect_llm="gpt-5-nano",
min_reflect=2,
max_reflect=4
)
@@ -142,7 +142,7 @@ def main():
making complex tech topics interesting and easy to understand.""",
verbose=True,
allow_delegation=True,
llm="gpt-4o",
llm="gpt-5-nano",
tools=[],
markdown=True
)
@@ -195,7 +195,7 @@ def main():
tasks=[task1, task2, task3, task4],
verbose=True,
process="sequential",
manager_llm="gpt-4o"
manager_llm="gpt-5-nano"
)
agents.start()
@@ -39,9 +39,9 @@ researcher = Agent(
verbose=True,
allow_delegation=False,
tools=[internet_search_tool],
llm="gpt-4o",
llm="gpt-5-nano",
markdown=True,
reflect_llm="gpt-4o",
reflect_llm="gpt-5-nano",
min_reflect=2,
max_reflect=4
)
@@ -53,7 +53,7 @@ writer = Agent(
making complex tech topics interesting and easy to understand.""",
verbose=True,
allow_delegation=True,
llm="gpt-4o",
llm="gpt-5-nano",
tools=[],
markdown=True
)
@@ -104,7 +104,7 @@ agents = PraisonAIAgents(
tasks=[task1, task2, task3, task4],
verbose=False,
process="sequential", # "sequential" or "hierarchical"
manager_llm="gpt-4o"
manager_llm="gpt-5-nano"
)
result = agents.start()
+2 -2
View File
@@ -33,14 +33,14 @@ def main():
role="Research Analyst",
goal="Research and document key information about topics",
backstory="Expert at analyzing and storing information in memory",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
retriever = Agent(
role="Information Retriever",
goal="Retrieve and verify stored information from memory",
backstory="Specialist in searching and validating information from memory",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
# Task 1: Process the facts
+3 -3
View File
@@ -9,19 +9,19 @@ fact3 = "The year the first Josinga was released is 2007"
fact_agent = Agent(
name="Fact Agent",
instructions="You are a fact agent, you store and retrieve facts in memory",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
research_agent = Agent(
name="Research Agent",
instructions="You are a research analyst, you research and document key points about topics",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
blog_agent = Agent(
name="Blog Agent",
instructions="You are a blog writer, you write a blog post about the research",
llm="gpt-4o-mini"
llm="gpt-5-nano"
)
fact_task = Task(
Loaded 100 of 416 files, more files were not shown because too many files have changed in this diff. Show more