API Documentation

FluxVector API — 8-signal HyperSearch with built-in embeddings, RAG answer generation, agentic search, and MCP tool integration. All endpoints require authentication.

Quickstart — Chatbot in 5 Minutes

Go from zero to a working AI chatbot in 5 steps. All you need is an API key from the Console.

1. Install
# Python
pip install fluxvector
2. Create a collection + upload your docs
from fluxvector import FluxVector

fv = FluxVector(api_key="fv_live_your_key")

# Create a knowledge base
fv.collections.create("my-docs")

# Upload your documents
fv.vectors.upsert("my-docs", [
    {"id": "1", "text": "Check-in is at 3pm, check-out at 11am"},
    {"id": "2", "text": "Pool is open 7am-10pm daily"},
    {"id": "3", "text": "WiFi password is guest2026"},
])
3. Search
results = fv.search("my-docs", "pool hours")

for r in results:
    print(f"{r.score:.2f} — {r.text}")
# 0.94 — Pool is open 7am-10pm daily
4. Get an AI answer with citations
answer = fv.answer.create("my-docs", "What time does the pool close?")

print(answer.answer)       # "The pool closes at 10pm. [1]"
print(answer.confidence)   # 0.95
print(answer.sources)      # [{index: 1, id: "2", score: 0.94}]
5. Chat with session memory
chat = fv.chat.create("my-docs", "Is there a pool?", session_id="guest-1")
print(chat.message)  # "Yes, the pool is open 7am-10pm daily. [1]"

# Follow-up — remembers context
chat2 = fv.chat.create("my-docs", "What about towels?", session_id="guest-1")
6. Use Claude or OpenAI for better answers (Pro/Scale plans)
# Pass your own LLM key for faster, higher-quality generation
answer = fv.answer.create(
    "my-docs", "What time is check-in?",
    llm_provider="claude",
    llm_api_key="sk-ant-your-key",
)
# 300ms with Claude vs 4-30s with built-in Ollama

That's it. You have a chatbot backed by 8-signal search with anti-hallucination confidence. See more use cases or read the full API reference below.

Embeddable Widget

Add a chatbot to any website with one line of HTML. No code needed.

HTML
<script
  src="https://fluxvector.dev/static/widget.js"
  data-collection="my-docs"
  data-key="fv_live_your_key"
></script>

Optional attributes: data-llm-provider ("claude" or "openai"), data-llm-key, data-greeting, data-position ("right" or "left"), data-theme ("dark" or "light").

Authentication

All requests require a Bearer token in the Authorization header. Get your API key from the Console.

Header
Authorization: Bearer fv_live_your_api_key_here

SDKs

Install
# Python
pip install fluxvector

# TypeScript / Node.js
npm install @fluxsoft/fluxvector

# LangChain integration
pip install langchain-fluxvector

Search Modes

FluxVector supports 4 search modes via the mode parameter.

ModeDescription
fusion8-signal HyperSearch. Combines 8 signals with proprietary fusion scoring and anti-hallucination confidence. Best quality.
hybridKeyword + semantic combined. Good balance of speed and quality.
vectorEmbedding similarity only. Fastest, semantic meaning only.
keywordExact keyword matching only.

Search

POST/v1/answer

RAG Answer

Full RAG in one call: search with HyperSearch, generate an answer from retrieved documents, and cite sources. If confidence is too low, returns "I don't have reliable information" instead of hallucinating.

ParameterTypeDescription
collectionrequiredstringCollection name
questionrequiredstringQuestion to answer
top_koptionalintDocuments to retrieve (default: 5)
Response
{
  "answer": "To deploy, use Docker Compose [1] and configure the environment variables [2]...",
  "confidence": 0.91,
  "sources": [{"index": 1, "id": "doc-1", "score": 0.92}],
  "generated": true
}
POST/v1/chat

Conversational Chat

Stateful conversational RAG. Send a message with a session ID — the server maintains conversation history, searches the collection, and generates a contextual response with citations.

