Knowledge Base
Upload documents, websites, and text to give your assistant domain expertise
Overview
The knowledge base lets you provide your assistant with specific information about your business. Instead of relying solely on the AI model's general knowledge, your assistant can reference your documentation, FAQs, product catalogs, and policies to give accurate, relevant answers.
For the full API reference, see api.happ.tools/reference.
Knowledge Types
URL
Import content from a web page:
- Go to your assistant's Knowledge tab
- Click Add Knowledge > URL
- Paste the URL of the page to import
- Enter a name and optional description
- Click Save
Happ crawls the page and extracts its content for the assistant.
Best for: Documentation pages, FAQ pages, product catalogs, blog posts.
Text
Add content directly:
- Click Add Knowledge > Text
- Enter a name
- Paste or type the content
- Click Save
Best for: Company policies, FAQs, specific instructions, frequently referenced info.
File Upload
Upload documents:
- Click Add Knowledge > File
- Upload your document
- Enter a name and optional description
- Click Save
Supported formats and limits:
| Format | Extension | Max Size |
|---|---|---|
.pdf | 50 MB | |
| Word | .docx | 50 MB |
| Text | .txt | 10 MB |
Via API
POST /api/assistant-knowledge
X-Access-Token: happ_your_token_here
Content-Type: application/json
{
"assistantId": "your-assistant-uuid",
"name": "Company FAQ",
"type": "text",
"resourceContent": "Your FAQ content here..."
}For file uploads, use Content-Type: multipart/form-data.
How It Works
- Upload — Documents are stored securely
- Processing — Text is extracted and split into chunks
- Embedding — Chunks are converted to vector embeddings (using OpenAI text-embedding-3-large)
- Search — When a user asks a question, the system finds the most relevant chunks
- Response — The assistant uses the retrieved context to generate an accurate answer
Two Types of Knowledge Retrieval
Direct Knowledge (Non-Vector)
For smaller knowledge items, the content is appended directly to the assistant's system prompt. The AI sees the full text on every message.
Best for: Short content (FAQs, business hours, policies) where everything is always relevant.
Vector Search
For large knowledge bases, Happ uses vector search powered by Qdrant. This finds the most semantically relevant information for each question.
How vector search works:
- The user's question is converted to a vector embedding
- The system searches the vector database for the closest matches
- A dynamic score threshold filters results (75% of best score, minimum 0.32)
- The top 3 most relevant chunks are passed to the AI as context
Enabling vector search requires a Qdrant integration:
- Go to Integrations > Add Integration > Qdrant
- Enter your Qdrant API URL and API key
- Specify a collection name
- Toggle Vector on when creating knowledge entries
Best for: Large document collections where only specific sections are relevant per question.
Built-in searchKnowledge Tool
When your assistant has vector knowledge, a built-in searchKnowledge tool is automatically available. The AI calls it when it needs to look up information, searching with a query and receiving up to 3 relevant results.
Managing Knowledge
Listing
GET /api/assistant-knowledge?assistantId={assistantId}
X-Access-Token: happ_your_token_hereUpdating
Click any knowledge entry to update its content, name, or description.
Deleting
DELETE /api/assistant-knowledge/{knowledgeId}
X-Access-Token: happ_your_token_hereBest Practices
- Be specific — Include exact details (prices, hours, addresses) rather than vague descriptions
- Keep it current — Update knowledge when your business information changes
- Structure content — Use clear headings and bullet points for better retrieval
- Use direct knowledge for essentials — Business hours, policies, and key info should be non-vector so the AI always sees them
- Use vector search for large docs — Product catalogs, manuals, and FAQ collections work best as vector knowledge
- Test thoroughly — Ask your assistant questions to verify it retrieves the right information