Skip to content

docs: fix Agent API architectural drift in home.mdx#217

Open
MervinPraison wants to merge 1 commit intomainfrom
claude/issue-205-20260422-0445
Open

docs: fix Agent API architectural drift in home.mdx#217
MervinPraison wants to merge 1 commit intomainfrom
claude/issue-205-20260422-0445

Conversation

@MervinPraison
Copy link
Copy Markdown
Owner

Summary

Fixes architectural drift between docs/home.mdx code examples and actual PraisonAI Agent constructor API.

  • Fixed memory example: moved user_id parameter into MemoryConfig instead of invalid top-level Agent kwarg
  • Fixed RAG example: consolidated knowledge sources into single knowledge= parameter, removed non-existent knowledge_sources= parameter
  • Added proper imports for MemoryConfig class
  • Ensured examples are copy-paste runnable and match actual SDK API

Changes

Memory Example (Lines 96-106)

Before: Invalid user_id as top-level Agent parameter

agent = Agent(
    name="assistant", 
    memory=True,
    user_id="user_123"  # ❌ Invalid - not an Agent constructor parameter
)

After: Proper nested configuration

from praisonaiagents import Agent, MemoryConfig

agent = Agent(
    name="assistant",
    memory=MemoryConfig(
        backend="file",
        user_id="user_123"  # ✅ Correct - user_id belongs in MemoryConfig
    )
)

RAG Example (Lines 112-123)

Before: Conflicting parameters

agent = Agent(
    name="researcher",
    knowledge="./docs/",
    knowledge_sources=[    # ❌ Invalid - not an Agent constructor parameter
        "https://example.com/api", 
        "./pdfs/"
    ]
)

After: Consolidated single parameter

from praisonaiagents import Agent

agent = Agent(
    name="researcher",
    knowledge=[            # ✅ Correct - single consolidated parameter
        "./docs/",
        "https://example.com/api",
        "./pdfs/"
    ]
)

Test Plan

  • Verified examples are syntactically correct
  • Confirmed user_id and session_id are defined in MemoryConfig class (praisonaiagents/config/feature_configs.py:191-193)
  • Confirmed knowledge_sources parameter does not exist on Agent constructor
  • Confirmed Agent accepts knowledge= as list of sources
  • Ensured proper imports are included for copy-paste success

Fixes #205

🤖 Generated with Claude Code

- Fix memory example: move user_id into MemoryConfig instead of top-level Agent kwarg
- Fix RAG example: consolidate knowledge sources into single knowledge= parameter
- Remove invalid knowledge_sources= parameter that doesn't exist on Agent constructor
- Add proper imports for MemoryConfig class
- Ensure examples are copy-paste runnable and match actual SDK API

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

Co-authored-by: Mervin Praison <454862+MervinPraison@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 22, 2026 04:48
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@MervinPraison has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 40 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 57 minutes and 40 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c9b2368-b85c-46d9-af59-c0deee61fdd0

📥 Commits

Reviewing files that changed from the base of the PR and between 95ceda2 and a29086a.

📒 Files selected for processing (1)
  • docs/home.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-205-20260422-0445

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation in docs/home.mdx to reflect changes in the Agent configuration, specifically introducing the MemoryConfig class for persistent memory and consolidating knowledge sources into a single list. A review comment identifies that the documentation example includes a URL as a knowledge source, which is currently unsupported by the SDK's implementation and could lead to confusion.

Comment thread docs/home.mdx
knowledge_sources=[ # Or multiple sources
knowledge=[ # Multiple knowledge sources
"./docs/",
"https://example.com/api",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example includes a URL as a knowledge source, but the current implementation of Agent._process_knowledge in praisonaiagents/agent/agent.py (lines 4403-4405) contains a pass statement for URLs, meaning they are currently ignored during knowledge processing. Additionally, Knowledge.add (line 451) raises a NotImplementedError for URLs. To ensure the example is fully functional and matches the current SDK capabilities as stated in the PR description, consider using only local file paths for now.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] Architectural drift: home.mdx memory + RAG snippets vs Agent constructor surface

2 participants