Panel: Resources
On this page
Resources are what the assistant can use: your documents, notes, APIs, code and databases, arranged in a tree of folders. The assistant finds them by their summaries and uses them through their methods, always within your access rules.
API: Resources section (/resources, /groups), see the API reference. A key or sub user reaches only the folders it was given: read to look, manage to change.
Kinds
| Kind | What it is | How the assistant uses it |
|---|---|---|
| Folder | Holds documents and other resources. | Searches its documents; its own assistant knows what is inside. Rules on a folder can cover everything under it. |
| File | One document. | Searches and reads its text; can hand the file over. |
| API | Your system, called over HTTP. | Calls its methods (an HTTP method and path each). |
| Code | Your JavaScript or TypeScript, run by us in a sandbox. | Calls the exported function named after each method. |
| Database | Your Postgres, MySQL or MariaDB, queried live. | Runs the SQL you wrote for each method, or, with free read access, writes its own read queries. |
| Notes | Markdown notes written in chat or here. | Searches, reads, saves and deletes notes. |
Creating a resource
New resource, then:
- Kind, Name, and Inside (the folder it goes in, or the top level).
- Summary (required): what it is and what it can do. The orchestrator finds resources by this, so say what questions it answers ("Employee leave balances and leave requests; can apply for leave"). For a folder: what it holds and what it is for.
- Purpose: Data serves requests; Verifier proves who a user is (see Access rules). Not for folders and files.
- Who decides access: Determesh, from the access rules (the usual choice), or The resource itself (API and code only): before each use we ask it. Files, folders, notes and databases always use the rules.
- API only: Base URL (such as https://api.example.com), Access check path (if the resource decides access: we POST here to ask if a user is allowed), and Headers sent on every call (one per line,
Name: value, such asAuthorization: Bearer ...; stored encrypted, never shown again). - Code only: Hosts the code may reach, comma separated (such as api.bank.com). Empty means no network at all. A code resource that decides access must export
checkAccess(request). - Database: after creating, you give its connection and write a SQL statement per method.
A resource's page
Settings
Name, purpose, who decides access, the folder it is in (moving it), its verification group, its summary, and for an API the base URL, access check path and headers (Replace headers; empty keeps them). Delete removes the resource and everything under it, with its methods, rules and cached answers; a file being read or embedded can be deleted at any time.
Methods (API, code, database)
Each method is something the resource can do for a user. Add method:
| Field | Meaning |
|---|---|
| Name | lower_case, such as get_payslip. For code, the exported function of the same name. |
| Kind of action | Read, Write or Delete. Access rules allow each separately. |
| HTTP method and path (API) | GET, POST, PUT, PATCH or DELETE, and a path such as /employees/{id}/payslip. |
| SQL (database) | One statement, with :name for each parameter. Values are always sent separately, never pasted in. A Read method runs in a read-only session and can never change anything. |
| What it does | For the resource's assistant: when to use it. |
| What it returns | What the answer contains. |
| Parameters | Name, type (STRING, NUMBER, BOOLEAN, OBJECT), where it goes (body, query or path, for an API), required or not, a description, and whether it is filled by Determesh (below). |
Parameters filled by Determesh
Normally the AI fills a method's parameters from the conversation. For anything that identifies whose data to return, tick filled by Determesh and choose where the value comes from:
| Filled from | Value | API key / JSON (filledBy) |
|---|---|---|
| an attribute of the user | The attribute you or your systems set, such as employee_id |
user.attribute.employee_id |
| the email linked to the user | Their email linked by a verification, or the address they write in from on the email channel | user.email |
| their ID on the channel they write from | Your app's userId (API), their Telegram user ID, or their email address |
user.channel_id |
| their Determesh identity ID | The identity's ID | user.id |
Determesh's code puts in the value for the user being served, at the moment of the call. No AI sees or sets it, so nobody can ask for another person's records ("show me Priya's payslip" still gets the asker's own, or nothing). Attributes are only ever set by you in the panel or by your systems through the API, and an email is only linked by code, never by anything said in chat. If the user has no value (no employee_id set, no linked email), the call is not made and the user is told it cannot be done for them yet and that the company has to set it up. A test call from the panel takes the value you type. A method with such parameters cannot receive webhooks (no user is behind them).
Test calls a method with arguments you type (JSON) and shows the answer and, for code, its logs. A test is not billed and does not count as an action.
What a method's answer can carry, read by Determesh's code (never by the AI's wording):
"outcome": "SUCCEEDED" | "FAILED" | "NEEDS_USER"at the top: whether the call actually worked (a wrong OTP still answers normally). Optional.{"sendEmail": {"to", "subject", "text", "replyTo"}}: Determesh emails it (see Emails).{"sendMessage": {"channel", "to", "text", "subject", "replyTo", "awaitReply"}}: Determesh sends a message to someone and, if asked, brings their reply back (see Requests).- For a verifier:
{"verified": {"channel": "EMAIL", "externalId": "user@example.com"}}when the user is proved.
An answer is cut at 1 MB.
Code (code resources)
One script, JavaScript or TypeScript (up to 512 KB), run in a fresh sandbox for each call. Export a function per method, named like the method; it gets the arguments as one object and returns the answer.
export async function get_report(args) {
const res = await fetch(`https://api.bank.com/reports/${args.id}`, {
headers: { Authorization: `Bearer ${Deno.env.get("BANK_API_KEY")}` },
});
return { outcome: "SUCCEEDED", report: await res.json() };
}
npm:andjsr:imports are fetched when you Save and build (or Build again); calls then run offline with them. The page shows the build status, the exported functions, and methods with no function of that name.- Secrets: name and value, passed as environment variables (
Deno.env.get("NAME")), stored encrypted, never shown again. Names starting withDENO_are refused. - Limits per call: 256 MB of memory, 1 CPU, 10 seconds. Network only to the hosts you listed (and never to private addresses); no files, no other programs. See Limits.
Database (database resources)
Postgres, or MySQL / MariaDB: host, port, database name, login, password, and encryption (Required (TLS), or Off for a server without TLS). We connect with these before saving, so a wrong login is refused.
- We connect when the assistant needs it, run the statement, and close. Nothing is copied or kept.
- The database must be reachable from the internet. If it has a firewall, allow our server's address (write to hi@determesh.com for it).
- 10 seconds to connect, 30 seconds per statement.
How the AI uses it, chosen under the connection:
- Methods: the assistant runs only the SQL you save as methods, reading or writing (see Methods above). Give a login that can do only what the methods need. A method answers at most 200 rows.
- Free read access: the assistant writes its own read queries to answer anything, the way an analyst would. It starts with the database's map, read live on every question: every table and view the login can read, their columns, keys and comments, and 3 sample rows each. It writes a query, reads the result or the database's error, refines it, and answers. There are no methods in this mode.
Free read access, in detail:
- The login must only read. A login that can insert, update, delete or truncate anything, or is a superuser, is refused and nothing is saved. On top of that, every query is checked before it is sent (one statement, starting with SELECT or WITH), runs in a read-only transaction that is rolled back, and has the 30-second limit. Queries never change data.
- The AI can read everything the login can read, and anyone your access rules let into this resource can ask about any of it: access is to the whole database or none. Grant the login only the tables it should see.
- Notes for the AI (optional): what the tables mean, such as "one row per IN or OUT, times in UTC". The assistant also sees every table, so a short note is enough.
- Size: a result is not cut. A large one (over about 5% of what the AI model can hold, around 40,000 tokens today) is given to the assistant in parts: the first parts at once, the rest only if it reads on, and it is asked to have the database count or add up instead. Past 10 MB the result is not read and the assistant is told to narrow the query. The whole result is still kept for the report maker when it is on, so a file can hold every row. It is asked to fetch only what it needs (counts, sums, the columns it uses). A big database (over 40 tables, or a map too large) is shown as a table list, and the assistant looks up the tables it needs.
- Cost: each query it runs is one action, like a method call. Looking at the tables is free.
- Seen by you: each query appears in the thread with its row count or error, and in the audit log (
database.queried) with its SQL.
A read-only login for Postgres:
CREATE ROLE determesh_reader LOGIN PASSWORD 'choose-a-strong-one';
GRANT CONNECT ON DATABASE yourdb TO determesh_reader;
GRANT USAGE ON SCHEMA public TO determesh_reader;
GRANT SELECT ON table_one, table_two TO determesh_reader; -- or ON ALL TABLES IN SCHEMA public
ALTER ROLE determesh_reader SET default_transaction_read_only = on;
For MySQL or MariaDB:
CREATE USER 'determesh_reader'@'%' IDENTIFIED BY 'choose-a-strong-one';
GRANT SELECT ON yourdb.* TO 'determesh_reader'@'%';
Documents (folders) and Document (files)
Upload documents into a folder (Add documents, one or many, up to 1 GB each) or one document into a file resource. For each:
- Read: the assistant searches its text. Readable: PDF with a text layer, Word, Excel, CSV, plain text and Markdown. Scans, images, audio and video cannot be read yet ("Not readable").
- Shareable: it may be handed to a user who asks for it (as a document on Telegram, an attachment by email, a link through the API).
A file must be readable, shareable or both. Uploading a file with the same name replaces it (a link already sent keeps giving the version it was sent with). After uploading, a document goes Waiting → Reading → Indexing → Read (or Not readable); the page updates by itself. The uploader is emailed when a batch of uploads is processing and when it is ready. Download gives back the original; Delete removes it.
Notes
A folder can keep notes beside it, written in chat by users allowed to write there, or here (Add note: title and Markdown text, up to 20,000 characters). Their rules start as a copy of the folder's, and changes to the folder's rules are offered for the notes too. Each user can also have personal notes, which only they reach in chat; they are listed from the user's page.
Webhooks (API and code resources)
A URL any outside service can call, such as a payment provider. Whatever it sends is passed to the method you pick, as one object parameter named call (HTTP method, headers, query, body). Make webhook with the method, a label, and optionally an expiry and a maximum number of calls. The URL is shown once. Each call received is one action; the list shows each call with its status and your method's answer. Up to 1 MB per call and 120 calls a minute per webhook.
Verification groups (Resources page)
A group has one verifier (a resource whose purpose is Verifier). When a resource in the group says a user must be verified first, the assistant has the verifier verify them, and the user is then allowed across the whole group for the verification time. Create a group with a name and verifier; set a resource's group on its page. See Access rules for verifiers.
Writing good summaries
- Say what it answers and does, in the words users would use: "Leave balances, leave policy, applying for leave."
- Say what it does not cover if it is easily confused with another resource.
- For methods, "What it does" should say when to use it: "Use when the user asks for their payslip for a given month."
- Keep folder summaries about the folder's purpose; the assistant finds documents inside by their content.