Knowledge & Memory

What is Knowledge

Learn how the knowledge base enables your AI agents to access and reference your documents and data.

March 18, 2024
5 min read

Knowledge is your agent's reference library—documents, data, and information that your AI agent can search and use when responding to questions.

How Knowledge Works

When you add documents to an agent's knowledge base, AffinityBots:

  1. Processes the document into smaller chunks
  2. Generates embeddings (vector representations) for each chunk
  3. Stores these embeddings in a searchable database
  4. Retrieves relevant chunks when the agent needs information

This process is called RAG (Retrieval Augmented Generation)—your agent retrieves relevant knowledge before generating responses.

Why Use Knowledge

Without KnowledgeWith Knowledge
Agent relies only on its training dataAgent accesses your specific documents
Generic responsesResponses grounded in your data
Can't answer company-specific questionsAnswers based on your actual content
May hallucinate factsReferences real information

Supported File Types

You can upload various document formats:

FormatExtensionBest For
PDF.pdfReports, manuals, documentation
Word.docxDocuments, guides, policies
Text.txtPlain text content
CSV.csvStructured data, lists
Excel.xlsxSpreadsheets, data tables

Adding Knowledge to Your Agent

  1. Open your agent's configuration
  2. Navigate to the "Knowledge" tab
  3. Click "Upload Document"
  4. Select your file(s)
  5. Wait for processing to complete

Knowledge Base Upload

[!TIP] You can upload multiple documents at once. Each document is processed independently.

How Retrieval Works

When a user asks a question:

User Question → Search Knowledge Base → Find Relevant Chunks → Include in Agent Context → Generate Response

The agent automatically:

  1. Analyzes the user's question
  2. Searches the knowledge base for relevant content
  3. Includes the most relevant chunks in its context
  4. Generates a response using this information

Best Practices

Document Preparation

  • Clean formatting: Remove unnecessary headers, footers, and formatting
  • Clear structure: Use headings to organize content
  • Concise content: Remove redundant information
  • Update regularly: Keep documents current

Content Organization

  • One topic per document: Makes retrieval more accurate
  • Descriptive filenames: Helps with organization
  • Remove duplicates: Avoid conflicting information
  • Version control: Replace outdated documents

Optimal Document Size

Document SizeRecommendation
< 10 pages✅ Ideal
10-50 pages✅ Good
50-100 pages⚠️ Consider splitting
> 100 pages❌ Split into smaller docs

Managing Your Knowledge Base

Viewing Documents

  1. Go to agent configuration → Knowledge tab
  2. See all uploaded documents with:
    • File name
    • Upload date
    • Processing status
    • File size

Deleting Documents

  1. Find the document in the list
  2. Click the trash icon
  3. Confirm deletion

[!WARNING] Deleting a document removes all its chunks from the knowledge base. The agent will no longer be able to reference this content.

Updating Documents

To update a document:

  1. Delete the old version
  2. Upload the new version

The knowledge base will be updated with the new content.

Troubleshooting

Agent not finding information

  • Verify the document was processed successfully
  • Check if the question relates to the document content
  • Try rephrasing the question
  • Ensure the document contains the expected information

Processing taking too long

  • Large files take longer to process
  • PDFs with images take longer than text-only
  • Try splitting large documents

Incorrect responses

  • Review the source document for accuracy
  • Remove conflicting documents
  • Add more specific information

Related Guides