Skip to main content

Quick Start

1

Install Package

Install PraisonAI Agents with knowledge support:
2

Set API Key

Set your OpenAI API key:
3

Create Script

Create a new file app.py:

Basic Usage

The simplest way to create a knowledge-based agent is without any configuration:

Advanced Configuration

For more control over retrieval behavior, use the knowledge dict:

Getting Answers with Citations

Use agent.query() for structured answers with source citations:

Retrieval-Only (No LLM Generation)

Use agent.retrieve() to get context without LLM generation:

Multi-Agent Knowledge System

For more complex scenarios, you can create a knowledge-based system with multiple agents:

Understanding Knowledge Configuration

  • Provider: Choose between different vector store backends (e.g., “chroma”)
  • Collection Name: Name for your knowledge collection
  • Path: Location to store the vector database
  • PDF documents (*.pdf)
  • Text files (*.txt)
  • Markdown files (*.md, *.mdx)
  • And more…
  • Role: Define specialized roles for knowledge agents
  • Goal: Set specific knowledge management objectives
  • Process: Choose between sequential or parallel execution

Features

Custom Knowledge

Import your own documents and data as knowledge sources

Vector Storage

Efficient storage and retrieval of knowledge embeddings

Multiple Sources

Combine multiple documents and file types

Persistent Storage

Save and reuse knowledge bases across sessions

Best Practices

  1. Document Preparation
    • Clean and well-formatted documents work best
    • Break large documents into smaller chunks
    • Use consistent formatting
  2. Knowledge Organization
    • Group related documents together
    • Use meaningful file names
    • Keep knowledge bases focused and relevant
  3. Performance Optimization
    • Monitor vector store size
    • Clean up unused collections
    • Use appropriate chunk sizes
  4. Multi-Agent Coordination
    • Define clear roles and responsibilities
    • Set appropriate logging levels for debugging
    • Use unique collection names for different agent groups

Next Steps