You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Memory snippet passes user_id= on Agent — constructor has no such kwarg; user_id is modeled on MemoryConfig.
Symptom B
RAG snippet passes knowledge= and knowledge_sources= together — knowledge_sources is not an Agent kwarg.
Root cause
Marketing examples flatten nested config into top-level Agent kwargs that never existed on the consolidated Agent API.
Impact
Same homepage surface as reflection issue — high-trust, high-failure copy-paste path.
Fix
PraisonAIDocs — nest user_id under memory=MemoryConfig(...) or supported dict; collapse multi-source knowledge into a singleknowledge= value (list, KnowledgeConfig, paths).
2. Architecture — where user_id lives
2.1 Agent constructor (excerpt)
Agent.__init__ exposes memory= but notuser_id= as a top-level parameter (see full signature in agent.py).
After resolution, Agentextractsuser_id / session_id from the resolved MemoryConfig into internal fields — users must supply them viamemory=, not alongside memory=True as a sibling kwarg.
Agent accepts knowledge= as a consolidated parameter (bool, str, list, KnowledgeConfig, … — see Agent signature and resolve() call sites for knowledge).
There is no separate knowledge_sources= keyword on Agent.
Design principle: one consolidated param → one argument tree; multiple sources should be expressed inside that tree (e.g. list of paths, KnowledgeConfig(sources=[...]), documented shorthand).
flowchart LR
subgraph Wrong2["home.mdx RAG snippet"]
K1["knowledge='./docs/'"]
K2["knowledge_sources=[...]"]
end
subgraph Right2["Target model"]
U1["knowledge=['./docs/', 'https://...', './pdfs/']"]
U2["knowledge=KnowledgeConfig(sources=[...])"]
end
Wrong2 --> TE2["TypeError: knowledge_sources"]
U1 --> OK2["Single param"]
U2 --> OK2
1. Executive summary
user_id=onAgent— constructor has no such kwarg;user_idis modeled onMemoryConfig.knowledge=andknowledge_sources=together —knowledge_sourcesis not anAgentkwarg.Agentkwargs that never existed on the consolidatedAgentAPI.user_idundermemory=MemoryConfig(...)or supported dict; collapse multi-sourceknowledgeinto a singleknowledge=value (list,KnowledgeConfig, paths).2. Architecture — where
user_idlives2.1
Agentconstructor (excerpt)Agent.__init__exposesmemory=but notuser_id=as a top-level parameter (see full signature inagent.py).2.2
MemoryConfigcarries identityFile:
praisonaiagents/config/feature_configs.pyAfter resolution,
Agentextractsuser_id/session_idfrom the resolvedMemoryConfiginto internal fields — users must supply them viamemory=, not alongsidememory=Trueas a sibling kwarg.flowchart TB subgraph Wrong["home.mdx memory snippet"] W["Agent(..., memory=True, user_id='...')"] end subgraph Right["Supported shapes"] R1["Agent(..., memory=MemoryConfig(backend='file', user_id='...'))"] R2["Agent(..., memory={'backend':'file','user_id':'...'}) # if resolver accepts"] end Wrong --> TE["TypeError: unexpected keyword argument 'user_id'"] R1 --> OK["Construct OK"]3. Architecture —
knowledge=surfaceAgentacceptsknowledge=as a consolidated parameter (bool,str, list,KnowledgeConfig, … — seeAgentsignature andresolve()call sites for knowledge).There is no separate
knowledge_sources=keyword onAgent.Design principle: one consolidated param → one argument tree; multiple sources should be expressed inside that tree (e.g. list of paths,
KnowledgeConfig(sources=[...]), documented shorthand).flowchart LR subgraph Wrong2["home.mdx RAG snippet"] K1["knowledge='./docs/'"] K2["knowledge_sources=[...]"] end subgraph Right2["Target model"] U1["knowledge=['./docs/', 'https://...', './pdfs/']"] U2["knowledge=KnowledgeConfig(sources=[...])"] end Wrong2 --> TE2["TypeError: knowledge_sources"] U1 --> OK2["Single param"] U2 --> OK24. Doc inventory — failing blocks
4.1 Persistent Memory (~L96–102)
4.2 Knowledge Bases (~L108–116)
5. Reproduction
6. Suggested replacements (verify against
KnowledgeConfigdocs)Memory (illustrative):
Knowledge (illustrative):
Adjust
KnowledgeConfigusage if the site standard is to always show explicit config objects for RAG-heavy examples.7. Gap analysis
user_idonAgentknowledge_sourcesonAgent8. Acceptance criteria
user_id=onAgent; identity is undermemory=.knowledge_sources=; all sources appear underknowledge=only.TypeErroron documentedpraisonaiagents.docs/concepts/memory.mdx,docs/concepts/knowledge.mdx(or equivalents).9. Boundary
Agent(user_id=...)kwargs in PraisonAI (would be separate product decision + ADR).browseraccordionagent.run(separate review).10. References
praisonaiagents/agent/agent.py—memoryextraction fromMemoryConfigpraisonaiagents/config/feature_configs.py—MemoryConfig,KnowledgeConfigdocs/home.mdx— edit target11. Suggested labels
documentation,bug,homepage,memory,knowledge,rag,dx