Skip to content

Chat infrastructure

A chat API with memory
and your documents built in.

POST a message and get an answer. VectorForgeAI keeps the thread, pulls the right passages out of your documents, runs your functions, and scores how the conversation went, so none of it has to live in your database.

Memory · Retrieval · Tool calling · Outcome scoring

POST /v1/messages

Turn 1 · user

Do you ship to Norway?

Turn 1 · assistant

Yes. Orders to Norway are sent with DHL and clear customs in Oslo.

Turn 2 · user

How long does it take to get there?

What happens next

  1. 01 Rewrite there → Norway, from the last 3 turns
  2. 02 Retrieve 3 documents · 3 chunks each
  3. 03 Rerank 30 chunks scored, top 5 kept
  4. 04 Answer low temperature · names its source

Turn 2 · assistant

Deliveries to Norway take three to five working days after dispatch.

0.81 shipping-zones.md · chunk 4

Inside one request

What happens between the question and the answer

Most chat APIs give you a model and leave the retrieval to you. These four steps run on every message you send.

  1. 01

    Resolve the follow-up

    A question like “how long does it take to get there?” means nothing on its own. The last three turns are folded into the search query before anything is retrieved.

  2. 02

    Retrieve

    Passages are pulled from the collections you attached to the conversation. Documents per turn and chunks per document are both yours to set.

  3. 03

    Rerank

    Candidate chunks are scored against the resolved query and cut to the ones that earn their place in the prompt.

  4. 04

    Answer

    The model replies at temperature 0.15 with the retrieved passages in context, and the response names the documents it used.

Memory

You only have to store the conversation id

The first call returns a conversation_id. Send it with the next message and the history, the retrieved context, and the tool definitions are all still there.

user
Your own identifier for the person talking. Conversations are scoped to it, so one customer can never be handed another one's thread.
system_context
The instructions that define the assistant. Set it once, or change it mid-conversation when the context changes.
collections
Which document collections this conversation is allowed to read from.
Continue a thread
curl -X POST https://api.vectorforgeai.com/v1/messages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Team-Token: $TEAM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "user": "user_12345",
    "conversation": "jkl789mno012",
    "message": "How long does it take to get there?"
  }'

Tool calling

The assistant can call your own functions

Describe a function and its parameters. When the assistant wants it, the response comes back as type: "tool_calls" instead of an answer. You run it wherever your data lives and post the result back.

  • Your code executes the function, so credentials never leave your infrastructure.
  • Parameters are typed: string, number, boolean, enum, object, or array.
  • Schemas are enforced strictly, so arguments arrive in the shape you declared.
  • Set no_tools on a request when you want a plain answer instead.
Return a tool result
curl -X POST https://api.vectorforgeai.com/v1/messages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Team-Token: $TEAM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "user": "user_12345",
    "conversation": "jkl789mno012",
    "tool_results": [{
      "tool_id": "call_abc123",
      "tool_name": "order_status",
      "arguments": { "order_id": "A-4471" },
      "result": "Dispatched 12 March, arriving 17 March"
    }]
  }'

# No message field. The assistant answers using the result.

After the conversation

Ratings, reviews, and outcome scores

Every thread is rated and reviewed, so you can see which questions the assistant failed to answer and what it was missing.

Ratings per answer

Put a thumbs up and down next to each reply and post it to the rating endpoint. The score attaches to that message, not the whole thread.

A review of every thread

Each conversation is reviewed for what the person wanted, whether they got it, and what would have helped — a missing document, or a tool you have not built yet.

Happiness, 1 to 10

Estimated from the tone of the person's messages and how the thread ended.

≤5 failed 6–7 neutral ≥8 good

The dashboard turns these into activity over time, outcome mix, average thread length, which tools get called, and how many people come back.

Running it

Long threads, errors, limits, and retention

Long threads
Past roughly 75,000 tokens a conversation moves to a smaller model so a long thread stays affordable instead of failing.
Upstream errors
Requests are retried before they are given up on, and a blocked response returns a clear error rather than an empty answer.
Budget reached
A conversation that hits your usage limit is marked instead of silently dropping messages.
Retention
Conversations are deleted after 30 days. Closing the account removes everything.

Get a conversation running today

One POST gets you an answer. Everything else on this page is already switched on.