ParameterTypeDescription
collectionrequiredstringCollection name
messagerequiredstringUser message
session_idoptionalstringSession ID for conversation continuity. Auto-generated if omitted.
top_koptionalintSource documents to retrieve (default: 5)
modeloptionalstringLLM model for generation
llm_provideroptionalstringLLM provider: "ollama" (default, free), "claude", or "openai"
llm_api_keyoptionalstringYour API key for Claude or OpenAI. Not stored. Required if llm_provider is claude/openai.
Response
{
  "message": "The pool is open from 7am to 10pm. [1]",
  "confidence": 0.91,
  "sources": [{"index": 1, "id": "faq-2", "score": 0.93}],
  "generated": true,
  "session_id": "sess_abc123",
  "history_length": 4
}

Data Management

POST/v1/collections

Create Collection

Create a new vector collection.

ParameterTypeDescription
namerequiredstringCollection name (alphanumeric + hyphens)
dimensionoptionalintVector dimension (default: 1024)
GET/v1/collections

List Collections

List all collections for your account with vector counts.

DELETE/v1/collections/{name}

Delete Collection

Delete a collection and all its vectors. This is irreversible.

POST/v1/vectors/upsert

Upsert Vectors

Add or update documents. Text is automatically embedded with multiple models server-side.

ParameterTypeDescription
collectionrequiredstringCollection name
namespaceoptionalstringNamespace for multi-tenant isolation (default: "")
vectorsrequiredarrayArray of {id, text, metadata}
Request
{
  "collection": "docs",
  "vectors": [
    {"id": "1", "text": "Your document text", "metadata": {"category": "guide"}}
  ]
}
POST/v1/vectors/delete

Delete Vectors

Delete vectors by ID from a collection.

ParameterTypeDescription
collectionrequiredstringCollection name
idsrequiredarrayArray of vector IDs to delete
GET/v1/vectors/fetch

Fetch Vectors

Retrieve vectors by their IDs. Max 500 per request.

ParameterTypeDescription
collectionrequiredstringCollection name (query param)
idsrequiredstringComma-separated vector IDs (query param)
POST/v1/vectors/ingest

Ingest URL

Crawl a URL, extract text, chunk it, and upsert all chunks into a collection. Handles HTML, plain text, and markdown.

ParameterTypeDescription
collectionrequiredstringCollection name
urlrequiredstringURL to crawl (http or https)
metadataoptionalobjectMetadata to attach to all chunks
doc_idoptionalstringDocument ID (auto-generated if omitted)
chunk_sizeoptionalintCharacters per chunk (default: 2048)
chunk_overlapoptionalintOverlap between chunks (default: 256)
Response
{
  "ingested": true,
  "url": "https://example.com/docs",
  "doc_id": "abc123",
  "chunks": 12,
  "characters": 8500,
  "upserted": 12
}

Utilities

POST/v1/embed

Embed Text

Get the embedding vector for a single text. Useful for pre-computing embeddings or debugging.

ParameterTypeDescription
textrequiredstringText to embed (max 32KB)
modeloptionalstringModel key (server default). See GET /v1/models.
POST/v1/embed/batch

Batch Embed

Embed multiple texts in one call. Batch limits depend on plan (Free: 5, Pro: 50, Scale: 100).

ParameterTypeDescription
textsrequiredarrayArray of strings to embed
modeloptionalstringModel key (server default)
GET/v1/models

List Models

List all available embedding models with their dimensions and enabled status.

MCP (AI Agent Integration)

GET/v1/mcp/tools

List MCP Tools

Returns MCP tool definitions that any AI agent (Claude, ChatGPT, etc.) can use to search FluxVector. Tools: fluxvector_search, fluxvector_answer, fluxvector_upsert, fluxvector_collections.

POST/v1/mcp/execute

Execute MCP Tool

Execute a tool call from an AI agent. The agent sends the tool name and arguments, FluxVector runs the operation and returns formatted results.

ParameterTypeDescription
namerequiredstringTool name (fluxvector_search, fluxvector_answer, fluxvector_upsert, fluxvector_collections)
argumentsrequiredobjectTool arguments (varies by tool)

Training Data

POST/v1/training/generate

Generate Synthetic Training Data

Generate hypothetical questions for documents in a collection. Creates (question, document) pairs for fine-tuning.

ParameterTypeDescription
collectionrequiredstringCollection name
limitoptionalintMax documents to process (default: 50)
POST/v1/training/flush

Flush Training Data

Flush collected training pairs from memory to the database.

GET/v1/training/stats

Training Stats

Get counts of collected training pairs (real usage vs synthetic).